[autofit] Improve tracing of `latin' hinter. * src/autofit/aflatin.c (af_latin_metrics_init_blues): Report blue zone types. (af_latin_metrics_scale_dim): Report scaling changes due to x height alignment. Report scaled stroke width and blue zone values.
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 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
diff --git a/ChangeLog b/ChangeLog
index 8787d69..d880f3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-10-12 Werner Lemberg <wl@gnu.org>
+
+ [autofit] Improve tracing of `latin' hinter.
+
+ * src/autofit/aflatin.c (af_latin_metrics_init_blues): Report blue
+ zone types.
+ (af_latin_metrics_scale_dim): Report scaling changes due to x height
+ alignment.
+ Report scaled stroke width and blue zone values.
+
2013-10-03 Dave Arnold <darnold@adobe.com>
* src/cff/cf2font.c (cf2_computeDarkening): Avoid division by zero.
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index d00b996..0bc9748 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -232,7 +232,44 @@
FT_Pos* blue_shoot;
- FT_TRACE5(( "blue zone %d:\n", axis->blue_count ));
+#ifdef FT_DEBUG_LEVEL_TRACE
+ {
+ FT_Bool have_flag = 0;
+
+
+ FT_TRACE5(( "blue zone %d", axis->blue_count ));
+
+ if ( bs->properties )
+ {
+ FT_TRACE5(( " (" ));
+
+ if ( AF_LATIN_IS_TOP_BLUE( bs ) )
+ {
+ FT_TRACE5(( "top" ));
+ have_flag = 1;
+ }
+
+ if ( AF_LATIN_IS_SMALL_TOP_BLUE( bs ) )
+ {
+ if ( have_flag )
+ FT_TRACE5(( ", " ));
+ FT_TRACE5(( "small top" ));
+ have_flag = 1;
+ }
+
+ if ( AF_LATIN_IS_LONG_BLUE( bs ) )
+ {
+ if ( have_flag )
+ FT_TRACE5(( ", " ));
+ FT_TRACE5(( "long" ));
+ }
+
+ FT_TRACE5(( ")" ));
+ }
+
+ FT_TRACE5(( ":\n" ));
+ }
+#endif /* FT_DEBUG_LEVEL_TRACE */
num_flats = 0;
num_rounds = 0;
@@ -837,7 +874,20 @@
else
#endif
if ( dim == AF_DIMENSION_VERT )
+ {
scale = FT_MulDiv( scale, fitted, scaled );
+
+ FT_TRACE5((
+ "af_latin_metrics_scale_dim:"
+ " x height alignment (script `%s'):\n"
+ " "
+ " vertical scaling changed from %.4f to %.4f (by %d%%)\n"
+ "\n",
+ af_script_names[metrics->root.script_class->script],
+ axis->org_scale / 65536.0,
+ scale / 65536.0,
+ ( fitted - scaled ) * 100 / scaled ));
+ }
}
}
}
@@ -856,6 +906,10 @@
metrics->root.scaler.y_delta = delta;
}
+ FT_TRACE5(( "%s widths (script `%s')\n",
+ dim == AF_DIMENSION_HORZ ? "horizontal" : "vertical",
+ af_script_names[metrics->root.script_class->script] ));
+
/* scale the widths */
for ( nn = 0; nn < axis->width_count; nn++ )
{
@@ -864,15 +918,30 @@
width->cur = FT_MulFix( width->org, scale );
width->fit = width->cur;
+
+ FT_TRACE5(( " %d scaled to %.2f\n",
+ width->org,
+ width->cur / 64.0 ));
}
+ FT_TRACE5(( "\n" ));
+
/* an extra-light axis corresponds to a standard width that is */
/* smaller than 5/8 pixels */
axis->extra_light =
(FT_Bool)( FT_MulFix( axis->standard_width, scale ) < 32 + 8 );
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( axis->extra_light )
+ FT_TRACE5(( "this font is extra light\n"
+ "\n" ));
+#endif
+
if ( dim == AF_DIMENSION_VERT )
{
+ FT_TRACE5(( "blue zones (script `%s')\n",
+ af_script_names[metrics->root.script_class->script] ));
+
/* scale the blue zones */
for ( nn = 0; nn < axis->blue_count; nn++ )
{
@@ -944,6 +1013,19 @@
#endif
blue->flags |= AF_LATIN_BLUE_ACTIVE;
+
+ FT_TRACE5(( " reference %d: %d scaled to %.2f%s\n"
+ " overshoot %d: %d scaled to %.2f%s\n",
+ nn,
+ blue->ref.org,
+ blue->ref.fit / 64.0,
+ blue->flags & AF_LATIN_BLUE_ACTIVE ? ""
+ : " (inactive)",
+ nn,
+ blue->shoot.org,
+ blue->shoot.fit / 64.0,
+ blue->flags & AF_LATIN_BLUE_ACTIVE ? ""
+ : " (inactive)" ));
}
}
}