import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.scene.control.Label; import javafx.scene.text.Font; import javafx.scene.layout.VBox; public class LucidaArabic extends Application { private void init(Stage primaryStage) { String fontName1 = "Lucida Sans Regular"; String fontName2 = "Arial"; int size = 16; String labelString = "\u0645\u0646\u0627\u0645\u0629 \u0627\u0644\u062d\u0631\u064a\u0631 \u0627\u0644\u0645\u0646\u0633\u0648\u062c\u0629 \u0644\u062a\u0628\u0627\u062f\u0644 \u0627\u0644\u0643\u0648\u0627\u0631\u062a\u0632 \u0627\u0644\u0623\u0632\u0631\u0642\u061f\n"; Group root = new Group(); primaryStage.setScene(new Scene(root)); VBox vbox = new VBox(2); Label label1 = new Label(); label1.setFont(new Font(fontName1, size)); String realFont1 = ((com.sun.javafx.font.CompositeFontResource)((com.sun.javafx.font.PGFont)label1.getFont().impl_getNativeFont()).getFontResource()).getSlotResource(0).getFullName(); label1.setText(realFont1 + "--" + labelString); Label label2 = new Label(); label2.setFont(new Font(fontName2, size)); String realFont2 = ((com.sun.javafx.font.CompositeFontResource)((com.sun.javafx.font.PGFont)label2.getFont().impl_getNativeFont()).getFontResource()).getSlotResource(0).getFullName(); label2.setText(realFont2 + "--" + labelString); vbox.getChildren().addAll(label1, label2); root.getChildren().add(vbox); } @Override public void start(Stage primaryStage) throws Exception { init(primaryStage); primaryStage.setTitle("JavaFXFontTest - " + System.getProperty("javafx.runtime.version")); primaryStage.show(); } public static void main(String[] args) { launch(args); } }