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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
diff --git a/ChangeLog b/ChangeLog
index a6cc7df..3376a24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
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'.
Reported as
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 07b3ef0..5d347e8 100644
--- 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;
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 60bfda9..b3b9761 100644
--- 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 );