Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Text not scaled on HiDPI screen #600

Open
Exlll opened this issue Sep 22, 2019 · 3 comments
Open

Text not scaled on HiDPI screen #600

Exlll opened this issue Sep 22, 2019 · 3 comments

Comments

@Exlll
Copy link

Exlll commented Sep 22, 2019

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();
    }
}
@kevinrushforth
Copy link
Collaborator

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

@Bio7
Copy link

Bio7 commented Oct 30, 2019

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

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

@Exlll
Copy link
Author

Exlll commented Mar 1, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants