[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.
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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
diff --git a/ChangeLog b/ChangeLog
index c58e747..7cc14df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2013-08-27 Werner Lemberg <wl@gnu.org>
+
+ [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 <wl@gnu.org>
[autofit] Report used script while hinting a glyph.
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index bcda652..85450ab 100644
--- 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 */
diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c
index e026c1c..12b6e03 100644
--- 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
diff --git a/src/autofit/afglobal.h b/src/autofit/afglobal.h
index e2f3e84..227eee7 100644
--- a/src/autofit/afglobal.h
+++ b/src/autofit/afglobal.h
@@ -34,6 +34,10 @@ FT_BEGIN_HEADER
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
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index dd925e8..93c9f31 100644
--- 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 */