On Mon, 8 Apr 2019 20:55:37 +, Dryden, Thomas wrote:
> I'm attempting to extract all glyphs from a TTF in order to create a
> table of each glyph's width.
If you want to get all glyphs, then just call FT_Load_Glyph for every
index in the range from 1 up to num_glyphs - 1 inclusive. That will
I'm currently using the following functions to load glyphs:
FT_Get_Char_Index()
FT_Load_Glyph()
We noticed our rendering was slow, so we instrumented around these two calls.
We're running on a 32 bit processor, but was still surprised to find that
FT_Load_Glyph() was taking 500ns. Is this a
> And use the `ftview' demo program with the `-e UNIC' option to check
> whether FreeType is able to display the font.
`-e unic' I mean.
Werner
___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype
> 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
> Yes - I did the following iteration over all charmaps. It yielded
> 3607 'chars'. Still, 10x less than expected. [...]
Use the `ttx' font disassembler to analyze your font.
https://github.com/fonttools/fonttools
And use the `ftview' demo program with the `-e UNIC' option to check
Laco/Armin,
Yes - I did the following iteration over all charmaps. It yielded 3607 'chars'.
Still, 10x less than expected. It occurred to me that maybe the 'chars' are
used together to make different Chinese characters?
-Thomas
for (int i=0; inum_charmaps; i++)
{
gindex = 0;
Good point Armin,
If you go trough every charmap in FT_Face then you should be able iterate
all glyphs. And this is definitely faster than using FT_Load_Glyph. In rare
cases there can be glyphs in font which are not referenced by any charmap,
but then many program cannot work with it.
Best
-
Please ignore my last email (see below), I had dropped the .ttf files into
the wrong folder.
It works brilliantly with Windows .ttf files, very impressive!
Regards
Richard
_
From: Richard Abercrombie
Sent: Tuesday, 9 April 2019 2:27 PM
To:
Hi Thomas,
have you tried to iterate over every charmap, as Laco suggested? Basically
keeping your loop but putting something like that around it:
```
for ( int c = 0, cc = face->num_charmaps; c < cc; ++c ) {
FT_Error err = FT_Set_Charmap( face, face->charmaps[c] );
if ( !err ) {
//