peeta
peeta

Reputation: 61

JavaFX8: How to shut down anti-aliasing on text?

I'm currently working on application in Java, using JavaFX. Window from program will be as stream on low-resolution LED screen. What I need is completely shut-down anti aliasing on all text within the window (label text, textarea, etc).

I've googled few times, tried CSS -fx-smooth and dig into documentation, still without success. My application is running on Windows 7 Pro 64bit, in system settings is antialiasing shut down, could someone point me to right direction?

Upvotes: 5

Views: 1089

Answers (2)

Niss36
Niss36

Reputation: 365

While this question is one year old, I recently struggled with the same problem and didn't find a solution here. However, by tinkering around I found that the System properties "prism.lcdtext" and "prism.subpixeltext" are checked before the start(Stage) method is called. The work-around is therefore to set those properties in your public static void main(String[]), before the call to launch :

public static void main(String[] args) {

    System.setProperty("prism.lcdtext", "false");
    System.setProperty("prism.subpixeltext", "false");

    launch(args);
}

Upvotes: 1

Tom V.
Tom V.

Reputation: 323

Have you tried to turn off the system property for smoothing fonts:

System.setProperty("prism.lcdtext", "false");

Maybe take a look at: How to force anti-aliasing in JavaFX fonts?

Upvotes: 2

Related Questions