开发者

Determining in Java whether a particular font can render a particular character

开发者 https://www.devze.com 2023-03-17 05:23 出处:网络
Is there a way in Java to determine whether a pa开发者_如何转开发rticular font can render a particular character?Try

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);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消