Fix conditional compilation.

* include/freetype/internal/ftcalc.h (FT_MulDiv_No_Round): Don't
enclose with `TT_USE_BYTECODE_INTERPRETER'; we now need the function
elsewhere also.

* src/autofit/afcjk.h: Use AF_CONFIG_OPTION_CJK.

* src/truetype/ttgload.c (tt_loader_init): Fix compiler warning.

* src/truetype/ttinterp.c (Ins_MSIRP): Fix compiler warning.

* src/truetype/ttinterp.h: Use
TT_CONFIG_OPTION_BYTECODE_INTERPRETER.
This commit is contained in:
Werner Lemberg 2012-06-27 08:16:06 +02:00
parent ed6508c41a
commit 83c0ebabc2
6 changed files with 62 additions and 34 deletions

View File

@ -1,3 +1,20 @@
2012-06-27 Werner Lemberg <wl@gnu.org>
Fix conditional compilation.
* include/freetype/internal/ftcalc.h (FT_MulDiv_No_Round): Don't
enclose with `TT_USE_BYTECODE_INTERPRETER'; we now need the function
elsewhere also.
* src/autofit/afcjk.h: Use AF_CONFIG_OPTION_CJK.
* src/truetype/ttgload.c (tt_loader_init): Fix compiler warning.
* src/truetype/ttinterp.c (Ins_MSIRP): Fix compiler warning.
* src/truetype/ttinterp.h: Use
TT_CONFIG_OPTION_BYTECODE_INTERPRETER.
2012-06-26 Infinality <infinality@infinality.net> 2012-06-26 Infinality <infinality@infinality.net>
[truetype] Remove unused rounding functionality. [truetype] Remove unused rounding functionality.
@ -22,7 +39,7 @@
(Move_Zp2_Point, Ins_SHPIX, Ins_MSIRP, Ins_MDAP, Ins_MIAP, (Move_Zp2_Point, Ins_SHPIX, Ins_MSIRP, Ins_MDAP, Ins_MIAP,
Ins_MDRP, Ins_MIRP): Perform Round_None instead of calling a modified Ins_MDRP, Ins_MIRP): Perform Round_None instead of calling a modified
rounding function. Remove gridlines_per_pixel. Create a local rounding function. Remove gridlines_per_pixel. Create a local
variable to store control value cutin. Simplify the conditional for variable to store control value cutin. Simplify the conditional for
ignore_x_mode. Adjust rounding calls to pass only two values. ignore_x_mode. Adjust rounding calls to pass only two values.
2012-06-25 Werner Lemberg <wl@gnu.org> 2012-06-25 Werner Lemberg <wl@gnu.org>

View File

@ -78,8 +78,6 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
#ifdef TT_USE_BYTECODE_INTERPRETER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
@ -108,8 +106,6 @@ FT_BEGIN_HEADER
FT_Long b, FT_Long b,
FT_Long c ); FT_Long c );
#endif /* TT_USE_BYTECODE_INTERPRETER */
/* /*
* A variant of FT_Matrix_Multiply which scales its result afterwards. * A variant of FT_Matrix_Multiply which scales its result afterwards.

View File

@ -4,7 +4,7 @@
/* */ /* */
/* Auto-fitter hinting routines for CJK script (specification). */ /* Auto-fitter hinting routines for CJK script (specification). */
/* */ /* */
/* Copyright 2006, 2007, 2011 by */ /* Copyright 2006, 2007, 2011, 2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -103,6 +103,7 @@ FT_BEGIN_HEADER
} AF_CJKMetricsRec, *AF_CJKMetrics; } AF_CJKMetricsRec, *AF_CJKMetrics;
#ifdef AF_CONFIG_OPTION_CJK
FT_LOCAL( FT_Error ) FT_LOCAL( FT_Error )
af_cjk_metrics_init( AF_CJKMetrics metrics, af_cjk_metrics_init( AF_CJKMetrics metrics,
FT_Face face ); FT_Face face );
@ -129,6 +130,7 @@ FT_BEGIN_HEADER
af_cjk_metrics_init_widths( AF_CJKMetrics metrics, af_cjk_metrics_init_widths( AF_CJKMetrics metrics,
FT_Face face, FT_Face face,
FT_ULong charcode ); FT_ULong charcode );
#endif /* AF_CONFIG_OPTION_CJK */
/* */ /* */

