I don't know a direct method to get the Unicode for a given glyph, but you could build a mapping in the following way:
- Get all characters of the font with
CTFontCopyCharacterSet()
. - Map all these Unicode characters to their glyph with
CTFontGetGlyphsForCharacters()
. - For each Unicode character and its glyph, store the mapping
glyph -> Unicode
in a dictionary.