Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
114 views
in Technique[技术] by (71.8m points)

java - GUI: How can I find out if certain Unicode characters are supported?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...