shithub: freetype+ttf2subf

Download patch

ref: 5e53db25ff480d4417154836385fa51f85a045cb
parent: 278f64b3309054941a8e8acc9a65aec3b6b054cd
author: Werner Lemberg <[email protected]>
date: Tue Aug 27 14:37:39 EDT 2013

[autofit] While tracing, report script names instead of ID values.

* src/autofit/afglobal.c (af_script_names) [FT_DEBUG_LEVEL_TRACE]:
New array.
* src/autofit/afglobal.h: Updated.

* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_hint_edges): Use `af_script_names'.
* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_hint_edges): Ditto.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2013-08-27  Werner Lemberg  <[email protected]>
+
+	[autofit] While tracing, report script names instead of ID values.
+
+	* src/autofit/afglobal.c (af_script_names) [FT_DEBUG_LEVEL_TRACE]:
+	New array.
+	* src/autofit/afglobal.h: Updated.
+
+	* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
+	af_cjk_hint_edges): Use `af_script_names'.
+	* src/autofit/aflatin.c (af_latin_metrics_init_widths,
+	af_latin_hint_edges): Ditto.
+
 2013-08-26  Werner Lemberg  <[email protected]>
 
 	[autofit] Report used script while hinting a glyph.
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -74,10 +74,10 @@
 
 
     FT_TRACE5(( "\n"
-                "cjk standard widths computation (script %d)\n"
-                "===========================================\n"
+                "cjk standard widths computation (script `%s')\n"
+                "===============================================\n"
                 "\n",
-                metrics->root.script_class->script ));
+                af_script_names[metrics->root.script_class->script] ));
 
     af_glyph_hints_init( hints, face->memory );
 
@@ -1665,9 +1665,9 @@
 #endif
 
 
-    FT_TRACE5(( "cjk %s edge hinting (script %d)\n",
+    FT_TRACE5(( "cjk %s edge hinting (script `%s')\n",
                 dim == AF_DIMENSION_VERT ? "horizontal" : "vertical",
-                hints->metrics->script_class->script ));
+                af_script_names[hints->metrics->script_class->script] ));
 
     /* we begin by aligning all stems relative to the blue zone */
 
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -61,6 +61,22 @@
 #endif /* !FT_CONFIG_OPTION_PIC */
 
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+#undef  SCRIPT
+#define SCRIPT( s, S )  #s,
+
+  FT_LOCAL_ARRAY_DEF( char* )
+  af_script_names[] =
+  {
+
+#include "afscript.h"
+
+  };
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
+
   /* Compute the script index of each glyph within a given face. */
 
   static FT_Error
--- a/src/autofit/afglobal.h
+++ b/src/autofit/afglobal.h
@@ -34,6 +34,10 @@
   FT_LOCAL_ARRAY( AF_ScriptClass )
   af_script_classes[];
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+  FT_LOCAL_ARRAY( char* )
+  af_script_names[];
+#endif
 
   /*
    *  Default values and flags for both autofitter globals (found in
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -61,10 +61,10 @@
 
 
     FT_TRACE5(( "\n"
-                "latin standard widths computation (script %d)\n"
-                "=============================================\n"
+                "latin standard widths computation (script `%s')\n"
+                "=================================================\n"
                 "\n",
-                metrics->root.script_class->script ));
+                af_script_names[metrics->root.script_class->script] ));
 
     af_glyph_hints_init( hints, face->memory );
 
@@ -1897,9 +1897,9 @@
 #endif
 
 
-    FT_TRACE5(( "latin %s edge hinting (script %d)\n",
+    FT_TRACE5(( "latin %s edge hinting (script `%s')\n",
                 dim == AF_DIMENSION_VERT ? "horizontal" : "vertical",
-                hints->metrics->script_class->script ));
+                af_script_names[hints->metrics->script_class->script] ));
 
     /* we begin by aligning all stems relative to the blue zone */
     /* if needed -- that's only for horizontal edges            */