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

RFE: Font's created with createFont to be available to new Font(..) etc.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • client-libs
    • None
    • 2d
    • b53
    • generic
    • generic

      The Font.createFont() APIs returns a Font instance which must be used
      via deriveFont APIs to get new instances and sizes.

      ie all uses of it must look like
       try {
           Font f = Font.createFont(instream, Font.TRUETYPE_FONT);
           f = f.deriveFont(12f);
           graphics.setFont(f);
        } catch (FontFormatException e) {
        }
       and can not(!) be like

       try {
           Font f = Font.createFont(instream, Font.TRUETYPE_FONT);
           f = new Font(f.getFontName(), Font.PLAIN, 12);
           graphics.setFont(f);
        } catch (FontFormatException e) {
        }

      Essentially these fonts live in a private name space.

      There are use cases where this is limiting.
      If you are utilising a package which reads font string names from some
      source and uses new Font(..) with that name (or ill-advisedly uses getFont)
      then this requires that the Font be an installed Font and not one created
      via the createFont API.

      This RFE requests that there be a supported mechanism for Fonts loaded
      via createFont to be available via the Font construction APIs.

      ###@###.### 2005-03-24 19:08:27 GMT

            prr Philip Race
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: