openjdk-jfx icon indicating copy to clipboard operation
openjdk-jfx copied to clipboard

Text not scaled on HiDPI screen

Open Exlll opened this issue 5 years ago • 3 comments

I use Debian 10 (Buster) with JDK 13. The text is displayed very small on my screen.

Screenshot from 2019-09-22 14-37-04

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();
    }
}

Exlll avatar Sep 22 '19 12:09 Exlll

This GitHub issue tracker is not actively tracked or managed. Please file a bug at bugreport.java.com.

kevinrushforth avatar Sep 30 '19 13:09 kevinrushforth

I already filed a bug report related to this bug, see:

https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8233181

Bio7 avatar Oct 30 '19 11:10 Bio7

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.

Exlll avatar Mar 01 '20 04:03 Exlll