last (tiny) fix to the bytecode interpreter and code cleanup
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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
diff --git a/ChangeLog b/ChangeLog
index d8ce492..429c6d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-03-26 David Turner <david@freetype.org>
+
+ * src/truetype/ttinterp.c: last fix for the MD instruction bytecode and
+ remove the FIX_BYTECODE macros from the sources. Woot, this looks good.
+
2007-03-26 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
* builds/unix/ftconfig.in: disable Carbon framework dependency on
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 944943e..7a45cc5 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -16,11 +16,6 @@
/***************************************************************************/
- /* define FIX_BYTECODE to implement the bytecode interpreter fixes */
- /* needed to match Windows behaviour more accurately */
-#define FIX_BYTECODE
-
-
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_CALC_H
@@ -4831,34 +4826,7 @@
if ( CUR.opcode & 1 )
D = CUR_Func_project( CUR.zp0.cur + L, CUR.zp1.cur + K );
else
- {
-
-#ifdef FIX_BYTECODE
-
- FT_Vector vec1;
-
-
- if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 )
- {
- vec1.x = CUR.zp0.org[L].x - CUR.zp1.org[K].x;
- vec1.y = CUR.zp0.org[L].y - CUR.zp1.org[K].y;
- }
- else
- {
- /* get scaled orus coordinates */
- vec1.x = TT_MULFIX( CUR.zp0.orus[L].x - CUR.zp1.orus[K].x,
- CUR.metrics.x_scale );
- vec1.y = TT_MULFIX( CUR.zp0.orus[L].y - CUR.zp1.orus[K].y,
- CUR.metrics.y_scale );
- }
- D = CUR_fast_dualproj( &vec1 );
-
-#else
-
D = CUR_Func_dualproj( CUR.zp0.org + L, CUR.zp1.org + K );
-
-#endif /* FIX_BYTECODE */
- }
}
args[0] = D;
@@ -5780,8 +5748,6 @@
/* XXX: Is there some undocumented feature while in the */
/* twilight zone? */
-#ifdef FIX_BYTECODE
-
/* XXX: UNDOCUMENTED: twilight zone special case */
if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 )
@@ -5816,13 +5782,6 @@
}
}
-#else
-
- org_dist = CUR_Func_dualproj( CUR.zp1.org + point,
- CUR.zp0.org + CUR.GS.rp0 );
-
-#endif /* FIX_BYTECODE */
-
/* single width cut-in test */
if ( FT_ABS( org_dist - CUR.GS.single_width_value ) <
@@ -6174,8 +6133,6 @@
/* SOMETIMES, DUMBER CODE IS BETTER CODE */
-#ifdef FIX_BYTECODE
-
static void
Ins_IP( INS_ARG )
{
@@ -6262,93 +6219,6 @@
CUR.new_top = CUR.args;
}
-#else /* !FIX_BYTECODE */
-
- static void
- Ins_IP( INS_ARG )
- {
- FT_F26Dot6 org_a, org_b, org_x,
- cur_a, cur_b, cur_x,
- distance = 0;
- FT_UShort point;
-
- FT_UNUSED_ARG;
-
-
- if ( CUR.top < CUR.GS.loop )
- {
- CUR.error = TT_Err_Invalid_Reference;
- return;
- }
-
- /* XXX: There are some glyphs in some braindead but popular */
- /* fonts out there (e.g. [aeu]grave in monotype.ttf) */
- /* calling IP[] with bad values of rp[12]. */
- /* Do something sane when this odd thing happens. */
-
- if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) ||
- BOUNDS( CUR.GS.rp2, CUR.zp1.n_points ) )
- {
- org_a = cur_a = 0;
- org_b = cur_b = 0;
- }
- else
- {
- org_a = CUR_fast_dualproj( &CUR.zp0.org[CUR.GS.rp1] );
- org_b = CUR_fast_dualproj( &CUR.zp1.org[CUR.GS.rp2] );
-
- cur_a = CUR_fast_project( &CUR.zp0.cur[CUR.GS.rp1] );
- cur_b = CUR_fast_project( &CUR.zp1.cur[CUR.GS.rp2] );
- }
-
- while ( CUR.GS.loop > 0 )
- {
- CUR.args--;
-
- point = (FT_UShort)CUR.stack[CUR.args];
- if ( BOUNDS( point, CUR.zp2.n_points ) )
- {
- if ( CUR.pedantic_hinting )
- {
- CUR.error = TT_Err_Invalid_Reference;
- return;
- }
- }
- else
- {
- org_x = CUR_fast_dualproj( &CUR.zp2.org[point] );
- cur_x = CUR_fast_project ( &CUR.zp2.cur[point] );
-
- if ( ( org_a <= org_b && org_x <= org_a ) ||
- ( org_a > org_b && org_x >= org_a ) )
-
- distance = ( cur_a - org_a ) + ( org_x - cur_x );
-
- else if ( ( org_a <= org_b && org_x >= org_b ) ||
- ( org_a > org_b && org_x < org_b ) )
-
- distance = ( cur_b - org_b ) + ( org_x - cur_x );
-
- else if ( org_b != org_a )
- /* note: it seems that rounding this value isn't a good */
- /* idea (cf. width of capital `S' in Times) */
-
- distance = TT_MULDIV( cur_b - cur_a,
- org_x - org_a,
- org_b - org_a ) + ( cur_a - cur_x );
-
- CUR_Func_move( &CUR.zp2, point, distance );
- }
-
- CUR.GS.loop--;
- }
-
- CUR.GS.loop = 1;
- CUR.new_top = CUR.args;
- }
-
-#endif /* !FIX_BYTECODE */
-
/*************************************************************************/
/* */