GUI:我如何知道是否支持某些Unicode字符? [英] GUI: How can I find out if certain Unicode characters are supported?

查看:178
本文介绍了GUI:我如何知道是否支持某些Unicode字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到Metal L& F不支持来自Unicode的某些箭头字符,而Nimbus和GTK L& F支持它们。

不支持字符只显示为: ...



我可以吗?$ b $ (手动),L& F支持哪个Unicode字符,

  • ,或者在运行时找到它? b

  • 编辑:或者应该只依赖于L& F的默认字体, :

    我怎么知道哪个Java字体支持哪个Unicode字符? / div>

    您可以使用 canDisplay 方法来测试 java.awt.Font 对象是否可以显示一个给定的角色。
    您通常可以使用 getFont()方法从GUI组件获取字体。


    I noticed that Metal L&F doesn't support certain arrow characters from Unicode, while Nimbus and GTK L&Fs do support them.

    Unsupported characters are just displayed as: ...

    Can I

    1. either look up (manually), which L&F supports which Unicode chars,
    2. or find it out at runtime?

    EDIT: Or, should it only depend on the L&F's default font, my question perhaps should be:
    "how do I find out, which Java font supports which Unicode characters?"

    解决方案

    You can use the canDisplay method to test if a java.awt.Font object can display a given character. You can typically get the font from GUI components using the getFont() method.

    这篇关于GUI:我如何知道是否支持某些Unicode字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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