14

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

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
java.is.for.desktop
  • 10,748
  • 12
  • 69
  • 103

3 Answers3

14

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.

user268396
  • 11,576
  • 2
  • 31
  • 26
2

If you know which unicode block contains the arrows you need, you can look it up here. Unfortunately there doesn't seem to be a page for newer JDK's.

Kintaro
  • 1,287
  • 11
  • 17
1

Using this piece of code you use almost every Unicode ta.setFont(new java.awt.Font("Segoe UI Emoji", 1, 20));