views:

166

answers:

1

Hi folks,

I'm wondering if there's a way to determine whether or not a font supports a particular Unicode character in Cocoa Touch.

Alternatively, is it possible to specify the default substitute character?

+1  A: 

Check out CTFontGetGlyphsForCharacters in the Core Text framework. If it returns zero for a given Unicode character's glyph index, then that character isn't supported in that font. The function returns false if any of the glyphs couldn't be found.

Tony
Core Text isn't really an option for me because it's only been introduced to iPhone OS with version 3.2 for the iPad.
conmulligan
In that case, you can use `CGFontGetGlyphWithGlyphName`, and pass in a string with just the character in question. I don't know what the rules are for composed characters, for example Helvetica on iPhone OS 3.1.3 has a glyph for e, but returns zero for é, ´, and combining acute accent.
Tony