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 17:10:23 +0200 (CEST)

> >    2. Define the function as
> > 
> >         FT_Error  FT_Get_Char_Index( FT_Face   face,
> >                                      FT_ULong  charcode,
> >                                      FT_UInt*  index );
> > 
> > I prefer 2.
> 
> Option 2 sounds fine...

David?  Others?  This is an important change, and I want to hear more
opinions...

> But in z1driver.c, function Get_Char_index (which is assigned as the
> callback for FTDriver_getCharIndex in the type1z driver) uses the
> cmap which is passed to it, which is face->charmap
> (face->charmap[0], not face->charmap[1]).  If I add code to
> z1driver.c to use face->charmap[1], Ft_Get_Char_Index returns poper
> values for CMEX10, etc...

I still don't see the problem.  You have to select the proper CharMap
with FT_Set_Charmap().  If you don't do that, Unicode will be selected
(which is of course a bit unfortunate for CMEX10 :-).  It is
important, however, to check face->unicode_map->num_codes after a call
to Z1_Init_Face() to see how many glyphs can be mapped at all.  Maybe
we should move this field to FT_CharMapRec so that the user can access
this number for all font formats in a uniform way.  Of course, only
for synthesized mappings this value has significance; for real
charmaps it should be set equal to -1 or something else.


    Werner



reply via email to

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