I have created a simple JavaFX application with a few text nodes that contain an emoji followed by a string:
public class App extends Application
{
public static void main( String[] args )
{
launch( args );
}
@Override
public void start( Stage primaryStage )
{
TextFlow textFlow = new TextFlow();
Text text1 = new Text( "uD83DuDE00" + " " + "foo" + "n" );
Text text2 = new Text( "uD83DuDE01" + " " + "bar" + "n" );
Text text3 = new Text( "uD83DuDE02" + " " + "baz" + "n" );
textFlow.getChildren().addAll( text1, text2, text3 );
VBox vbox = new VBox( textFlow );
Scene scene = new Scene( vbox, 300, 200 );
primaryStage.setScene( scene );
primaryStage.show();
}
}
Running this on macOS only shows the first text node correctly.
For the other two, the emoji is shown but not the following text (I can’t include images here yet).
Changing the font or replacing the VBox with other UI elements doesn’t change anything. Removing the emojis shows all strings correctly. I have previously tested this on Windows 10 and it worked there.
Is there any solution for this? I work on a larger app where I need to display text containing emojis. At the moment, the issue creates a lot of gaps in the text flow.
Those are the characteristics of my dev environment:
- OS: macOS 15.2
- CPU: Apple M4
- javafx-controls version: 23.0.1
- controlsfx version: 11.2.1
- JDK: OpenJDK Runtime Environment Corretto-21.0.5.11.1 (build 21.0.5+11-LTS)