Re: [AD] Loading non-unicode TTF fonts

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


According to FreeType documentation it is trying to do their best:

By default, when a new face object is created, it selects a Unicode
charmap. FreeType tries to emulate a Unicode charmap if the font
doesn't contain such a charmap, based on glyph names. Note that it is
possible that the emulation misses glyphs if glyph names are
non-standard. For some fonts, including symbol fonts and (older) fonts
for Asian scripts, no Unicode emulation is possible at all.
[http://www.freetype.org/freetype2/docs/tutorial/step1.html]

This issue doesn't have obvious solution. Wild guess just hide the
problem. My advice would be to dump damaged font.
But if it is not possible I would like to see a big warning message
while selecting applying your workaround.


On 31 August 2012 10:54, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> On 29 Aug 2012, at 20:47 , Evert Glebbeek wrote:
>> 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
>
> No comments?
>
> Evert
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> --
> https://lists.sourceforge.net/lists/listinfo/alleg-developers



-- 
thedmd, Michał Cichoń
Artifex Mundi
michcic@xxxxxxxxxx
http://www.artifexmundi.com




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