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

JavaFX should support FXD Font.fontFromURL directly to load 'embedded' fonts.

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:

      Description

      FXD provides support for a "Font.fontFromURL" method, but JavaFX itself only supports looking up fonts via the font-family name method, which is broken on all platforms.

      Why is it broken? Well, the same font file, one different oses, can have a different name. There is no standard for building a font-family name from internal font info.

      On macs, the font family-name returned for a system-font could be "Foo Regular Bold" and on Windows "Foo-Bold Regular". I have seen this behavior across Linux vs Windows and Mac. The font libraries for all three systems will provide differing font-family names for the same font. This makes fonts unportable. Also, the family name returned for a font installed on the system can differ from the font family name that Java comes up with loading a font from its own local font directory.

      The only way to GUARANTEE you get the font you are asking for is to directly load the TTF file.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: