Mac上的JavaFX WebView字体问题 [英] JavaFX WebView font issue on Mac
本文介绍了Mac上的JavaFX WebView字体问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
某些网站显示乱码而不是正确的文本.它仅在Mac上发生.
Some sites show gibberish characters instead of the correct text. It only happens on Macs.
例如,使用GMapsFX:
For example with GMapsFX:
可能与OS X 10.11或10.12有关.我用Java 1.8.0_121进行了测试.
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?
推荐答案
就我而言,该错误与系统字体无关.我通过为Web引擎设置用户代理解决了该问题.这是我使用的字符串(在Windows x64上为Firefox):
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
这篇关于Mac上的JavaFX WebView字体问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文