I am using a Java FX2.2 WebView embedded in a JPanel for showing web pages. This works well, except for the default font that I don't like. It looks very bold/rounded/anti-aliased/blurry.
On the left is the text from my Chrome browser, on the right of the FX Browser.
It seems that it is using the "System Regular" Font as a default font, this font is returned by Font.getDefault(). I have tried changing it with reflection but the browser still uses the same font.
Also I looked into WebView.setFontScale()
and WebView.setFontSmoothingType()
, the first only changes the size and the latter only has a 2nd font smoothing type that is even worse than the default.
I looked at Safari, which is, like FX WebView, based on WebKit, and this browser has the option to change the default font (I think most browsers have this option).
Does anyone know a way to change this default Font for the Java FX WebView?
EDIT: Made a feature request here: https://bugs.openjdk.java.net/browse/JDK-8090968