Reputation: 7894
Is there a way in Java to determine whether a particular font can render a particular character?
Upvotes: 2
Views: 352
Reputation: 27234
Try
Font f = ... ; // you have your font
Character c = 'ن'; // Nun, N, in Farsi
if(!f.canDisplay(c)) {
int gcode = f.getMissingGlyphCode();
System.out.format("not supported. Glyph code used: %d\n", gcode);
}
Upvotes: 4