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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • None
    • javafx

      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.

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: