<div dir="ltr"><div>Hi,</div><div><br></div><div>This possible bug is reported here:</div><div><a href="https://bugs.openjdk.org/browse/JDK-8322251">https://bugs.openjdk.org/browse/JDK-8322251</a><br></div><div><br></div><div>Running the code bellow produces incorrect text on Ubuntu 24.04 (still not released). I would like to fix it, but some hints would be appreciated.</div><div><br></div><div>I might be missing a font, but the same text render fine on GTK based applications.</div><div><br></div><div><div style="background-color:rgb(30,31,34);color:rgb(188,190,196)"><pre style="font-family:"JetBrains Mono",monospace"><span style="color:rgb(207,142,109)">import </span>javafx.application.Application;<br><span style="color:rgb(207,142,109)">import </span>javafx.scene.Scene;<br><span style="color:rgb(207,142,109)">import </span>javafx.scene.control.TextArea;<br><span style="color:rgb(207,142,109)">import </span>javafx.scene.layout.StackPane;<br><span style="color:rgb(207,142,109)">import </span>javafx.stage.Stage;<br><br><span style="color:rgb(207,142,109)">public class </span>TextAreaSample <span style="color:rgb(207,142,109)">extends </span>Application {<br><br>    <span style="color:rgb(179,174,96)">@Override<br></span><span style="color:rgb(179,174,96)">    </span><span style="color:rgb(207,142,109)">public void </span><span style="color:rgb(86,168,245)">start</span>(Stage primaryStage) {<br>        TextArea textArea = <span style="color:rgb(207,142,109)">new </span>TextArea();<br>        textArea.setText(<span style="color:rgb(106,171,115)">"</span><span style="color:rgb(106,171,115);font-family:"DejaVu Sans Mono",monospace">你好,世界</span><span style="color:rgb(106,171,115)">"</span>);<br><br>        StackPane root = <span style="color:rgb(207,142,109)">new </span>StackPane();<br>        root.getChildren().add(textArea);<br><br>        Scene scene = <span style="color:rgb(207,142,109)">new </span>Scene(root, <span style="color:rgb(42,172,184)">300</span>, <span style="color:rgb(42,172,184)">200</span>);<br>        primaryStage.setTitle(<span style="color:rgb(106,171,115)">"Test"</span>);<br>        primaryStage.setScene(scene);<br><br>        primaryStage.show();<br>    }<br><br>    <span style="color:rgb(207,142,109)">public static void </span><span style="color:rgb(86,168,245)">main</span>(String[] args) {<br>        <span style="font-style:italic">launch</span>(TextAreaSample.<span style="color:rgb(207,142,109)">class</span>, args);<br>    }<br>}<br></pre></div></div><div><pre style="color:rgb(255,255,255)"><br></pre></div><div>Ubuntu 22.04</div><img src="cid:ii_lsx3bhaq0" alt="image.png" width="320" height="255"><div><br></div><div>Ubuntu 24.04 (nightly build):</div><div><img src="cid:ii_lsx3fotk1" alt="image.png" width="304" height="242"><br></div><div><br></div><div>-- Thiago<br><div><br></div><div><br></div><div><pre style="color:rgb(255,255,255)">import javafx.application.Application;
import javafx.scene.Scene;</pre><pre style="color:rgb(255,255,255)">import javafx.scene.control.TextArea;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class TextAreaSample extends Application {

    @Override
    public void start(Stage primaryStage) {
        TextArea textArea = new TextArea();
        textArea.setText("你好,世界");

        StackPane root = new StackPane();
        root.getChildren().add(textArea);

        Scene scene = new Scene(root, 300, 200);
        primaryStage.setTitle("Test");
        primaryStage.setScene(scene);

        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(TextAreaSample.class, args);
    }
}</pre></div></div></div>