[AD] Loading non-unicode TTF fonts

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I ran across a few old TTF files that don't have a uinicode mapping table defined. That means that when freetype loads the file, it leaves the character map blank, which in turn means no characters will be mapped to glyphs. In short, no text is rendered in that case.

Presumably the best that can be done is select some alternative encoding that is compatible with Allegro's UTF8 strings, at least for the non-unicode portion. It wasn't immediately obvious to me which of the freetype encodings would be good, so I went with the stupid but straightforward approach: find what charmaps are available for the font and just pick the first one. This indeed fixes the problem for me.

Patch attached.

Evert

Attachment: ttf_charmap.diff
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/