Java语言环境字体问题..? [英] Java Locale Font question..?
问题描述
我的Java Swing程序的日本用户似乎不能在JTextField中写日文符号。其实他们可以写,但没有看到他们。他们只看到块,以某种方式表明我认为字体不支持这些符号。
我设置我自己的字体由于各种原因(Lucida Sans,Font.PLAIN ,12) - 我不想改变。我的问题是:
-
JTextFields显示日文符号而不用我设置这个字体吗?
-
是否可以检测到我的字体完全支持哪些语言环境,并且只在这些情况下设置它,但是为所有其他情况保留标准Java字体,如Locale.Japan?
-
您有任何其他建议吗?
would the JTextFields show japanese Symbols without me setting this Font?
could I detect which Locale's are fully supported by my Font and only set it in those cases but leave the standard Java font for all other cases like Locale.Japan?
do you have any other suggestions?
感谢您的帮助!
JTextFields显示日文符号没有我设置这个字体?
很有可能因为JRE会选择默认值。
是否可以检测到我的字体完全支持哪些语言环境,并且只在这些情况下设置它,但是为所有其他情况保留标准Java字体,如Locale.Japan?
是的,理论上来说,测试这个字体是否可以显示本地e使用 canDisplay (char)方法。如果不是,则可以切换到默认值。
您还有其他建议吗?
您有产品链接吗?
[EDIT] this happend on OSX with Java 1.5! (but may also happen on Windows!)
It seems japanese users of my Java Swing program cannot write japanese symbols in JTextFields. Actually they can write them but do not see them. They only see blocks which somehow indicates I think that the font does not support these symbols.
I set my own font for various reasons ("Lucida Sans", Font.PLAIN, 12) - which I wouldn't like to change. My questions are:
Thank you for your help!
would the JTextFields show japanese Symbols without me setting this Font?
Most likely since the JRE will choose the default.
could I detect which Locale's are fully supported by my Font and only set it in those cases but leave the standard Java font for all other cases like Locale.Japan?
Yes, in theory, although easier would be to test if this font can display a locale specific character using the the canDisplay(char) method in Font. If it don't, you may switch to the default.
do you have any other suggestions?
Here's a link on this topic that may help
Do you have a link for your product?
这篇关于Java语言环境字体问题..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!