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

Text renders RTL text backwards sometimes.

    Details

      Description

      The following test case shows two Text nodes with the three first letters in the Hebrew alphabet. The first node incorrectly shows the characters rendered from left-to-right (though not mirrored).

      The second node consists of two lines, and this node displays both lines correctly.

      See attached image.

      import javafx.application.*;
      import javafx.scene.*;
      import javafx.scene.layout.*;
      import javafx.scene.text.*;
      import javafx.stage.*;

      public class Hebrew extends Application {

          public static void main(String[] args) { launch(args); }

          @Override public void start(Stage stage) {
              VBox rootNode = new VBox(10);
              rootNode.setStyle("-fx-padding: 20;");

              Text text = new Text();
              text.setText("\u05D0\u05D1\u05D2"); // alef bet gibel
              rootNode.getChildren().add(text);

              text = new Text();
              text.setText("\u05D0\u05D1\u05D2\n\u05D0\u05D1\u05D2"); // Two lines
              rootNode.getChildren().add(text);

              Scene scene = new Scene(rootNode);
              stage.setScene(scene);
              stage.show();
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                fheidric Felipe Heidrich (Inactive)
                Reporter:
                leifs Leif Samuelsson (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: