summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2015-01-10 21:53:48 +0100
committerWerner Lemberg <wl@gnu.org>2015-01-10 21:53:48 +0100
commit246814554fb1ba4e8d7747e156572ad1481af13c (patch)
tree53005fa607aa9ccab4ea37d0a8bbd2e70503080c /src
parentfae0c81f6917a0f782129f085fadfe151469ba79 (diff)
downloadfreetype2-246814554fb1ba4e8d7747e156572ad1481af13c.tar.gz
[truetype] More macro expansions.
Based on a patch from Behdad. * src/truetype/ttinterp.c (SKIP_Code, GET_ShortIns, NORMalize, SET_SuperRound, ROUND_None, INS_Goto_CodeRange, CUR_Func_move, CUR_Func_move_orig, CUR_Func_round, CUR_Func_cur_ppem, CUR_Func_read_cvt, CUR_Func_write_cvt, CUR_Func_move_cvt, CURRENT_Ratio, INS_SxVTL, COMPUTE_Funcs, COMPUTE_Round, COMPUTE_Point_Displacement, MOVE_Zp2_Point): Remove by replacing with expansion. (Cur_Func_project, CUR_Func_dualproj, CUR_fast_project, CUR_fast_dualproj): Replace with macros `project', `dualproj', `fast_project', `fast_dualproj'.
Diffstat (limited to 'src')
-rw-r--r--src/truetype/ttinterp.c483
1 files changed, 213 insertions, 270 deletions
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index e153a5841..1c5e98a50 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -82,83 +82,17 @@
TT_INTERPRETER_VERSION_38 )
- /*************************************************************************/
- /* */
- /* The following macros hide the use of EXEC_ARG and EXEC_ARG_ to */
- /* increase readability of the code. */
- /* */
- /*************************************************************************/
-
-
-#define SKIP_Code() \
- SkipCode( EXEC_ARG )
-
-#define GET_ShortIns() \
- GetShortIns( EXEC_ARG )
-
-#define NORMalize( x, y, v ) \
- Normalize( EXEC_ARG_ x, y, v )
-
-#define SET_SuperRound( scale, flags ) \
- SetSuperRound( EXEC_ARG_ scale, flags )
-
-#define ROUND_None( d, c ) \
- Round_None( EXEC_ARG_ d, c )
-
-#define INS_Goto_CodeRange( range, ip ) \
- Ins_Goto_CodeRange( EXEC_ARG_ range, ip )
-
-#define CUR_Func_move( z, p, d ) \
- exc->func_move( EXEC_ARG_ z, p, d )
-
-#define CUR_Func_move_orig( z, p, d ) \
- exc->func_move_orig( EXEC_ARG_ z, p, d )
-
-#define CUR_Func_round( d, c ) \
- exc->func_round( EXEC_ARG_ d, c )
+#define project( v1, v2 ) \
+ exc->func_project( exc, (v1)->x - (v2)->x, (v1)->y - (v2)->y )
-#define CUR_Func_cur_ppem() \
- exc->func_cur_ppem( EXEC_ARG )
+#define dualproj( v1, v2 ) \
+ exc->func_dualproj( exc, (v1)->x - (v2)->x, (v1)->y - (v2)->y )
-#define CUR_Func_read_cvt( index ) \
- exc->func_read_cvt( EXEC_ARG_ index )
+#define fast_project( v ) \
+ exc->func_project( exc, (v)->x, (v)->y )
-#define CUR_Func_write_cvt( index, val ) \
- exc->func_write_cvt( EXEC_ARG_ index, val )
-
-#define CUR_Func_move_cvt( index, val ) \
- exc->func_move_cvt( EXEC_ARG_ index, val )
-
-#define CURRENT_Ratio() \
- Current_Ratio( EXEC_ARG )
-
-#define INS_SxVTL( a, b, c, d ) \
- Ins_SxVTL( EXEC_ARG_ a, b, c, d )
-
-#define COMPUTE_Funcs() \
- Compute_Funcs( EXEC_ARG )
-
-#define COMPUTE_Round( a ) \
- Compute_Round( EXEC_ARG_ a )
-
-#define COMPUTE_Point_Displacement( a, b, c, d ) \
- Compute_Point_Displacement( EXEC_ARG_ a, b, c, d )
-
-#define MOVE_Zp2_Point( a, b, c, t ) \
- Move_Zp2_Point( EXEC_ARG_ a, b, c, t )
-
-
-#define CUR_Func_project( v1, v2 ) \
- exc->func_project( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y )
-
-#define CUR_Func_dualproj( v1, v2 ) \
- exc->func_dualproj( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y )
-
-#define CUR_fast_project( v ) \
- exc->func_project( EXEC_ARG_ (v)->x, (v)->y )
-
-#define CUR_fast_dualproj( v ) \
- exc->func_dualproj( EXEC_ARG_ (v)->x, (v)->y )
+#define fast_dualproj( v ) \
+ exc->func_dualproj( exc, (v)->x, (v)->y )
/*************************************************************************/
@@ -1630,7 +1564,7 @@
FT_CALLBACK_DEF( FT_Long )
Current_Ppem_Stretched( TT_ExecContext exc )
{
- return FT_MulFix( exc->tt_metrics.ppem, CURRENT_Ratio() );
+ return FT_MulFix( exc->tt_metrics.ppem, Current_Ratio( exc ) );
}
@@ -1653,7 +1587,7 @@
Read_CVT_Stretched( TT_ExecContext exc,
FT_ULong idx )
{
- return FT_MulFix( exc->cvt[idx], CURRENT_Ratio() );
+ return FT_MulFix( exc->cvt[idx], Current_Ratio( exc ) );
}
@@ -1671,7 +1605,7 @@
FT_ULong idx,
FT_F26Dot6 value )
{
- exc->cvt[idx] = FT_DivFix( value, CURRENT_Ratio() );
+ exc->cvt[idx] = FT_DivFix( value, Current_Ratio( exc ) );
}
@@ -1689,7 +1623,7 @@
FT_ULong idx,
FT_F26Dot6 value )
{
- exc->cvt[idx] += FT_DivFix( value, CURRENT_Ratio() );
+ exc->cvt[idx] += FT_DivFix( value, Current_Ratio( exc ) );
}
@@ -2759,7 +2693,7 @@
A = -C;
}
- NORMalize( A, B, Vec );
+ Normalize( exc, A, B, Vec );
return SUCCESS;
}
@@ -2787,7 +2721,7 @@
exc->GS.projVector.y = B; \
exc->GS.dualVector.y = B; \
\
- COMPUTE_Funcs(); \
+ Compute_Funcs( exc ); \
}
@@ -2807,7 +2741,7 @@
\
GUESS_VECTOR( freeVector ); \
\
- COMPUTE_Funcs(); \
+ Compute_Funcs( exc ); \
}
@@ -2824,74 +2758,76 @@
\
GUESS_VECTOR( projVector ); \
\
- COMPUTE_Funcs(); \
+ Compute_Funcs( exc ); \
}
#define DO_SPVTL \
- if ( INS_SxVTL( (FT_UShort)args[1], \
+ if ( Ins_SxVTL( exc, \
+ (FT_UShort)args[1], \
(FT_UShort)args[0], \
exc->opcode, \
&exc->GS.projVector ) == SUCCESS ) \
{ \
exc->GS.dualVector = exc->GS.projVector; \
GUESS_VECTOR( freeVector ); \
- COMPUTE_Funcs(); \
+ Compute_Funcs( exc ); \
}
#define DO_SFVTL \
- if ( INS_SxVTL( (FT_UShort)args[1], \
+ if ( Ins_SxVTL( exc, \
+ (FT_UShort)args[1], \
(FT_UShort)args[0], \
exc->opcode, \
&exc->GS.freeVector ) == SUCCESS ) \
{ \
GUESS_VECTOR( projVector ); \
- COMPUTE_Funcs(); \
+ Compute_Funcs( exc ); \
}
#define DO_SFVTPV \
GUESS_VECTOR( projVector ); \
exc->GS.freeVector = exc->GS.projVector; \
- COMPUTE_Funcs();
-
-
-#define DO_SPVFS \
- { \
- FT_Short S; \
- FT_Long X, Y; \
- \
- \
- /* Only use low 16bits, then sign extend */ \
- S = (FT_Short)args[1]; \
- Y = (FT_Long)S; \
- S = (FT_Short)args[0]; \
- X = (FT_Long)S; \
- \
- NORMalize( X, Y, &exc->GS.projVector ); \
- \
- exc->GS.dualVector = exc->GS.projVector; \
- GUESS_VECTOR( freeVector ); \
- COMPUTE_Funcs(); \
- }
-
-
-#define DO_SFVFS \
- { \
- FT_Short S; \
- FT_Long X, Y; \
- \
- \
- /* Only use low 16bits, then sign extend */ \
- S = (FT_Short)args[1]; \
- Y = (FT_Long)S; \
- S = (FT_Short)args[0]; \
- X = S; \
- \
- NORMalize( X, Y, &exc->GS.freeVector ); \
- GUESS_VECTOR( projVector ); \
- COMPUTE_Funcs(); \
+ Compute_Funcs( exc );
+
+
+#define DO_SPVFS \
+ { \
+ FT_Short S; \
+ FT_Long X, Y; \
+ \
+ \
+ /* Only use low 16bits, then sign extend */ \
+ S = (FT_Short)args[1]; \
+ Y = (FT_Long)S; \
+ S = (FT_Short)args[0]; \
+ X = (FT_Long)S; \
+ \
+ Normalize( exc, X, Y, &exc->GS.projVector ); \
+ \
+ exc->GS.dualVector = exc->GS.projVector; \
+ GUESS_VECTOR( freeVector ); \
+ Compute_Funcs( exc ); \
+ }
+
+
+#define DO_SFVFS \
+ { \
+ FT_Short S; \
+ FT_Long X, Y; \
+ \
+ \
+ /* Only use low 16bits, then sign extend */ \
+ S = (FT_Short)args[1]; \
+ Y = (FT_Long)S; \
+ S = (FT_Short)args[0]; \
+ X = S; \
+ \
+ Normalize( exc, X, Y, &exc->GS.freeVector ); \
+ GUESS_VECTOR( projVector ); \
+ Compute_Funcs( exc ); \
}
@@ -2976,13 +2912,13 @@
#define DO_SROUND \
- SET_SuperRound( 0x4000, args[0] ); \
+ SetSuperRound( exc, 0x4000, args[0] ); \
exc->GS.round_state = TT_Round_Super; \
exc->func_round = (TT_Round_Func)Round_Super;
#define DO_S45ROUND \
- SET_SuperRound( 0x2D41, args[0] ); \
+ SetSuperRound( exc, 0x2D41, args[0] ); \
exc->GS.round_state = TT_Round_Super_45; \
exc->func_round = (TT_Round_Func)Round_Super_45;
@@ -3033,8 +2969,8 @@
#define DO_MD /* nothing */
-#define DO_MPPEM \
- args[0] = CUR_Func_cur_ppem();
+#define DO_MPPEM \
+ args[0] = exc->func_cur_ppem( exc );
/* Note: The pointSize should be irrelevant in a given font program; */
@@ -3046,8 +2982,8 @@
#else
-#define DO_MPS \
- args[0] = CUR_Func_cur_ppem();
+#define DO_MPS \
+ args[0] = exc->func_cur_ppem( exc );
#endif /* 0 */
@@ -3156,12 +3092,12 @@
args[0] = ( args[0] != args[1] );
-#define DO_ODD \
- args[0] = ( ( CUR_Func_round( args[0], 0 ) & 127 ) == 64 );
+#define DO_ODD \
+ args[0] = ( ( exc->func_round( exc, args[0], 0 ) & 127 ) == 64 );
-#define DO_EVEN \
- args[0] = ( ( CUR_Func_round( args[0], 0 ) & 127 ) == 0 );
+#define DO_EVEN \
+ args[0] = ( ( exc->func_round( exc, args[0], 0 ) & 127 ) == 0 );
#define DO_AND \
@@ -3288,39 +3224,39 @@
}
-#define DO_RCVT \
- { \
- FT_ULong I = (FT_ULong)args[0]; \
- \
- \
- if ( BOUNDSL( I, exc->cvtSize ) ) \
- { \
- if ( exc->pedantic_hinting ) \
- { \
- ARRAY_BOUND_ERROR; \
- } \
- else \
- args[0] = 0; \
- } \
- else \
- args[0] = CUR_Func_read_cvt( I ); \
+#define DO_RCVT \
+ { \
+ FT_ULong I = (FT_ULong)args[0]; \
+ \
+ \
+ if ( BOUNDSL( I, exc->cvtSize ) ) \
+ { \
+ if ( exc->pedantic_hinting ) \
+ { \
+ ARRAY_BOUND_ERROR; \
+ } \
+ else \
+ args[0] = 0; \
+ } \
+ else \
+ args[0] = exc->func_read_cvt( exc, I ); \
}
-#define DO_WCVTP \
- { \
- FT_ULong I = (FT_ULong)args[0]; \
- \
- \
- if ( BOUNDSL( I, exc->cvtSize ) ) \
- { \
- if ( exc->pedantic_hinting ) \
- { \
- ARRAY_BOUND_ERROR; \
- } \
- } \
- else \
- CUR_Func_write_cvt( I, args[1] ); \
+#define DO_WCVTP \
+ { \
+ FT_ULong I = (FT_ULong)args[0]; \
+ \
+ \
+ if ( BOUNDSL( I, exc->cvtSize ) ) \
+ { \
+ if ( exc->pedantic_hinting ) \
+ { \
+ ARRAY_BOUND_ERROR; \
+ } \
+ } \
+ else \
+ exc->func_write_cvt( exc, I, args[1] ); \
}
@@ -3345,14 +3281,16 @@
exc->error = FT_THROW( Debug_OpCode );
-#define DO_ROUND \
- args[0] = CUR_Func_round( \
- args[0], \
+#define DO_ROUND \
+ args[0] = exc->func_round( \
+ exc, \
+ args[0], \
exc->tt_metrics.compensations[exc->opcode - 0x68] );
#define DO_NROUND \
- args[0] = ROUND_None( args[0], \
+ args[0] = Round_None( exc, \
+ args[0], \
exc->tt_metrics.compensations[exc->opcode - 0x6C] );
@@ -4448,7 +4386,7 @@
do
{
- if ( SKIP_Code() == FAILURE )
+ if ( SkipCode( exc ) == FAILURE )
return;
switch ( exc->opcode )
@@ -4488,7 +4426,7 @@
do
{
- if ( SKIP_Code() == FAILURE )
+ if ( SkipCode( exc ) == FAILURE )
return;
switch ( exc->opcode )
@@ -4680,7 +4618,7 @@
/* Now skip the whole function definition. */
/* We don't allow nested IDEFS & FDEFs. */
- while ( SKIP_Code() == SUCCESS )
+ while ( SkipCode( exc ) == SUCCESS )
{
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
@@ -4848,8 +4786,7 @@
}
else
/* Loop through the current function */
- INS_Goto_CodeRange( pRec->Caller_Range,
- pRec->Caller_IP );
+ Ins_Goto_CodeRange( exc, pRec->Caller_Range, pRec->Caller_IP );
/* Exit the current call frame. */
@@ -4938,8 +4875,7 @@
exc->callTop++;
- INS_Goto_CodeRange( def->range,
- def->start );
+ Ins_Goto_CodeRange( exc, def->range, def->start );
exc->step_ins = FALSE;
@@ -5026,7 +4962,7 @@
exc->callTop++;
- INS_Goto_CodeRange( def->range, def->start );
+ Ins_Goto_CodeRange( exc, def->range, def->start );
exc->step_ins = FALSE;
}
@@ -5089,7 +5025,7 @@
/* Now skip the whole function definition. */
/* We don't allow nested IDEFs & FDEFs. */
- while ( SKIP_Code() == SUCCESS )
+ while ( SkipCode( exc ) == SUCCESS )
{
switch ( exc->opcode )
{
@@ -5163,7 +5099,7 @@
exc->IP += 2;
for ( K = 0; K < L; K++ )
- args[K] = GET_ShortIns();
+ args[K] = GetShortIns( exc );
exc->step_ins = FALSE;
exc->new_top += L;
@@ -5218,7 +5154,7 @@
exc->IP++;
for ( K = 0; K < L; K++ )
- args[K] = GET_ShortIns();
+ args[K] = GetShortIns( exc );
exc->step_ins = FALSE;
}
@@ -5260,9 +5196,9 @@
else
{
if ( exc->opcode & 1 )
- R = CUR_fast_dualproj( &exc->zp2.org[L] );
+ R = fast_dualproj( &exc->zp2.org[L] );
else
- R = CUR_fast_project( &exc->zp2.cur[L] );
+ R = fast_project( &exc->zp2.cur[L] );
}
args[0] = R;
@@ -5295,9 +5231,9 @@
return;
}
- K = CUR_fast_project( &exc->zp2.cur[L] );
+ K = fast_project( &exc->zp2.cur[L] );
- CUR_Func_move( &exc->zp2, L, args[1] - K );
+ exc->func_move( exc, &exc->zp2, L, args[1] - K );
/* UNDOCUMENTED! The MS rasterizer does that with */
/* twilight points (confirmed by Greg Hitchcock) */
@@ -5341,7 +5277,7 @@
else
{
if ( exc->opcode & 1 )
- D = CUR_Func_project( exc->zp0.cur + L, exc->zp1.cur + K );
+ D = project( exc->zp0.cur + L, exc->zp1.cur + K );
else
{
/* XXX: UNDOCUMENTED: twilight zone special case */
@@ -5352,7 +5288,7 @@
FT_Vector* vec2 = exc->zp1.org + K;
- D = CUR_Func_dualproj( vec1, vec2 );
+ D = dualproj( vec1, vec2 );
}
else
{
@@ -5363,7 +5299,7 @@
if ( exc->metrics.x_scale == exc->metrics.y_scale )
{
/* this should be faster */
- D = CUR_Func_dualproj( vec1, vec2 );
+ D = dualproj( vec1, vec2 );
D = FT_MulFix( D, exc->metrics.x_scale );
}
else
@@ -5374,7 +5310,7 @@
vec.x = FT_MulFix( vec1->x - vec2->x, exc->metrics.x_scale );
vec.y = FT_MulFix( vec1->y - vec2->y, exc->metrics.y_scale );
- D = CUR_fast_dualproj( &vec );
+ D = fast_dualproj( &vec );
}
}
}
@@ -5443,7 +5379,7 @@
A = -C;
}
- NORMalize( A, B, &exc->GS.dualVector );
+ Normalize( exc, A, B, &exc->GS.dualVector );
{
FT_Vector* v1 = exc->zp1.cur + p2;
@@ -5467,11 +5403,11 @@
A = -C;
}
- NORMalize( A, B, &exc->GS.projVector );
+ Normalize( exc, A, B, &exc->GS.projVector );
GUESS_VECTOR( freeVector );
- COMPUTE_Funcs();
+ Compute_Funcs( exc );
}
@@ -5832,7 +5768,7 @@
*zone = zp;
*refp = p;
- d = CUR_Func_project( zp.cur + p, zp.org + p );
+ d = project( zp.cur + p, zp.org + p );
#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING
if ( exc->face->unpatented_hinting )
@@ -5927,7 +5863,7 @@
goto Fail;
}
- if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
+ if ( Compute_Point_Displacement( exc, &dx, &dy, &zp, &refp ) )
return;
while ( exc->GS.loop > 0 )
@@ -5948,10 +5884,10 @@
/* doesn't follow Cleartype spec but produces better result */
if ( SUBPIXEL_HINTING &&
exc->ignore_x_mode )
- MOVE_Zp2_Point( point, 0, dy, TRUE );
+ Move_Zp2_Point( exc, point, 0, dy, TRUE );
else
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- MOVE_Zp2_Point( point, dx, dy, TRUE );
+ Move_Zp2_Point( exc, point, dx, dy, TRUE );
exc->GS.loop--;
}
@@ -5993,7 +5929,7 @@
return;
}
- if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
+ if ( Compute_Point_Displacement( exc, &dx, &dy, &zp, &refp ) )
return;
if ( contour == 0 )
@@ -6012,7 +5948,7 @@
for ( i = start; i < limit; i++ )
{
if ( zp.cur != exc->zp2.cur || refp != i )
- MOVE_Zp2_Point( i, dx, dy, TRUE );
+ Move_Zp2_Point( exc, i, dx, dy, TRUE );
}
}
@@ -6041,7 +5977,7 @@
return;
}
- if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )
+ if ( Compute_Point_Displacement( exc, &dx, &dy, &zp, &refp ) )
return;
/* XXX: UNDOCUMENTED! SHZ doesn't move the phantom points. */
@@ -6059,7 +5995,7 @@
for ( i = 0; i < limit; i++ )
{
if ( zp.cur != exc->zp2.cur || refp != i )
- MOVE_Zp2_Point( i, dx, dy, FALSE );
+ Move_Zp2_Point( exc, i, dx, dy, FALSE );
}
}
@@ -6145,7 +6081,7 @@
if ( !exc->face->sph_compatibility_mode &&
exc->GS.freeVector.y != 0 )
{
- MOVE_Zp2_Point( point, dx, dy, TRUE );
+ Move_Zp2_Point( exc, point, dx, dy, TRUE );
/* save new point */
if ( exc->GS.freeVector.y != 0 )
@@ -6157,7 +6093,7 @@
( B1 & 63 ) != 0 &&
( B2 & 63 ) != 0 &&
B1 != B2 )
- MOVE_Zp2_Point( point, -dx, -dy, TRUE );
+ Move_Zp2_Point( exc, point, -dx, -dy, TRUE );
}
}
else if ( exc->face->sph_compatibility_mode )
@@ -6178,7 +6114,7 @@
( ( exc->is_composite && exc->GS.freeVector.y != 0 ) ||
( exc->zp2.tags[point] & FT_CURVE_TAG_TOUCH_Y ) ||
( exc->sph_tweak_flags & SPH_TWEAK_DO_SHPIX ) ) )
- MOVE_Zp2_Point( point, 0, dy, TRUE );
+ Move_Zp2_Point( exc, point, 0, dy, TRUE );
/* save new point */
if ( exc->GS.freeVector.y != 0 )
@@ -6189,21 +6125,21 @@
if ( ( B1 & 63 ) == 0 &&
( B2 & 63 ) != 0 &&
B1 != B2 )
- MOVE_Zp2_Point( point, 0, -dy, TRUE );
+ Move_Zp2_Point( exc, point, 0, -dy, TRUE );
}
}
else if ( exc->sph_in_func_flags & SPH_FDEF_TYPEMAN_DIAGENDCTRL )
- MOVE_Zp2_Point( point, dx, dy, TRUE );
+ Move_Zp2_Point( exc, point, dx, dy, TRUE );
}
else
- MOVE_Zp2_Point( point, dx, dy, TRUE );
+ Move_Zp2_Point( exc, point, dx, dy, TRUE );
}
Skip:
#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- MOVE_Zp2_Point( point, dx, dy, TRUE );
+ Move_Zp2_Point( exc, point, dx, dy, TRUE );
#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */
@@ -6259,12 +6195,11 @@
if ( exc->GS.gep1 == 0 )
{
exc->zp1.org[point] = exc->zp0.org[exc->GS.rp0];
- CUR_Func_move_orig( &exc->zp1, point, args[1] );
+ exc->func_move_orig( exc, &exc->zp1, point, args[1] );
exc->zp1.cur[point] = exc->zp1.org[point];
}
- distance = CUR_Func_project( exc->zp1.cur + point,
- exc->zp0.cur + exc->GS.rp0 );
+ distance = project( exc->zp1.cur + point, exc->zp0.cur + exc->GS.rp0 );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
/* subpixel hinting - make MSIRP respect CVT cut-in; */
@@ -6275,7 +6210,7 @@
distance = args[1];
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- CUR_Func_move( &exc->zp1, point, args[1] - distance );
+ exc->func_move( exc, &exc->zp1, point, args[1] - distance );
exc->GS.rp1 = exc->GS.rp0;
exc->GS.rp2 = point;
@@ -6310,24 +6245,26 @@
if ( ( exc->opcode & 1 ) != 0 )
{
- cur_dist = CUR_fast_project( &exc->zp0.cur[point] );
+ cur_dist = fast_project( &exc->zp0.cur[point] );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( SUBPIXEL_HINTING &&
exc->ignore_x_mode &&
exc->GS.freeVector.x != 0 )
- distance = ROUND_None(
+ distance = Round_None(
+ exc,
cur_dist,
exc->tt_metrics.compensations[0] ) - cur_dist;
else
#endif
- distance = CUR_Func_round(
+ distance = exc->func_round(
+ exc,
cur_dist,
exc->tt_metrics.compensations[0] ) - cur_dist;
}
else
distance = 0;
- CUR_Func_move( &exc->zp0, point, distance );
+ exc->func_move( exc, &exc->zp0, point, distance );
exc->GS.rp0 = point;
exc->GS.rp1 = point;
@@ -6391,7 +6328,7 @@
/* */
/* Confirmed by Greg Hitchcock. */
- distance = CUR_Func_read_cvt( cvtEntry );
+ distance = exc->func_read_cvt( exc, cvtEntry );
if ( exc->GS.gep0 == 0 ) /* If in twilight zone */
{
@@ -6417,7 +6354,7 @@
distance = 0;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- org_dist = CUR_fast_project( &exc->zp0.cur[point] );
+ org_dist = fast_project( &exc->zp0.cur[point] );
if ( ( exc->opcode & 1 ) != 0 ) /* rounding and control cut-in flag */
{
@@ -6428,15 +6365,17 @@
if ( SUBPIXEL_HINTING &&
exc->ignore_x_mode &&
exc->GS.freeVector.x != 0 )
- distance = ROUND_None( distance,
+ distance = Round_None( exc,
+ distance,
exc->tt_metrics.compensations[0] );
else
#endif
- distance = CUR_Func_round( distance,
- exc->tt_metrics.compensations[0] );
+ distance = exc->func_round( exc,
+ distance,
+ exc->tt_metrics.compensations[0] );
}
- CUR_Func_move( &exc->zp0, point, distance - org_dist );
+ exc->func_move( exc, &exc->zp0, point, distance - org_dist );
Fail:
exc->GS.rp0 = point;
@@ -6488,7 +6427,7 @@
FT_Vector* vec2 = &exc->zp0.org[exc->GS.rp0];
- org_dist = CUR_Func_dualproj( vec1, vec2 );
+ org_dist = dualproj( vec1, vec2 );
}
else
{
@@ -6499,7 +6438,7 @@
if ( exc->metrics.x_scale == exc->metrics.y_scale )
{
/* this should be faster */
- org_dist = CUR_Func_dualproj( vec1, vec2 );
+ org_dist = dualproj( vec1, vec2 );
org_dist = FT_MulFix( org_dist, exc->metrics.x_scale );
}
else
@@ -6510,7 +6449,7 @@
vec.x = FT_MulFix( vec1->x - vec2->x, exc->metrics.x_scale );
vec.y = FT_MulFix( vec1->y - vec2->y, exc->metrics.y_scale );
- org_dist = CUR_fast_dualproj( &vec );
+ org_dist = fast_dualproj( &vec );
}
}
@@ -6533,17 +6472,20 @@
if ( SUBPIXEL_HINTING &&
exc->ignore_x_mode &&
exc->GS.freeVector.x != 0 )
- distance = ROUND_None(
+ distance = Round_None(
+ exc,
org_dist,
exc->tt_metrics.compensations[exc->opcode & 3] );
else
#endif
- distance = CUR_Func_round(
- org_dist,
- exc->tt_metrics.compensations[exc->opcode & 3] );
+ distance = exc->func_round(
+ exc,
+ org_dist,
+ exc->tt_metrics.compensations[exc->opcode & 3] );
}
else
- distance = ROUND_None(
+ distance = Round_None(
+ exc,
org_dist,
exc->tt_metrics.compensations[exc->opcode & 3] );
@@ -6565,10 +6507,9 @@
/* now move the point */
- org_dist = CUR_Func_project( exc->zp1.cur + point,
- exc->zp0.cur + exc->GS.rp0 );
+ org_dist = project( exc->zp1.cur + point, exc->zp0.cur + exc->GS.rp0 );
- CUR_Func_move( &exc->zp1, point, distance - org_dist );
+ exc->func_move( exc, &exc->zp1, point, distance - org_dist );
Fail:
exc->GS.rp1 = exc->GS.rp0;
@@ -6631,7 +6572,7 @@
if ( !cvtEntry )
cvt_dist = 0;
else
- cvt_dist = CUR_Func_read_cvt( cvtEntry - 1 );
+ cvt_dist = exc->func_read_cvt( exc, cvtEntry - 1 );
/* single width test */
@@ -6657,10 +6598,8 @@
exc->zp1.cur[point] = exc->zp1.org[point];
}
- org_dist = CUR_Func_dualproj( &exc->zp1.org[point],
- &exc->zp0.org[exc->GS.rp0] );
- cur_dist = CUR_Func_project ( &exc->zp1.cur[point],
- &exc->zp0.cur[exc->GS.rp0] );
+ org_dist = dualproj( &exc->zp1.org[point], &exc->zp0.org[exc->GS.rp0] );
+ cur_dist = project ( &exc->zp1.cur[point], &exc->zp0.cur[exc->GS.rp0] );
/* auto-flip test */
@@ -6708,7 +6647,8 @@
cvt_dist = org_dist;
}
- distance = CUR_Func_round(
+ distance = exc->func_round(
+ exc,
cvt_dist,
exc->tt_metrics.compensations[exc->opcode & 3] );
}
@@ -6726,7 +6666,8 @@
}
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- distance = ROUND_None(
+ distance = Round_None(
+ exc,
cvt_dist,
exc->tt_metrics.compensations[exc->opcode & 3] );
}
@@ -6767,7 +6708,7 @@
}
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- CUR_Func_move( &exc->zp1, point, distance - cur_dist );
+ exc->func_move( exc, &exc->zp1, point, distance - cur_dist );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( SUBPIXEL_HINTING )
@@ -6791,7 +6732,7 @@
}
if ( reverse_move )
- CUR_Func_move( &exc->zp1, point, -( distance - cur_dist ) );
+ exc->func_move( exc, &exc->zp1, point, -( distance - cur_dist ) );
}
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
@@ -6856,10 +6797,10 @@
}
else
{
- distance = CUR_Func_project( exc->zp1.cur + point,
- exc->zp0.cur + exc->GS.rp0 );
+ distance = project( exc->zp1.cur + point,
+ exc->zp0.cur + exc->GS.rp0 );
- CUR_Func_move( &exc->zp1, point, -distance );
+ exc->func_move( exc, &exc->zp1, point, -distance );
}
exc->GS.loop--;
@@ -6989,11 +6930,10 @@
return;
}
- distance = CUR_Func_project( exc->zp0.cur + p2,
- exc->zp1.cur + p1 ) / 2;
+ distance = project( exc->zp0.cur + p2, exc->zp1.cur + p1 ) / 2;
- CUR_Func_move( &exc->zp1, p1, distance );
- CUR_Func_move( &exc->zp0, p2, -distance );
+ exc->func_move( exc, &exc->zp1, p1, distance );
+ exc->func_move( exc, &exc->zp0, p2, -distance );
}
@@ -7058,11 +6998,9 @@
else
{
if ( twilight )
- old_range = CUR_Func_dualproj( &exc->zp1.org[exc->GS.rp2],
- orus_base );
+ old_range = dualproj( &exc->zp1.org[exc->GS.rp2], orus_base );
else if ( exc->metrics.x_scale == exc->metrics.y_scale )
- old_range = CUR_Func_dualproj( &exc->zp1.orus[exc->GS.rp2],
- orus_base );
+ old_range = dualproj( &exc->zp1.orus[exc->GS.rp2], orus_base );
else
{
FT_Vector vec;
@@ -7073,10 +7011,10 @@
vec.y = FT_MulFix( exc->zp1.orus[exc->GS.rp2].y - orus_base->y,
exc->metrics.y_scale );
- old_range = CUR_fast_dualproj( &vec );
+ old_range = fast_dualproj( &vec );
}
- cur_range = CUR_Func_project ( &exc->zp1.cur[exc->GS.rp2], cur_base );
+ cur_range = project( &exc->zp1.cur[exc->GS.rp2], cur_base );
}
for ( ; exc->GS.loop > 0; --exc->GS.loop )
@@ -7097,9 +7035,9 @@
}
if ( twilight )
- org_dist = CUR_Func_dualproj( &exc->zp2.org[point], orus_base );
+ org_dist = dualproj( &exc->zp2.org[point], orus_base );
else if ( exc->metrics.x_scale == exc->metrics.y_scale )
- org_dist = CUR_Func_dualproj( &exc->zp2.orus[point], orus_base );
+ org_dist = dualproj( &exc->zp2.orus[point], orus_base );
else
{
FT_Vector vec;
@@ -7110,10 +7048,10 @@
vec.y = FT_MulFix( exc->zp2.orus[point].y - orus_base->y,
exc->metrics.y_scale );
- org_dist = CUR_fast_dualproj( &vec );
+ org_dist = fast_dualproj( &vec );
}
- cur_dist = CUR_Func_project( &exc->zp2.cur[point], cur_base );
+ cur_dist = project( &exc->zp2.cur[point], cur_base );
if ( org_dist )
{
@@ -7143,7 +7081,10 @@
else
new_dist = 0;
- CUR_Func_move( &exc->zp2, (FT_UShort)point, new_dist - cur_dist );
+ exc->func_move( exc,
+ &exc->zp2,
+ (FT_UShort)point,
+ new_dist - cur_dist );
}
Fail:
@@ -7470,7 +7411,7 @@
}
#endif
- P = (FT_ULong)CUR_Func_cur_ppem();
+ P = (FT_ULong)exc->func_cur_ppem( exc );
nump = (FT_ULong)args[0]; /* some points theoretically may occur more
than once, thus UShort isn't enough */
@@ -7537,7 +7478,7 @@
if ( !exc->ignore_x_mode ||
( exc->sph_tweak_flags & SPH_TWEAK_ALWAYS_DO_DELTAP ) ||
( exc->is_composite && exc->GS.freeVector.y != 0 ) )
- CUR_Func_move( &exc->zp0, A, B );
+ exc->func_move( exc, &exc->zp0, A, B );
/* Otherwise, apply subpixel hinting and compatibility mode */
/* rules, always skipping deltas in subpixel direction. */
@@ -7550,7 +7491,7 @@
/* points. This messes up DejaVu ... */
if ( !exc->face->sph_compatibility_mode &&
( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )
- CUR_Func_move( &exc->zp0, A, B );
+ exc->func_move( exc, &exc->zp0, A, B );
/* compatibility mode */
else if ( exc->face->sph_compatibility_mode &&
@@ -7563,7 +7504,7 @@
/* IUP has not been called, and point is touched on Y. */
if ( !exc->iup_called &&
( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )
- CUR_Func_move( &exc->zp0, A, B );
+ exc->func_move( exc, &exc->zp0, A, B );
}
B2 = (FT_UShort)exc->zp0.cur[A].y;
@@ -7577,13 +7518,13 @@
SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP ) &&
( B1 & 63 ) != 0 &&
( B2 & 63 ) != 0 ) ) )
- CUR_Func_move( &exc->zp0, A, -B );
+ exc->func_move( exc, &exc->zp0, A, -B );
}
}
else
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
- CUR_Func_move( &exc->zp0, A, B );
+ exc->func_move( exc, &exc->zp0, A, B );
}
}
else
@@ -7630,7 +7571,7 @@
}
#endif
- P = (FT_ULong)CUR_Func_cur_ppem();
+ P = (FT_ULong)exc->func_cur_ppem( exc );
nump = (FT_ULong)args[0];
for ( k = 1; k <= nump; k++ )
@@ -7683,7 +7624,7 @@
B++;
B *= 1L << ( 6 - exc->GS.delta_shift );
- CUR_Func_move_cvt( A, B );
+ exc->func_move_cvt( exc, A, B );
}
}
}
@@ -7850,7 +7791,7 @@
call->Cur_Count = 1;
call->Def = def;
- INS_Goto_CodeRange( def->range, def->start );
+ Ins_Goto_CodeRange( exc, def->range, def->start );
exc->step_ins = FALSE;
return;
@@ -8224,8 +8165,8 @@
exc->func_move_cvt = Move_CVT;
}
- COMPUTE_Funcs();
- COMPUTE_Round( (FT_Byte)exc->GS.round_state );
+ Compute_Funcs( exc );
+ Compute_Round( exc, (FT_Byte)exc->GS.round_state );
do
{
@@ -8361,7 +8302,7 @@
GUESS_VECTOR( freeVector );
}
- COMPUTE_Funcs();
+ Compute_Funcs( exc );
}
break;
@@ -8904,7 +8845,9 @@
callrec->Cur_Count = 1;
callrec->Def = def;
- if ( INS_Goto_CodeRange( def->range, def->start ) == FAILURE )
+ if ( Ins_Goto_CodeRange( exc,
+ def->range,
+ def->start ) == FAILURE )
goto LErrorLabel_;
goto LSuiteLabel_;