freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] [EXTERNAL] RE: get all glyphs


From: Werner LEMBERG
Subject: Re: [ft] [EXTERNAL] RE: get all glyphs
Date: Tue, 09 Apr 2019 18:35:07 +0200 (CEST)

> If you go trough every charmap in FT_Face then you should be able
> iterate all glyphs.

Not at all!  To get all glyphs of a font you have to iterate over the
glyph indices using `FT_Load_Glyph'.  Nothing else will work.

> And this is definitely faster than using FT_Load_Glyph.

You are comparing apples with oranges.  Iterating over a charmap
returns glyph *indices* for character codes, not glyphs.

> In rare cases there can be glyphs in font which are not referenced
> by any charmap, but then many program cannot work with it.

With OpenType and non-latin scripts, this is not the `rare case' but
rather the normal situation.  For example, Arabic has just a few dozen
code points, but sophisticated fonts provide more than 1000 glyphs for
this script (initial, isolated medial, and final forms, plenty of
ligatures, and special characters for different languages).

Today, only the simplest fonts should be directly accessed with
FreeType.  In particular, you should know in advance which font to
use.  If you want to support different scripts and different fonts in
general, I strongly recommend higher-level interfaces like HarfBuzz –
or even Pango or Qt.

To come back to the original problem: I think that you have to
explicitly select a Unicode charmap before iterating over it.


    Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]