* src/truetype/ttinterp.c (Ins_MD): The MD instruction also uses original, unscaled input values. Confirmed by Greg Hitchcock from Microsoft.
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
diff --git a/ChangeLog b/ChangeLog
index b5cf651..c75c6fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-28 Werner Lemberg <wl@gnu.org>
+
+ * src/truetype/ttinterp.c (Ins_MD): The MD instruction also uses
+ original, unscaled input values. Confirmed by Greg Hitchcock from
+ Microsoft.
+
2008-05-27 Werner Lemberg <wl@gnu.org>
* src/tools/docmaker/tohtml.py (block_footer_start,
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 84b65c7..2572392 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -4821,7 +4821,28 @@
if ( CUR.opcode & 1 )
D = CUR_Func_project( CUR.zp0.cur + L, CUR.zp1.cur + K );
else
- D = CUR_Func_dualproj( CUR.zp0.org + L, CUR.zp1.org + K );
+ {
+ FT_Vector* vec1 = CUR.zp0.orus + L;
+ FT_Vector* vec2 = CUR.zp1.orus + K;
+
+
+ if ( CUR.metrics.x_scale == CUR.metrics.y_scale )
+ {
+ /* this should be faster */
+ D = CUR_Func_dualproj( vec1, vec2 );
+ D = TT_MULFIX( D, CUR.metrics.x_scale );
+ }
+ else
+ {
+ FT_Vector vec;
+
+
+ vec.x = TT_MULFIX( vec1->x - vec2->x, CUR.metrics.x_scale );
+ vec.y = TT_MULFIX( vec1->y - vec2->y, CUR.metrics.y_scale );
+
+ D = CUR_fast_dualproj( &vec );
+ }
+ }
}
args[0] = D;