Commit 34d2818a75201faedd79fb880d054085fe38928a

Werner Lemberg 2011-09-26T08:59:21

[cff] Dump SIDs while tracing. * src/cff/cffobjs.c (cff_face_init): Do it. * src/cff/cffparse.c (cff_parser_run) [FT_DEBUG_LEVEL_TRACE] <cff_kind_string>: Identify as SID.

diff --git a/ChangeLog b/ChangeLog
index fb366fb..3eb9dea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-09-26  Werner Lemberg  <wl@gnu.org>
+
+	[cff] Dump SIDs while tracing.
+
+	* src/cff/cffobjs.c (cff_face_init): Do it.
+
+	* src/cff/cffparse.c (cff_parser_run) [FT_DEBUG_LEVEL_TRACE]
+	<cff_kind_string>: Identify as SID.
+
 2011-09-17  Werner Lemberg  <wl@gnu.org>
 
 	Remove unused FT_ALIGNMENT macro.
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index f20292f..15707a2 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -607,6 +607,24 @@
         goto Bad_Format;
       }
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+      {
+        FT_UInt     idx;
+        FT_String*  s;
+
+
+        FT_TRACE4(( "SIDs\n" ));
+
+        /* dump string index, including default strings for convenience */
+        for ( idx = 0; idx < cff->num_strings + 390; idx++ )
+        {
+          s = cff_index_get_sid_string( cff, idx );
+          if ( s )
+            FT_TRACE4(("  %5d %s\n", idx, s ));
+        }
+      }
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
       if ( !dict->has_font_matrix )
         dict->units_per_em = pure_cff ? 1000 : face->root.units_per_EM;
 
diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c
index 5e33677..61fa87c 100644
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -1004,6 +1004,9 @@
                 break;
 
               case cff_kind_string:
+                FT_TRACE4(( " %ld (SID)\n", val ));
+                break;
+
               case cff_kind_num:
                 FT_TRACE4(( " %ld\n", val ));
                 break;