Re: [ft] get all glyphs

2019-04-09 Thread Lawrence D'Oliveiro
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

[ft] FT_Load_Glyph() slow?

2019-04-09 Thread Dryden, Thomas
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

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

2019-04-09 Thread Werner LEMBERG
> 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

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

2019-04-09 Thread Werner LEMBERG
> 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

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

2019-04-09 Thread Werner LEMBERG
> 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

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

2019-04-09 Thread Dryden, Thomas
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;

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

2019-04-09 Thread dudasl
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 -

Re: [ft] .ttf files

2019-04-09 Thread Richard Abercrombie
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:

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

2019-04-09 Thread armin
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 ) { //