openjdk-jfx
openjdk-jfx copied to clipboard
Text not scaled on HiDPI screen
I use Debian 10 (Buster) with JDK 13. The text is displayed very small on my screen.
public final class App extends Application {
@Override
public void start(Stage stage) throws Exception {
var primary = Screen.getPrimary();
var javaVersion = System.getProperty("java.runtime.version");
System.out.println("DPI: " + primary.getDpi()); // output: 282.0
System.out.println("VERSION: " + javaVersion); // output: 13+33
Text message = new Text("Hello JavaFX!");
message.setFont(Font.font(20));
VBox root = new VBox();
root.getChildren().add(new Label("Hello World!"));
root.getChildren().add(new Button("Click me!"));
root.getChildren().add(message);
Scene scene = new Scene(root, 300, 100);
stage.setScene(scene);
stage.show();
}
}
This GitHub issue tracker is not actively tracked or managed. Please file a bug at bugreport.java.com.
I already filed a bug report related to this bug, see:
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8233181
I found the following workaround which at least works on my system: Passing -Dglass.gtk.uiScale=2.0
as an option to the JVM as described here https://wiki.archlinux.org/index.php/HiDPI#Java_applications.