André
André

Reputation: 2353

how to identify a font as symbolic in java?

I'm currently looking for a possibility in Java to identify a font as symbolic like OpenOffice does. Characters with the font Windings or Webdings and so on should be rendered with the correct "pictures".

Anyone an idea how to distinguish between normal fonts and fonts with symbols?

Upvotes: 4

Views: 869

Answers (2)

Geoffrey Zheng
Geoffrey Zheng

Reputation: 6638

I don't see any SYMBOL_CHARSET in my font properties file per VonC's answer.

A simple test seems to be if( !java.awt.Font#canDisplay('a') ). On my Windows box I get a list of symbol fonts including the mundane Symbol and Wingdings, and exotic ones like "Estrangelo Edessa".

Upvotes: 1

VonC
VonC

Reputation: 1329082

The bug Java doesn't display all characters in the windows symbol font gives a clue regarding a characteristic which is unique to symbol fonts.

They are part of SYMBOL_CHARSET (a WindowsCharsetName of a font.properties file)

So the [jdk1.6.0_10]\jre\lib\fontconfig.98.properties.src could be a first source of information to establish if a name of a font matches a symbol font, and should be loaded through Property.load().

Upvotes: 1

Related Questions