Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6352143

Classes extended from Font don't work with Fonts created with createFont()

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      A DESCRIPTION OF THE REQUEST :
      Extended clases form Font works fine with installed fonts, but doesn't work with fonts created with createFont(...) API.

      JUSTIFICATION :
      Suppose you want to extend the class Font to support some interface. Public Fonts constructors works good with instaled fonts, but none works with fonts created with createFont() API.

      Font has 2 constructors: "Font(String name, int style, int size)" and "Font(Map<? extends AttributedCharacterIterator.Attribute,?> attributes)".
      The first constructor, works only with installed fonts. The second, takes from the Attribute (family name, size, style, ...)

      An example is the class "FontUIResource". Is impossible to create an FontUIResource from Font created with a createFont(...) API.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      If you extend the Font class, you might want that create an Extended Font from other created with the comand "createFont()".

      I expected a Font protected constructor like this:
      protected Font(Font f)
      ACTUAL -
      Java 1.5 hasn't this method, but I saw that Java 1.6 'll have this constructor. Please, this constructor it's very importan for us (I work in a newspaper, and the fonts are very important for us).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                prr Philip Race
                Reporter:
                gmanwanisunw Girish Manwani (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: