问题
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