Improve tracing of `FT_Open_Face'.

* src/base/ftobjs.c (FT_Open_Face): Return info on number of
available faces and numbered instances, or the indices of the
requested face and numbered instance.

* src/sfnt/sfobjs. (sfnt_open_font): Trace number of subfonts.
This commit is contained in:
Werner Lemberg 2016-12-17 10:02:19 +01:00
parent 50ff6c1eab
commit 3b125e9594
3 changed files with 37 additions and 0 deletions

View File

@ -1,3 +1,13 @@
2016-12-17 Werner Lemberg <wl@gnu.org>
Improve tracing of `FT_Open_Face'.
* src/base/ftobjs.c (FT_Open_Face): Return info on number of
available faces and numbered instances, or the indices of the
requested face and numbered instance.
* src/sfnt/sfobjs. (sfnt_open_font): Trace number of subfonts.
2016-12-17 Werner Lemberg <wl@gnu.org>
* src/cff/cffload.c (cff_load_private_dict): Always init `blend'.

View File

@ -2122,6 +2122,19 @@
FT_Module* limit;
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE3(( "FT_Open_Face: " ));
if ( face_index < 0 )
FT_TRACE3(( "Requesting number of faces and named instances\n"));
else
{
FT_TRACE3(( "Requesting face %ld", face_index & 0xFFFFL ));
if ( face_index & 0x7FFF0000L )
FT_TRACE3(( ", named instance %ld", face_index >> 16 ));
FT_TRACE3(( "\n" ));
}
#endif
/* test for valid `library' delayed to `FT_Stream_New' */
if ( ( !aface && face_index >= 0 ) || !args )
@ -2368,6 +2381,17 @@
destroy_face( memory, face, driver );
Exit:
#ifdef FT_DEBUG_LEVEL_TRACE
if ( !error && face_index < 0 )
{
FT_TRACE3(( "FT_Open_Face: The font has %ld faces\n"
" and %ld named instances for face %ld\n",
face->num_faces,
face->style_flags >> 16,
-face_index - 1 ));
}
#endif
FT_TRACE4(( "FT_Open_Face: Return %d\n", error ));
return error;

View File

@ -804,6 +804,9 @@
if ( FT_STREAM_READ_FIELDS( ttc_header_fields, &face->ttc_header ) )
return error;
FT_TRACE3(( " with %ld subfonts\n",
face->ttc_header.count ));
if ( face->ttc_header.count == 0 )
return FT_THROW( Invalid_Table );