ref: 3b125e95944ef4cbf321479410391db9bf403c00
parent: 50ff6c1eabec6af45f26fa6b7a5bb67dd9a07f9c
author: Werner Lemberg <[email protected]>
date: Sat Dec 17 05:02:19 EST 2016
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.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2016-12-17 Werner Lemberg <[email protected]>
+ 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 <[email protected]>
+
* src/cff/cffload.c (cff_load_private_dict): Always init `blend'.
Reported as
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -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;
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -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 );