Java语言环境字体问题..? [英] Java Locale Font question..?

查看:177
本文介绍了Java语言环境字体问题..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑这个在OSX上与Java 1.5发生的事情! (但也可能发生在Windows上!)

我的Java Swing程序的日本用户似乎不能在JTextField中写日文符号。其实他们可以写,但没有看到他们。他们只看到块,以某种方式表明我认为字体不支持这些符号。

我设置我自己的字体由于各种原因(Lucida Sans,Font.PLAIN ,12) - 我不想改变。我的问题是:


  1. JTextFields显示日文符号而不用我设置这个字体吗?


  2. 是否可以检测到我的字体完全支持哪些语言环境,并且只在这些情况下设置它,但是为所有其他情况保留标准Java字体,如Locale.Japan?


  3. 您有任何其他建议吗?



  4. 感谢您的帮助!

    解决方案


    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:

    1. would the JTextFields show japanese Symbols without me setting this Font?

    2. 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?

    3. do you have any other suggestions?

    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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