shithub: freetype+ttf2subf

Download patch

ref: ffee64afb83f66b9cd599d61f1e49c8100010a9e
parent: 33655a96474888d9fd46da351944d89635207293
author: Werner Lemberg <[email protected]>
date: Mon Aug 26 08:55:48 EDT 2013

Better tracing of loaded glyphs.

Previously, the loading of a glyph was traced at level 4, if at all.
With this change, all font loading routines emit a tracing message
at level 1, making it easier to select tracing output (for example
using F2_DEBUG="any:1 afhints:7 aflatin:7").

* src/bdf/bdfdrivr.c (BDF_Glyph_Load): Add tracing message.
* src/cff/cffdrivr.c (cff_glyph_load): Ditto.
* src/cff/cffgload.c (cff_decoder_prepare): Improve tracing
messages.
* src/cid/cidgload.c (cid_load_glyph): Use level 1 for tracing
message.
* src/pcf/pcfdrivr.c (PCF_Glyph_Load): Ditto.
* src/pfr/pfrobjs.c (pfr_slot_load): Add tracing message.
* src/truetype/ttgload.c (TT_Load_Glyph): Ditto.
* src/type1/t1gload.c (T1_Load_Glyph): Ditto.
* src/type42/t42objs.c (T42_GlyphSlot_Load): Ditto.
* src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
 2013-08-26  Werner Lemberg  <[email protected]>
 
+	Better tracing of loaded glyphs.
+
+	Previously, the loading of a glyph was traced at level 4, if at all. 
+	With this change, all font loading routines emit a tracing message
+	at level 1, making it easier to select tracing output (for example
+	using F2_DEBUG="any:1 afhints:7 aflatin:7").
+
+	* src/bdf/bdfdrivr.c (BDF_Glyph_Load): Add tracing message.
+	* src/cff/cffdrivr.c (cff_glyph_load): Ditto.
+	* src/cff/cffgload.c (cff_decoder_prepare): Improve tracing
+	messages.
+	* src/cid/cidgload.c (cid_load_glyph): Use level 1 for tracing
+	message.
+	* src/pcf/pcfdrivr.c (PCF_Glyph_Load): Ditto.
+	* src/pfr/pfrobjs.c (pfr_slot_load): Add tracing message.
+	* src/truetype/ttgload.c (TT_Load_Glyph): Ditto.
+	* src/type1/t1gload.c (T1_Load_Glyph): Ditto.
+	* src/type42/t42objs.c (T42_GlyphSlot_Load): Ditto.
+	* src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto.
+
+2013-08-26  Werner Lemberg  <[email protected]>
+
 	[autofit] Fix script selection.
 
 	* src/autofit/afglobal.c (af_face_globals_get_metrics): Use
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -674,6 +674,8 @@
       goto Exit;
     }
 
+    FT_TRACE1(( "BDF_Glyph_Load: glyph index %d\n", glyph_index ));
+
     /* index 0 is the undefined glyph */
     if ( glyph_index == 0 )
       glyph_index = bdf->default_glyph;
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -164,6 +164,8 @@
     if ( !slot )
       return FT_THROW( Invalid_Slot_Handle );
 
+    FT_TRACE1(( "cff_glyph_load: glyph index %d\n", glyph_index ));
+
     /* check whether we want a scaled outline or bitmap */
     if ( !size )
       load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -434,7 +434,7 @@
         goto Exit;
       }
 
-      FT_TRACE3(( "glyph index %d (subfont %d):\n", glyph_index, fd_index ));
+      FT_TRACE3(( "  in subfont %d:\n", fd_index ));
 
       sub = cff->subfonts[fd_index];
 
@@ -447,10 +447,6 @@
         builder->hints_globals = (void *)internal->subfonts[fd_index];
       }
     }
-#ifdef FT_DEBUG_LEVEL_TRACE
-    else
-      FT_TRACE3(( "glyph index %d:\n", glyph_index ));
-#endif
 
     decoder->num_locals    = sub->local_subrs_index.count;
     decoder->locals        = sub->local_subrs;
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -58,7 +58,7 @@
 #endif
 
 
-    FT_TRACE4(( "cid_load_glyph: glyph index %d\n", glyph_index ));
+    FT_TRACE1(( "cid_load_glyph: glyph index %d\n", glyph_index ));
 
 #ifdef FT_CONFIG_OPTION_INCREMENTAL
 
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -481,7 +481,7 @@
     FT_UNUSED( load_flags );
 
 
-    FT_TRACE4(( "load_glyph %d ---", glyph_index ));
+    FT_TRACE1(( "PCF_Glyph_Load: glyph index %d\n", glyph_index ));
 
     if ( !face || glyph_index >= (FT_UInt)face->root.num_glyphs )
     {
@@ -574,8 +574,6 @@
     ft_synthesize_vertical_metrics( &slot->metrics,
                                     ( face->accel.fontAscent +
                                       face->accel.fontDescent ) << 6 );
-
-    FT_TRACE4(( " --- ok\n" ));
 
   Exit:
     return error;
--- a/src/pfr/pfrgload.c
+++ b/src/pfr/pfrgload.c
@@ -763,7 +763,7 @@
         PFR_SubGlyph  subglyph;
 
 
-        FT_TRACE4(( "subglyph %d:\n", n ));
+        FT_TRACE4(( "  subglyph %d:\n", n ));
 
         subglyph   = glyph->subs + old_count + n;
         old_points = base->n_points;
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -324,6 +324,8 @@
     FT_ULong     gps_offset;
 
 
+    FT_TRACE1(( "pfr_slot_load: glyph index %d\n", gindex ));
+
     if ( gindex > 0 )
       gindex--;
 
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -2204,6 +2204,8 @@
 
     error = FT_Err_Ok;
 
+    FT_TRACE1(( "TT_Load_Glyph: glyph index %d\n", glyph_index ));
+
 #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
 
     /* try to load embedded bitmap if any              */
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -300,6 +300,8 @@
       goto Exit;
     }
 
+    FT_TRACE1(( "T1_Load_Glyph: glyph index %d\n", glyph_index ));
+
     FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) );
 
     if ( load_flags & FT_LOAD_NO_RECURSE )
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -648,6 +648,8 @@
     FT_Driver_Class  ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz;
 
 
+    FT_TRACE1(( "T42_GlyphSlot_Load: glyph index %d\n", glyph_index ));
+
     t42_glyphslot_clear( t42slot->ttslot );
     error = ttclazz->load_glyph( t42slot->ttslot,
                                  t42size->ttsize,
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -984,6 +984,8 @@
       goto Exit;
     }
 
+    FT_TRACE1(( "FNT_Load_Glyph: glyph index %d\n", glyph_index ));
+
     if ( glyph_index > 0 )
       glyph_index--;                           /* revert to real index */
     else