Some sites show gibberish characters instead of the correct text. It only happens on Macs.
For example with GMapsFX:
Online site:
Might be related to OS X 10.11 or 10.12. I tested it with Java 1.8.0_121.
Is there any fix or workaround for this issue?
JavaFX WebView is used to show the web pages, that’s why the name webView here. It acts as a mini or a small browser that is able to represent the pages on the view.
It is capable of showing CSS, HTML, and JAVASCRIPT code on the webView, inside the JavaFX application. To use this we need to import the library from the JavaFX while programming.
That is not a bug in JavaFX. We can make the error more elegant, by checking on the FileSystem class being null, and if so throwing a Java Exception (instead of a VM crash). But there are many places where this happens, and we should be careful not to decrease performance.
The error, in my case, was not related to system font. I solved the problem by setting the user agent for the web engine. Here is the string I used (Firefox on Windows x64):
Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0) Gecko/20100101 Firefox/10.0
please load all font in system when java application launched. but is not best answer...sorry
List<String> fontFamilies = Font.getFamilies();
for (String fontFamily: fontFamilies) {
Font.font(fontFamily);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With