View File

@ -1899,7 +1899,9 @@
{ {
TT_Face face; TT_Face face;
FT_Stream stream; FT_Stream stream;
#ifdef TT_USE_BYTECODE_INTERPRETER
FT_Bool pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC ); FT_Bool pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
#endif
face = (TT_Face)glyph->face; face = (TT_Face)glyph->face;

View File

@ -2204,7 +2204,7 @@
} }
else else
{ {
val = - FT_PIX_CEIL( compensation - distance ); val = -FT_PIX_CEIL( compensation - distance );
if ( val > 0 ) if ( val > 0 )
val = 0; val = 0;
} }
@ -2415,8 +2415,9 @@
/* Sets Super Round parameters. */ /* Sets Super Round parameters. */
/* */ /* */
/* <Input> */ /* <Input> */
/* GridPeriod :: Grid period */ /* GridPeriod :: The grid period. */
/* selector :: SROUND opcode */ /* */
/* selector :: The SROUND opcode. */
/* */ /* */
static void static void
SetSuperRound( EXEC_OP_ FT_F26Dot6 GridPeriod, SetSuperRound( EXEC_OP_ FT_F26Dot6 GridPeriod,
@ -6203,17 +6204,17 @@
Ins_MSIRP( INS_ARG ) Ins_MSIRP( INS_ARG )
{ {
FT_UShort point; FT_UShort point;
FT_F26Dot6 distance, FT_F26Dot6 distance;
control_value_cutin; #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
FT_F26Dot6 control_value_cutin;
control_value_cutin = CUR.GS.control_value_cutin; control_value_cutin = CUR.GS.control_value_cutin;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( CUR.ignore_x_mode && if ( CUR.ignore_x_mode &&
CUR.GS.freeVector.x != 0 && CUR.GS.freeVector.x != 0 &&
!( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
control_value_cutin = 0; control_value_cutin = 0;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
point = (FT_UShort)args[0]; point = (FT_UShort)args[0];
@ -6266,8 +6267,8 @@
Ins_MDAP( INS_ARG ) Ins_MDAP( INS_ARG )
{ {
FT_UShort point; FT_UShort point;
FT_F26Dot6 cur_dist, FT_F26Dot6 cur_dist;
distance; FT_F26Dot6 distance;
point = (FT_UShort)args[0]; point = (FT_UShort)args[0];
@ -6283,13 +6284,16 @@
{ {
cur_dist = CUR_fast_project( &CUR.zp0.cur[point] ); cur_dist = CUR_fast_project( &CUR.zp0.cur[point] );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( CUR.ignore_x_mode && CUR.GS.freeVector.x != 0 ) if ( CUR.ignore_x_mode &&
distance = ROUND_None( cur_dist, CUR.GS.freeVector.x != 0 )
CUR.tt_metrics.compensations[0] ) - cur_dist; distance = ROUND_None(
cur_dist,
CUR.tt_metrics.compensations[0] ) - cur_dist;
else else
#endif #endif
distance = CUR_Func_round( cur_dist, distance = CUR_Func_round(
CUR.tt_metrics.compensations[0] ) - cur_dist; cur_dist,
CUR.tt_metrics.compensations[0] ) - cur_dist;
} }
else else
distance = 0; distance = 0;
@ -6312,20 +6316,20 @@
{ {
FT_ULong cvtEntry; FT_ULong cvtEntry;
FT_UShort point; FT_UShort point;
FT_F26Dot6 distance, FT_F26Dot6 distance;
org_dist, FT_F26Dot6 org_dist;
control_value_cutin; FT_F26Dot6 control_value_cutin;
control_value_cutin = CUR.GS.control_value_cutin; control_value_cutin = CUR.GS.control_value_cutin;
cvtEntry = (FT_ULong)args[1]; cvtEntry = (FT_ULong)args[1];
point = (FT_UShort)args[0]; point = (FT_UShort)args[0];
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( CUR.ignore_x_mode && if ( CUR.ignore_x_mode &&
CUR.GS.freeVector.x != 0 && CUR.GS.freeVector.x != 0 &&
!( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
control_value_cutin = 0; control_value_cutin = 0;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
if ( BOUNDS( point, CUR.zp0.n_points ) || if ( BOUNDS( point, CUR.zp0.n_points ) ||
@ -6379,18 +6383,20 @@
org_dist = CUR_fast_project( &CUR.zp0.cur[point] ); org_dist = CUR_fast_project( &CUR.zp0.cur[point] );
if ( ( CUR.opcode & 1 ) != 0 ) /* rounding and control cutin flag */ if ( ( CUR.opcode & 1 ) != 0 ) /* rounding and control cut-in flag */
{ {
if ( FT_ABS( distance - org_dist ) > control_value_cutin ) if ( FT_ABS( distance - org_dist ) > control_value_cutin )
distance = org_dist; distance = org_dist;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( CUR.ignore_x_mode && CUR.GS.freeVector.x != 0 ) if ( CUR.ignore_x_mode &&
CUR.GS.freeVector.x != 0 )
distance = ROUND_None( distance, distance = ROUND_None( distance,
CUR.tt_metrics.compensations[0] ); CUR.tt_metrics.compensations[0] );
else else
#endif #endif
distance = CUR_Func_round( distance, CUR.tt_metrics.compensations[0] ); distance = CUR_Func_round( distance,
CUR.tt_metrics.compensations[0] );
} }
CUR_Func_move( &CUR.zp0, point, distance - org_dist ); CUR_Func_move( &CUR.zp0, point, distance - org_dist );
@ -6414,13 +6420,13 @@
FT_F26Dot6 org_dist, distance, minimum_distance; FT_F26Dot6 org_dist, distance, minimum_distance;
minimum_distance = CUR.GS.minimum_distance; minimum_distance = CUR.GS.minimum_distance;
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( CUR.ignore_x_mode && if ( CUR.ignore_x_mode &&
CUR.GS.freeVector.x != 0 && CUR.GS.freeVector.x != 0 &&
!( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
minimum_distance = 0; minimum_distance = 0;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
@ -6561,14 +6567,14 @@
minimum_distance = CUR.GS.minimum_distance; minimum_distance = CUR.GS.minimum_distance;
control_value_cutin = CUR.GS.control_value_cutin; control_value_cutin = CUR.GS.control_value_cutin;
point = (FT_UShort)args[0]; point = (FT_UShort)args[0];
cvtEntry = (FT_ULong)( args[1] + 1 ); cvtEntry = (FT_ULong)( args[1] + 1 );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( CUR.ignore_x_mode && if ( CUR.ignore_x_mode &&
CUR.GS.freeVector.x != 0 && CUR.GS.freeVector.x != 0 &&
!( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) ) !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
control_value_cutin = minimum_distance = 0; control_value_cutin = minimum_distance = 0;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */ #endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
/* XXX: UNDOCUMENTED! cvt[-1] = 0 always */ /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */

View File

@ -301,6 +301,7 @@ FT_BEGIN_HEADER
extern const TT_GraphicsState tt_default_graphics_state; extern const TT_GraphicsState tt_default_graphics_state;
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
FT_LOCAL( FT_Error ) FT_LOCAL( FT_Error )
TT_Goto_CodeRange( TT_ExecContext exec, TT_Goto_CodeRange( TT_ExecContext exec,
FT_Int range, FT_Int range,
@ -323,6 +324,7 @@ FT_BEGIN_HEADER
FT_Long multiplier, FT_Long multiplier,
void* _pbuff, void* _pbuff,
FT_ULong new_max ); FT_ULong new_max );
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
/*************************************************************************/ /*************************************************************************/
@ -347,6 +349,8 @@ FT_BEGIN_HEADER
FT_EXPORT( TT_ExecContext ) FT_EXPORT( TT_ExecContext )
TT_New_Context( TT_Driver driver ); TT_New_Context( TT_Driver driver );
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
FT_LOCAL( FT_Error ) FT_LOCAL( FT_Error )
TT_Done_Context( TT_ExecContext exec ); TT_Done_Context( TT_ExecContext exec );
@ -362,6 +366,7 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error ) FT_LOCAL( FT_Error )
TT_Run_Context( TT_ExecContext exec, TT_Run_Context( TT_ExecContext exec,
FT_Bool debug ); FT_Bool debug );
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
/*************************************************************************/ /*************************************************************************/