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

[macosx] System font cannot be boldened

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 8, 9
    • javafx

      MacOS Sierra uses the San Francisco system font, and occasionally this font is used in bold. In JavaFX, however, creating a bold label using the default system font does not work on mac, as the following simple test case shows. I am guessing this has something to do with how a font weight of "bold" translates to the actual font selected. I do think this is a serious bug from a user experience stand point, as JavaFX cannot visually mimic Apple's design guidelines without jumping through hoops.

      public class BoldTest extends Application {

      @Override
      public void init() throws Exception {
      }

      @Override
      public void start(Stage stage) throws Exception {
      Label normal = new Label("Normal");
      Label bold = new Label("Bold");
      bold.setStyle("-fx-font-weight: bold;");
      HBox box = new HBox();
      box.getChildren().addAll(normal, bold);
      Scene scene = new Scene(box);
      stage.setScene(scene);
      stage.setTitle("Bold test");

      stage.setWidth(600);
      stage.setHeight(600);
      stage.show();
      }

      public static void main(String... arguments) {
      launch(BoldTest.class, arguments);
      }
      }

            prr Philip Race
            risaksen Randahl Isaksen
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: