Freetype use reserve for missing glyphs

How can I tell freetype to use a backup font when the string contains a character that is not in the font that I use by default?

I need to display non-latin glyphs correctly in my application.

Do I need to manage the reserve on my own?

If yes: how to determine if there is a missing glyph in a given line?

+4
source share
2 answers

Sorry, I don’t know if you need to cope with the backup problem yourself, but I assume you will. As for how to determine if a glyph is missing, you can use this method: FT_Get_Char_index If it returns 0, then the character was not found.

0
source

GNU Unifont can serve as a backup font for each code point in the base multilingual plane (BMP), which will be 0x0000-0xFFFF . This should cover the vast majority of what you might encounter. Available for download here ( archive ).

The Unicode Last Resort font can serve as the final reserve for each code in all planes. These glyphs show only broad categories. Available for download here .

It looks like you would need to detect the lack of a glyph with FT_Get_Char_Index () as SMart explained , and in these cases, go to the Unifont or Last Resort font.

-1
source

All Articles