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

Inconsistent naming for fonts in the 'Tahoma' family.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P5
    • Resolution: Unresolved
    • Affects Version/s: 7u6
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:
    • Environment:

      Master JavaFX 2.2 - b15:

      Product: javafx-2.2.0beta
      Platform: macosx-universal
      Build-Number: 112
      Build-ID: 2012-06-26_22-35-40

      Description

      Font.getFontNames() returns a font name "Tahoma Negreta"
      However - if you use that name to create a font, you obtain a font named "Tahoma Bold":

      Font font = new Font("Tahoma Negreta", 15);
      System.out.println(font.getName()); => prints "Tahoma Bold"

      If you later try to change the size, or recreate a font from that name, you end up with the System font:

      Font font2 = new Font(font.getName(), font.getSize());
      System.out.println(font2.getName()); => prints System.

      This prevent the Tahoma font from being correctly persisted in FXML, since serializing "Tahoma Bold" gives back "System Regular" when you reload. This also prevents the SceneBuilder FontChooser from working correctly - since changing the font size replaces the font with System.

      On Mac OS - this is the only font that exhibit this strange behavior (I haven't tried on windows yet).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                prr Philip Race
                Reporter:
                dfuchs Daniel Fuchs
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported: