freetype-devel
[Top][All Lists]
Advanced

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

Re: FT_Get_Char_Index() returns 0 for char(0x020)


From: Werner LEMBERG
Subject: Re: FT_Get_Char_Index() returns 0 for char(0x020)
Date: Sun, 15 Oct 2000 02:26:44 +0200 (CEST)

> The return value of FT_Get_Char_index is supposed to be a glyph
> index.  In a TT font, this is used to get an offset from the loca a
> table.  In a Type 1 font, there is no loca table, so the index is
> used to access the elements of the CharStrings dictionary, which is
> stored in a zero-based array.  Oops!  Does 0 means not defined, or
> entry zero?

Sigh.  Two possibilities:

   1. Change the return type to FT_Long and return -1 for an undefined
      glyph.

   2. Define the function as

        FT_Error  FT_Get_Char_Index( FT_Face   face,
                                     FT_ULong  charcode,
                                     FT_UInt*  index );

I prefer 2.

> 
> The other thing is that z1objs.c defines two charmaps:
>
> [...]
> 
> But z1driver.c only uses the first charmap (platform_id = 3,
> encoding_id = 1).

???  I can't follow.  Get_Char_Index() in z1driver.c uses the charmap
selected in charmap->encoding which is passed as a parameter.


    Werner



reply via email to

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