0

Some of the Unicode characters are inversely rendered in JavaFX 11.

  • Language: Tai Language

  • Font: Pyidaungsu. Click this Link to download

  • Text to render: ၸေႃႇၵျီႇ
  • OS: Windows 10
  • Program code guide: Getting started with JavaFx 11
  • Program code:

    @Override
    public void start(Stage stage) {
        String javaVersion = System.getProperty("java.version");
        String javafxVersion = System.getProperty("javafx.version");
        Label l = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
        l.setFont(new Font("Pyidaungsu", 20));
    
        String problemString = "ၸေႃႇၵျီႇ";
        String fixedString = Normalizer.normalize(problemString, Normalizer.Form.NFC);
    
        Label l2 = new Label(fixedString);
        l2.setFont(new Font("Pyidaungsu", 30));
        Scene scene = new Scene(new VBox(l, l2), 640, 480);
        stage.setScene(scene);
        stage.show();
    }
    
  • Compiling command : javac --module-path %PATH_TO_FX% --add-modules=javafx.controls,javafx.fxml HelloFX.java -encoding UTF-8

  • Result:

Result of running

The first two characters are rendered inversely. The situation is the same in JavaFX 8.

M. Ko
  • 563
  • 6
  • 31
  • 1
    That must be a text render bug for this script. Nothing you can do about it, except filing a bug report to Oracle. – Jongware Dec 03 '18 at 10:31
  • Clicking your link to the font _Pyidaungsu_ triggers an immediate download! That's not good. Please modify your question so that clicking the link sends the reader to a page where they can **choose whether to do a download or not**. Alternatively, change the text to something like _"Font: Pyidaungsu. Click [this link](http://unicode.today/fonts/Pyidaungsu-2.5_Regular.ttf) to download it."_ so that the reader will not accidentally perform an unwanted download. – skomisa Dec 26 '18 at 18:06
  • [1] If I copy your `problemString` declaration, and paste it into a NetBeans edit window, it also reverses the first two characters (`ေ` and `ၸ`), even if the display font is _Pyidaungsu_ It also does the same thing when using other valid fonts such as _Myanmar Text_. I don't have any problems when pasting into Intellij IDEA, Eclipse or STS. Were you using NetBeans to test this? [2] The browser won't allow me to select only the first character of `problemString`; the smallest unit I can select is "`ၸေ`". I don't know anything about Thai, but is that possibly relevant? – skomisa Dec 26 '18 at 20:23
  • Maybe the two IDEs use different engine? – M. Ko Jan 11 '19 at 04:40

0 Answers0