Can I improve the rendering of a JavaFX 2/8 font?

I am using Ubuntu 13.04 and coding an application to display some labels (using the Label class). I also tried using the Text class and setting the type of anti-aliasing to the LCD. The result is the same, the font looks blurry, its fields are scattered, and you must set its size to a fairly large number in order to be readable (note that I have a text paragraph).

I know that JavaFX2 has a sub-pixel visualization of the LCD, but can you still do something to make the font look less ugly? (maybe I missed something for 2.X or don’t know about the existence of anything in 8.X)

Is there a way to check if LCD subpixel support is active?

Hello,

+6
source share
2 answers

Using

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

both one by one and by time.

+8
source

Changing the font of the entire application to 'Ubuntu Light' gives me a great look. I also tried some other fonts, but they worsened the look.

Step 1: Add the following style to the application.css file.

 .text { -fx-font-family: "Ubuntu Light"; } 

Step 2: Apply the style to the parent scene.

 scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm()); 
0
source

Source: https://habr.com/ru/post/952290/


All Articles