freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] GF's cmap fails


From: Parth Wazurkar
Subject: Re: [ft-devel] GF's cmap fails
Date: Wed, 15 Aug 2018 02:02:55 +0530

>>   ./ftview -e "" 20 cmr10.600gf
>>
>> only shows `A' glyphs.  [...]
>
> Ok. Currently the GF's cmap is like, the first glyph in the file is
> indexed to 0, and so on.  So in cmr10.600gf, `ABCD...' appear first
> so they are now indexed from `0,1,2..'

This is correct.

> what happened previously is the glyphs were indexed according to
> their charcode values extracted from the `char_loc' command and this
> was the order `ΓΔΘΛΞΠ...'.  I have properly set the encoding values,

Obviously not.

> [...] Other options with `-e' except `-e "" ' are giving proper
> output.

Not at all.  They always show the font without any cmap applied,
because there isn't a cmap with the tag you are specifying at the
command line.  As soon as you will have implemented a Unicode cmap,
`-e unic' will work also.

> Any specific reason why `-e "" ' is failing so that I can fix it?

Set a break point at `FT_Get_Char_Index' and check the return value.
For example, the function returns 0 if argument `charcode' is zero.
This is wrong, of course, since it should return value 52 (which is
the glyph index of glyph `Γ').  Character code 1 should be mapped to
glyph index 53, code 2 to index 54, etc., etc.

After some debugging, I found out that, I was using binary search on the
encodings array in the `char_index' function, although it wasn't sorted (so
foolish of me :( ).
Now, fixed! Thanks.

Although there is one more error, i.e even after displaying all the glyphs in
the font file `ftview' is displaying extra `AAA...'s, any reason why this is
happening?

Thank you

Parth

reply via email to

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