How to disable anti-aliasing in JavaFX fonts?

随声附和 提交于 2019-12-12 16:52:02

问题


Using JavaFX to render HTML content using a javafx.scene.web.WebView, the content is always drawn with text anti-aliasing on.

Although this makes fonts look smoother, it often makes the printing of content to a monochrome/thermal style printer (receipt, shipping label) problematic. A nearest-neighbor scale would be much better.

The awt and swing techniques (-Dawt.useSystemAAFontSettings and -Dswing.aatext respectively) don't seem to help JavaFX.

There's an option to switch from lcd anti-aliasing to gray via -Dprism.lcdtext=false, which helps, but doesn't fix the anti-aliasing problem.

How does one achieve nearest-neighbor font scaling with JavaFX's WebView?

Related: JavaFX Printable to Image very pix-elated, but perfect to printer

来源:https://stackoverflow.com/questions/37797351/how-to-disable-anti-aliasing-in-javafx-fonts

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