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

Tifinagh characters not rendered properly in JavaFX

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • tbd
    • jfx11, jfx20, 8, jfx17, jfx19
    • javafx
    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10, OpenJDK 17, JavaFX SDK 19, javafx-controls 20-ea+7 (tried also other combinations, no one worked)

      A DESCRIPTION OF THE PROBLEM :
      Tifinagh alphabet characters were not rendered in JavaFX controls like Button or Label. Several Fonts were tried which are known to render these characters in an IDE or on console.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Put Tifinagh characters like ⴰⵎⴰⵟⴰⴼ into the text for JavaFX controls like Labels or Buttons.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The characters get rendered.
      ACTUAL -
      The characters get not rendered, only default symbols were shown.

      ---------- BEGIN SOURCE ----------
      package de.kontext_e.javafx_tifinagh;

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.Label;
      import javafx.scene.layout.StackPane;
      import javafx.scene.layout.VBox;
      import javafx.scene.text.Font;
      import javafx.scene.text.FontWeight;
      import javafx.stage.Stage;

      public class App extends Application {

          private static final String MESSAGE = "Hello World! " + "ⴰⵎⴰⵟⴰⴼ";

          public static void main(String[] args) {
              System.out.println(MESSAGE);
              launch(args);
          }

          @Override
          public void start(Stage primaryStage) {
              primaryStage.setTitle(MESSAGE);

              Label label = new Label(MESSAGE);

              Button button = new Button();
              button.setText("Say "+ MESSAGE);
              button.setOnAction(event -> System.out.println(MESSAGE));

              // try any font here: Arial, Consolas, Times New Roman...
              Font font = Font.font("Arial", FontWeight.NORMAL, 15);
              button.setFont(font);
              label.setFont(font);

              StackPane root = new StackPane();
              VBox vBox = new VBox();
              vBox.getChildren().addAll(label, button);
              root.getChildren().addAll(vBox);
              primaryStage.setScene(new Scene(root, 300, 300));
              primaryStage.show();
          }
      }
      // see also https://github.com/kontext-e/javafx_tifinagh for a complete Maven project with dependencies
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      No workaround known.

        1. App.java
          1 kB
        2. Capture_8u351.PNG
          Capture_8u351.PNG
          11 kB
        3. Capture.PNG
          Capture.PNG
          8 kB

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

              Created:
              Updated:
              Resolved: