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

System font on MAC won't bold or italic

XMLWordPrintable

    • x86
    • os_x

      FULL PRODUCT VERSION :
      java version "1.8.0_144"
      Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
      Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      OS X 10.12.6


      A DESCRIPTION OF THE PROBLEM :
      Running the attached program on Window and Linux the System Bold font is bold, and the System Italic font is italic. Run the same program on OS X and both System Bold and System Italic look the same as System. For all the other Fonts the Bold and Italic versions work.

       

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the attached program.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      System Bold to display as bold and System Italic to display as Italic.
      ACTUAL -
      System Bold and System Italic look the same as System.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      package com.github.liamsharp;

      import java.util.Arrays;
      import java.util.List;

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Label;
      import javafx.scene.layout.StackPane;
      import javafx.scene.layout.VBox;
      import javafx.scene.text.Font;
      import javafx.stage.Stage;
       
      public class HelloWorldJavaFX extends Application {
          public static void main(String[] args) {
              launch(args);
          }
          
          @Override
          public void start(Stage primaryStage) {
              
              for (String fontName : Font.getFontNames())
              {
                  System.out.println(fontName);
              }

              VBox vBox = new VBox();
              
              List<String> fonts = Arrays.asList(
                      "System",
                      "System Bold",
                      "System Italic",
                      "System Regular",
                      "Serif Bold",
                      "Serif Bold Italic",
                      "Serif Italic",
                      "Serif Regular",
                      "SansSerif Bold",
                      "SansSerif Bold Italic",
                      "SansSerif Italic",
                      "SansSerif Regular",
                      "Monospaced Bold",
                      "Monospaced Bold Italic",
                      "Monospaced Italic",
                      "Monospaced Regular"
                      );
              
              for (String fontName : fonts)
              {
                  final Label label = new Label(fontName);
                  label.setFont(new Font(fontName, 16));
                  vBox.getChildren().add(label);
              }
              primaryStage.setTitle("JavaFX");
              StackPane root = new StackPane();
              root.getChildren().add(vBox);
              primaryStage.setScene(new Scene(root, 300, 500));
              primaryStage.show();
          }
      }

      ---------- END SOURCE ----------

            prr Philip Race
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: