freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Segfault with otf and face_index == -1


From: Ville Syrjälä
Subject: Re: [ft-devel] Segfault with otf and face_index == -1
Date: Fri, 4 Nov 2005 11:39:08 +0200
User-agent: Mutt/1.4.2i

On Thu, Nov 03, 2005 at 06:18:43PM +0100, Werner LEMBERG wrote:
> 
> > > If you call FT_New_Face with face_index < 0, it should return an
> > > empty FT_Face object to indicate that the format is supported
> > > (otherwise, an error is returned).  Moreover, the face->num_faces
> > > field can be used to determine the number of faces within the font
> > > file.  After that, the caller must destroy the FT_Face normally
> > > with FT_Done_Face
> > 
> > Ok. You should update the API docs to refelct that.
> 
> Done. Please check the CVS whether it is understandable.

I can uderstand it but I do have a suggestion for improving it.

This is a part of the current text:

 If the `face_index' field is negative, the function returns a more or 
 less empty face handle in `*aface' (if `aface' isn't NULL); the 
 function's return value is 0 if the font format is recognized, or 
 non-zero otherwise. The only useful field in this special case is 
 `face->num_faces' which gives the number of faces within the font file.  

Now it sort of jumps around from aface->return value->aface. Just 
swapping two of the clauses around makes it better IMO:

 If the `face_index' field is negative, the function's return value is 0 
 if the font format is recognized, or non-zero otherwise; the function 
 returns a more or less empty face handle in `*aface' (if `aface' isn't 
 NULL). The only useful field in this special case is `face->num_faces' 
 which gives the number of faces within the font file.


The docs for FT_New_Face() and FT_New_Memory_Face() also need to be 
updated as well...

-- 
Ville Syrjälä
address@hidden
http://www.sci.fi/~syrjala/




reply via email to

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