How to force anti-aliasing in JavaFX fonts?

徘徊边缘 提交于 2019-11-27 04:14:13

By default, JavaFX 8 uses modena.css to set the LCD anti aliasing, which doesn't seem to smooth fonts in some cases. When the font size is greater than 80, the AA technique changes to grey scale AA (for performance concerns). So, to achieve smooth edges at any size, grey scale AA should be used instead.

This can be done by CSS:

.text{
    -fx-font-smoothing-type: gray;
}

Or through system arguments:

-Dprism.lcdtext=false

Or setting system properties:

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

Thanks everybody who replied on Jira!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!