[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] can i obtain the number of available face indexs of a font file
From: |
Werner LEMBERG |
Subject: |
Re: [ft] can i obtain the number of available face indexs of a font file before we new faces from it? |
Date: |
Tue, 10 Mar 2009 18:01:45 +0100 (CET) |
> i see there`s face_index parameter in all new_face functions,i s it
> possible to list all available values, so i can let user make a
> choice to create a new face with the face index they choosed?
From the documentation of FT_Open_Face:
FT_Open_Face can be used to quickly check whether the font format of
a given font resource is supported by FreeType. 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. After
examination, the returned FT_Face structure should be deallocated
with a call to FT_Done_Face.
Werner