If the Buffer Font mode is used, non-ASCII chars (>=128) if passed as UTF8 are not displayed correctly.
The image attached to this report shows the demo application (FTGLDemo, compiled with MSVC++). The other modes work correct, just Buffer font shows the wrong glyphs. Same applies to Japanese char codes or e.g. German umlauts.
This bug is caused by the "inCache" check in FTBufferFontImpl::RenderI (FTBufferFont.cpp):
if(stringCache[i] && !StringCompare(stringCache[i], string, len))
does not work with UTF8. StringCompare just checks the first char of a multi-byte char and so chars are recognized to be cached, that just share the first byte with a cached char.
In FTFont.cpp FTFontImpl::RenderI() a FTUnicodeStringItr was used to solve a similar problem. So maybe you want to use it for Buffer Font, too.
Log in to post a comment.