|
|
|
@ -162,6 +162,9 @@ |
|
|
|
|
#define CUR_Func_move( z, p, d ) \ |
|
|
|
|
CUR.func_move( EXEC_ARG_ z, p, d ) |
|
|
|
|
|
|
|
|
|
#define CUR_Func_move_orig( z, p, d ) \ |
|
|
|
|
CUR.func_move_orig( EXEC_ARG_ z, p, d ) |
|
|
|
|
|
|
|
|
|
#define CUR_Func_dualproj( x, y ) \ |
|
|
|
|
CUR.func_dualproj( EXEC_ARG_ x, y ) |
|
|
|
|
|
|
|
|
@ -515,8 +518,7 @@ |
|
|
|
|
|
|
|
|
|
if ( *size < new_max ) |
|
|
|
|
{ |
|
|
|
|
FT_FREE( *buff ); |
|
|
|
|
if ( FT_ALLOC( *buff, new_max * multiplier ) ) |
|
|
|
|
if ( FT_REALLOC( *buff, *size, new_max * multiplier ) ) |
|
|
|
|
return error; |
|
|
|
|
*size = new_max; |
|
|
|
|
} |
|
|
|
@ -1566,7 +1568,6 @@ |
|
|
|
|
|
|
|
|
|
if ( v != 0 ) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
zone->cur[point].x += TT_MULDIV( distance, |
|
|
|
|
v * 0x10000L, |
|
|
|
|
CUR.F_dot_P ); |
|
|
|
@ -1578,7 +1579,6 @@ |
|
|
|
|
|
|
|
|
|
if ( v != 0 ) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
zone->cur[point].y += TT_MULDIV( distance, |
|
|
|
|
v * 0x10000L, |
|
|
|
|
CUR.F_dot_P ); |
|
|
|
@ -1588,6 +1588,51 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
/* */ |
|
|
|
|
/* <Function> */ |
|
|
|
|
/* Direct_Move_Orig */ |
|
|
|
|
/* */ |
|
|
|
|
/* <Description> */ |
|
|
|
|
/* Moves a point by a given distance along the freedom vector. The */ |
|
|
|
|
/* point will not be `touched'. */ |
|
|
|
|
/* */ |
|
|
|
|
/* <Input> */ |
|
|
|
|
/* point :: The index of the point to move. */ |
|
|
|
|
/* */ |
|
|
|
|
/* distance :: The distance to apply. */ |
|
|
|
|
/* */ |
|
|
|
|
/* <InOut> */ |
|
|
|
|
/* zone :: The affected glyph zone. */ |
|
|
|
|
/* */ |
|
|
|
|
static void |
|
|
|
|
Direct_Move_Orig( EXEC_OP_ TT_GlyphZone zone, |
|
|
|
|
FT_UShort point, |
|
|
|
|
FT_F26Dot6 distance ) |
|
|
|
|
{ |
|
|
|
|
FT_F26Dot6 v; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING |
|
|
|
|
FT_ASSERT( !CUR.face->unpatented_hinting ); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
v = CUR.GS.freeVector.x; |
|
|
|
|
|
|
|
|
|
if ( v != 0 ) |
|
|
|
|
zone->org[point].x += TT_MULDIV( distance, |
|
|
|
|
v * 0x10000L, |
|
|
|
|
CUR.F_dot_P ); |
|
|
|
|
|
|
|
|
|
v = CUR.GS.freeVector.y; |
|
|
|
|
|
|
|
|
|
if ( v != 0 ) |
|
|
|
|
zone->org[point].y += TT_MULDIV( distance, |
|
|
|
|
v * 0x10000L, |
|
|
|
|
CUR.F_dot_P ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
/* */ |
|
|
|
|
/* Special versions of Direct_Move() */ |
|
|
|
@ -1622,6 +1667,38 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
/* */ |
|
|
|
|
/* Special versions of Direct_Move_Orig() */ |
|
|
|
|
/* */ |
|
|
|
|
/* The following versions are used whenever both vectors are both */ |
|
|
|
|
/* along one of the coordinate unit vectors, i.e. in 90% of the cases. */ |
|
|
|
|
/* */ |
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
Direct_Move_Orig_X( EXEC_OP_ TT_GlyphZone zone, |
|
|
|
|
FT_UShort point, |
|
|
|
|
FT_F26Dot6 distance ) |
|
|
|
|
{ |
|
|
|
|
FT_UNUSED_EXEC; |
|
|
|
|
|
|
|
|
|
zone->org[point].x += distance; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
Direct_Move_Orig_Y( EXEC_OP_ TT_GlyphZone zone, |
|
|
|
|
FT_UShort point, |
|
|
|
|
FT_F26Dot6 distance ) |
|
|
|
|
{ |
|
|
|
|
FT_UNUSED_EXEC; |
|
|
|
|
|
|
|
|
|
zone->org[point].y += distance; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
/* */ |
|
|
|
|
/* <Function> */ |
|
|
|
@ -1656,7 +1733,7 @@ |
|
|
|
|
if ( distance >= 0 ) |
|
|
|
|
{ |
|
|
|
|
val = distance + compensation; |
|
|
|
|
if ( val < 0 ) |
|
|
|
|
if ( distance && val < 0 ) |
|
|
|
|
val = 0; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
@ -1696,7 +1773,7 @@ |
|
|
|
|
if ( distance >= 0 ) |
|
|
|
|
{ |
|
|
|
|
val = distance + compensation + 32; |
|
|
|
|
if ( val > 0 ) |
|
|
|
|
if ( distance && val > 0 ) |
|
|
|
|
val &= ~63; |
|
|
|
|
else |
|
|
|
|
val = 0; |
|
|
|
@ -1740,7 +1817,7 @@ |
|
|
|
|
if ( distance >= 0 ) |
|
|
|
|
{ |
|
|
|
|
val = ( ( distance + compensation ) & -64 ) + 32; |
|
|
|
|
if ( val < 0 ) |
|
|
|
|
if ( distance && val < 0 ) |
|
|
|
|
val = 0; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
@ -1782,7 +1859,7 @@ |
|
|
|
|
if ( distance >= 0 ) |
|
|
|
|
{ |
|
|
|
|
val = distance + compensation; |
|
|
|
|
if ( val > 0 ) |
|
|
|
|
if ( distance && val > 0 ) |
|
|
|
|
val &= ~63; |
|
|
|
|
else |
|
|
|
|
val = 0; |
|
|
|
@ -1826,7 +1903,7 @@ |
|
|
|
|
if ( distance >= 0 ) |
|
|
|
|
{ |
|
|
|
|
val = distance + compensation + 63; |
|
|
|
|
if ( val > 0 ) |
|
|
|
|
if ( distance && val > 0 ) |
|
|
|
|
val &= ~63; |
|
|
|
|
else |
|
|
|
|
val = 0; |
|
|
|
@ -1870,7 +1947,7 @@ |
|
|
|
|
if ( distance >= 0 ) |
|
|
|
|
{ |
|
|
|
|
val = distance + compensation + 16; |
|
|
|
|
if ( val > 0 ) |
|
|
|
|
if ( distance && val > 0 ) |
|
|
|
|
val &= ~31; |
|
|
|
|
else |
|
|
|
|
val = 0; |
|
|
|
@ -1919,7 +1996,7 @@ |
|
|
|
|
{ |
|
|
|
|
val = ( distance - CUR.phase + CUR.threshold + compensation ) & |
|
|
|
|
-CUR.period; |
|
|
|
|
if ( val < 0 ) |
|
|
|
|
if ( distance && val < 0 ) |
|
|
|
|
val = 0; |
|
|
|
|
val += CUR.phase; |
|
|
|
|
} |
|
|
|
@ -1967,7 +2044,7 @@ |
|
|
|
|
{ |
|
|
|
|
val = ( ( distance - CUR.phase + CUR.threshold + compensation ) / |
|
|
|
|
CUR.period ) * CUR.period; |
|
|
|
|
if ( val < 0 ) |
|
|
|
|
if ( distance && val < 0 ) |
|
|
|
|
val = 0; |
|
|
|
|
val += CUR.phase; |
|
|
|
|
} |
|
|
|
@ -2243,13 +2320,15 @@ |
|
|
|
|
|
|
|
|
|
if ( CUR.GS.both_x_axis ) |
|
|
|
|
{ |
|
|
|
|
CUR.func_project = Project_x; |
|
|
|
|
CUR.func_move = Direct_Move_X; |
|
|
|
|
CUR.func_project = Project_x; |
|
|
|
|
CUR.func_move = Direct_Move_X; |
|
|
|
|
CUR.func_move_orig = Direct_Move_Orig_X; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
CUR.func_project = Project_y; |
|
|
|
|
CUR.func_move = Direct_Move_Y; |
|
|
|
|
CUR.func_project = Project_y; |
|
|
|
|
CUR.func_move = Direct_Move_Y; |
|
|
|
|
CUR.func_move_orig = Direct_Move_Orig_Y; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ( CUR.GS.dualVector.x == 0x4000 ) |
|
|
|
@ -2300,16 +2379,23 @@ |
|
|
|
|
CUR.func_dualproj = (TT_Project_Func)Dual_Project; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
CUR.func_move = (TT_Move_Func)Direct_Move; |
|
|
|
|
CUR.func_move = (TT_Move_Func)Direct_Move; |
|
|
|
|
CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig; |
|
|
|
|
|
|
|
|
|
if ( CUR.F_dot_P == 0x40000000L ) |
|
|
|
|
{ |
|
|
|
|
if ( CUR.GS.freeVector.x == 0x4000 ) |
|
|
|
|
CUR.func_move = (TT_Move_Func)Direct_Move_X; |
|
|
|
|
{ |
|
|
|
|
CUR.func_move = (TT_Move_Func)Direct_Move_X; |
|
|
|
|
CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_X; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
if ( CUR.GS.freeVector.y == 0x4000 ) |
|
|
|
|
CUR.func_move = (TT_Move_Func)Direct_Move_Y; |
|
|
|
|
{ |
|
|
|
|
CUR.func_move = (TT_Move_Func)Direct_Move_Y; |
|
|
|
|
CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2891,7 +2977,8 @@ |
|
|
|
|
if ( args[1] == 0 ) \
|
|
|
|
|
CUR.error = TT_Err_Divide_By_Zero; \
|
|
|
|
|
else \
|
|
|
|
|
args[0] = TT_MULDIV( args[0], 64L, args[1] ); |
|
|
|
|
/* Should args[0] be cast to FT_Int64 first? */ \
|
|
|
|
|
args[0] = ( args[0] * 64L ) / args[1]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define DO_MUL \ |
|
|
|
@ -5359,11 +5446,11 @@ |
|
|
|
|
last_point = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* XXX: UNDOCUMENTED! SHC doesn't touch the points */ |
|
|
|
|
/* XXX: UNDOCUMENTED! SHC does touch the points */ |
|
|
|
|
for ( i = first_point; i <= last_point; i++ ) |
|
|
|
|
{ |
|
|
|
|
if ( zp.cur != CUR.zp2.cur || refp != i ) |
|
|
|
|
MOVE_Zp2_Point( i, dx, dy, FALSE ); |
|
|
|
|
MOVE_Zp2_Point( i, dx, dy, TRUE ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -5498,9 +5585,11 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* XXX: UNDOCUMENTED! behaviour */ |
|
|
|
|
if ( CUR.GS.gep0 == 0 ) /* if in twilight zone */ |
|
|
|
|
if ( CUR.GS.gep1 == 0 ) /* if the point that is to be moved */ |
|
|
|
|
/* is in twilight zone */ |
|
|
|
|
{ |
|
|
|
|
CUR.zp1.org[point] = CUR.zp0.org[CUR.GS.rp0]; |
|
|
|
|
CUR_Func_move_orig( &CUR.zp1, point, args[1] ); |
|
|
|
|
CUR.zp1.cur[point] = CUR.zp1.org[point]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|