aureliangtx
aureliangtx

Reputation: 317

Can the rendering of the JavaFX 2/8 font be improved?

I am using Ubuntu 13.04 and coding an application to display some labels ( using the Label class ). I also tried to use Text class and set the smoothing type to LCD. The result is the same, the font looks blurry, its margins are scattered, and you have to set its size to a pretty big number in order to be readable ( note I have some text paragraph displayed ).

I know JavaFX2 has LCD sub-pixel rendering but still, can something be done so that the font doesn't look so ugly? ( maybe I'm missing something for 2.X or don't know of existence of something in 8.X )

Is there any way to check if LCD sub-pixel rendering is active or not?

Regards,

Upvotes: 6

Views: 4446

Answers (2)

Gobinath
Gobinath

Reputation: 904

Changing the font of the entire application to 'Ubuntu Light', gives me a perfect appearance. I have tried some other fonts as well, but they worsened the appearance.

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

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

Step 2: Apply the style to your parent scene.

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

Upvotes: 0

goaud27
goaud27

Reputation: 145

Use

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

both or one at time.

Upvotes: 11

Related Questions