[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] Missing glyphs vs. invisible glyphs for certain characters
From: |
Adam Twardoch (List) |
Subject: |
Re: [ft] Missing glyphs vs. invisible glyphs for certain characters |
Date: |
Fri, 4 Dec 2015 15:51:38 +0100 |
FreeType is correct. Its purpose is to display the characters associated with
character codes in a given font.
Note that the character codes passed to FT_Get_Char_Index are not necessarily
Unicode: they can be any FT_Charmap object defined in the font. There is still
a number of encoding systems in use which are not Unicode (esp. in Asia, but
also in some specialty applications).
While FreeType defaults to the font's Unicode charmap, it does not interpret
the character codes in any special way, and is indifferent to the various
special meanings of certain character codes in various encoding standards. The
same character code can stand for a control character in Unicode but for a
renderable text character in another encoding. Also, the Unicode standard grows
constantly.
Semantic handling of non-renderable character codes according to some dncoding
standard is outside of scope for FreeType.
Apps should not use FreeType to perform straight Unicode text rendering. In
fact, FT_Get_Char_Index should not be used for text rendering at all, unless
you really know what you’re doing.
FreeType is really a library to interact with fonts and render their glyphs,
*not* a library to render text.
For Unicode text layout, apps should use a Unicode text processing library such
as ICU, and a glyph layout library such as Harfbuzz before querying FreeType
for glyph images.
Best,
Adam
Sent from my mobile phone.
> On 04.12.2015, at 14:48, Preet <address@hidden> wrote:
>
> Hi all
>
> I've tried a few fonts out and I seem to be getting the same behaviour: The
> zero index is returned for a few glyphs that I thought would be 'invisible'
> such as line feed or tab when I call FT_Get_Char_Index(...). After rendering,
> the zero index glyph shows up as the visible 'missing glyph' symbol.
>
> Is this expected behavior? When rendering is it normal to go through the text
> and get rid of these characters before getting glyphs from FreeType? I'm
> aware FreeType isn't laying out the text, but I guess I thought the layout
> characters would have invisible glyphs.
>
>
> Preet
> _______________________________________________
> Freetype mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/freetype