import javafx.scene.paint.Color; import javafx.application.*; import javafx.scene.*; import javafx.scene.text.*; import javafx.scene.control.*; import javafx.scene.layout.*; import javafx.stage.*; public class CSSPtSize extends Application { public static final int WIDTH = 600; public static final int HEIGHT = 200; public static void main(String[] args) { launch(args); } public void start(Stage stage) { stage.setWidth(WIDTH); stage.setHeight(HEIGHT); stage.setTitle("CSS Font Size Test"); stage.setX((Screen.getPrimary().getVisualBounds().getWidth() - WIDTH) / 2); stage.setY((Screen.getPrimary().getVisualBounds().getHeight() - HEIGHT) / 2); stage.setScene(createScene(stage)); stage.show(); } private Scene createScene(final Stage stage){ final Scene scene = new Scene(new Group()); scene.setFill(Color.WHITE); HBox hBox = HBoxBuilder.create() .children( TextAreaBuilder.create() .style("-fx-font-style: italic; -fx-font-size: 30pt; -fx-font-family: 'Segoe Print';") .prefWidth(200) .text("1234567890") .build(), TextAreaBuilder.create() .style("-fx-font-style: italic; -fx-font-size: 30px; -fx-font-family: 'Segoe Print';") .prefWidth(200) .text("1234567890") .build(), TextAreaBuilder.create() .style("-fx-font-style: italic; -fx-font-size: 30; -fx-font-family: 'Segoe Print';") .prefWidth(200) .text("1234567890") .build() ) .build(); ((Group)scene.getRoot()).getChildren().add(hBox); return scene; } }