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

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

问题描述

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

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

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

我可以吗

  1. (手动)查找 L&F 支持哪些 Unicode 字符,
  2. 还是在运行时找出来?

或者,它应该只依赖于 L&F 的默认字体,我的问题可能应该是:
我如何知道哪种 Java 字体支持哪些 Unicode 字符?"

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?"

推荐答案

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

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天全站免登陆