freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Found strange thing redaing code : FT_Get_First_Char


From: Werner LEMBERG
Subject: Re: [ft-devel] Found strange thing redaing code : FT_Get_First_Char
Date: Sun, 19 Jan 2014 18:27:33 +0100 (CET)

> There's a check in ftobjs.c line 3345:
>
>   if ( face && face->charmap && face->num_glyphs )
>
> 1 - Check face pointer.
> 2 - Check charmap
> 3 - Check num_glyphs  but in documentation charmap count is store on
>     num_charmap...so it's strange...
>
> It maybe a good idea to check this part of the code...
>
> The code after use char index of 0 to get first glyph index, and the
> result was check using num_glyphs, the point 3 is maybe a copy\paste
> error...

The idea of the check (3) is to assure that the font has glyphs at
all; it is not a safety check.  For an empty font we return glyph
index 0.

I've added a comment.


    Werner

reply via email to

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