Tutorial :How can I determine all the codepoints that do not have glyphs in a font using FreeType?


This question is closely related to

Is there a way to programmatically determine if a font file has a specific Unicode Glyph?

However, I am looking for a solution that does not use the Windows API. Freetype in particular looks promising, and I was wondering if anyone familiar with it could provide pointers.

Basically, I'd like to, given a font, calculate a mapping from character map to a sequence of codepoints without glyphs for that character map.


With FreeType in particular, you may use the FT_Get_Char_Index function. This function returns a glyphID of 0 to indicate an unmapped glyph.

In more general terms: first you'd need to select a Character Mapping table (some fonts include multiple maps for different platforms or different purposes under a single platform), then build a dictionary from the explicitly-mapped glyphs, and test against that.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »