A lot of Unicode reported bugs in FTGL are due to Visual Studio UTF-8/UTF-16 encoding (eg. div bugs in FTCharToGlyphIndexMap.h and Indices overstepping bounds). The FTUnicodeStringItr iterator in FTUnicodeStringItr.h uses templates, and treats UTF-16 encoded characters as UTF-8, all due to Visual Studio compiler issues (tested with VS2008). Fixing the encoding of all source files corrects the problem.
May I suggest that someone with write access inserts a big warning / comment about this issue. The easist way to identify that this is the problem which people are encountering is to temporarily modify the operator FTUnicodeStringItr& operator++() so that the UTF-8 case executes the UTF-16 code path instead. If their code stops crashing / starts working, then they know that they have run into a Visual Studio related issue.
It will save countless Unicode/FTGL crashes reports.
Log in to post a comment.