Is there a way in Java to determine whether a pa开发者_如何转开发rticular font can render a particular character?
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);
}
精彩评论