- 
                Notifications
    You must be signed in to change notification settings 
- Fork 43
Description
Greetings! First of all, thanks for making this wonderful tool. I'm experiencing a crash when trying to render a font with some characters that exist in the font but for some reason cannot be loaded.
The following font file reproduces the issue for me - Hack-Regular.ttf. A sample char range that leads to crashing is 8300-8400. The message is 'Load glyph error'.
Here's what happens - isGlyphProvided reports true, then renderGlyph throws an exception because of FT_Load_Char failure.
For some reason shrinking the range towards the offending character sometimes fixes the issue, which makes me think that there could be a side effect from loading specific glyphs that affects the ones that are loaded afterwards. But it's just a speculation, I'm not very familiar with freetype internals so I may be way off. Since I'm using an autogenerated chars file shrinking the range is not an option for me (and there's no way of cleaning up the file without knowing which characters are offending).
TL;DR: Replacing FT_Get_Char_Index with FT_Load_Char (like in renderGlyph) fixes the issue, skipping the offending character (having incomplete font is better than no font, right?). I'll send a PR with this solution soon.