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

Inconsistent naming for fonts in the 'Tahoma' family.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 7u6
    • javafx
    • Master JavaFX 2.2 - b15:

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

      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).

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

              Created:
              Updated:
              Imported: