Font has glyphs but cant display through drawString
I want to use this font (originally a mac font but edited and saved to use on PC) to display a String though Graphics.drawString().
I checked if the font contains any glyphs. It does: 221 in all checked through Font.getNumGlyphs().
Font font =new Font("FontA",Font.PLAIN,12);
String dispstr =new String(newchar[]{(char)0x21});
g.setFont(font);
g.drawString(dispstr,0,0);
I only saw an empty box. So I tried Font.canDisplay((char)0x21) and it returned false! I'm pretty sure there that character 0x21 does exist in that font by checking it in my os's charmap.
Any other means to check if this font can be displayed in my java application is of course greatly appreciated.
[966 byte] By [
nodaloa] at [2007-10-3 10:30:24]

Do you mean 0x21 hex or 0x21 dec?Java supports decimal, hexidecimal,octal, and binary through designations of d, h, o, and b.0x21h = hex, base-160x21 = 21 decimal, base-100x21o = 21 octal, base-80x21b = binary, base-2
:-) Yes, yes, the font is already installed in my system.
Do you think it has something to do on how the font was saved? When I view the font's mapping through Window's charmap and have Advanced View toggled, all the input fields are disabled unlike other true type fonts that I can display in my java application.
I checked the font's properties its encoding type is Symbol. Could character encoding be the issue? Then, if simple Graphics.drawString() wouldn't work for this, what would be the workaround? ?:/
> Do you think it has something to do on how the font
> was saved? ...
> I checked the font's properties its encoding type is
> Symbol. Could character encoding be the issue?
Indeed, it was on how the font was saved!
The Font Properties Ext Tool at microsoft.com/typography/ shows more informative details on my font. Checking the font's properties, under the Charset/Unicode tab, the font's encoding type was 'Symbol', which I don't think Java supports. So I just resaved the font to ISO Latin1 encoding and installed that new ttf file to my systems font and the fonts finally appear!