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.
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 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
diff --git a/ChangeLog b/ChangeLog
index a213a5d..b6d9cbb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
[truetype] Remove unused rounding functionality.
@@ -22,7 +39,7 @@
(Move_Zp2_Point, Ins_SHPIX, Ins_MSIRP, Ins_MDAP, Ins_MIAP,
Ins_MDRP, Ins_MIRP): Perform Round_None instead of calling a modified
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.
2012-06-25 Werner Lemberg <wl@gnu.org>
diff --git a/include/freetype/internal/ftcalc.h b/include/freetype/internal/ftcalc.h
index 0d8d478..a6a5e05 100644
--- a/include/freetype/internal/ftcalc.h
+++ b/include/freetype/internal/ftcalc.h
@@ -78,8 +78,6 @@ FT_BEGIN_HEADER
/*************************************************************************/
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
/*************************************************************************/
/* */
/* <Function> */
@@ -108,8 +106,6 @@ FT_BEGIN_HEADER
FT_Long b,
FT_Long c );
-#endif /* TT_USE_BYTECODE_INTERPRETER */
-
/*
* A variant of FT_Matrix_Multiply which scales its result afterwards.
diff --git a/src/autofit/afcjk.h b/src/autofit/afcjk.h
index 8416c0d..dc8f892 100644
--- a/src/autofit/afcjk.h
+++ b/src/autofit/afcjk.h
@@ -4,7 +4,7 @@
/* */
/* 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. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -103,6 +103,7 @@ FT_BEGIN_HEADER
} AF_CJKMetricsRec, *AF_CJKMetrics;
+#ifdef AF_CONFIG_OPTION_CJK
FT_LOCAL( FT_Error )
af_cjk_metrics_init( AF_CJKMetrics metrics,
FT_Face face );
@@ -129,6 +130,7 @@ FT_BEGIN_HEADER
af_cjk_metrics_init_widths( AF_CJKMetrics metrics,
FT_Face face,
FT_ULong charcode );
+#endif /* AF_CONFIG_OPTION_CJK */
/* */
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index a88a705..63d3773 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1899,7 +1899,9 @@
{
TT_Face face;
FT_Stream stream;
+#ifdef TT_USE_BYTECODE_INTERPRETER
FT_Bool pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
+#endif
face = (TT_Face)glyph->face;
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 46ffc51..a996d17 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -2204,7 +2204,7 @@
}
else
{
- val = - FT_PIX_CEIL( compensation - distance );
+ val = -FT_PIX_CEIL( compensation - distance );
if ( val > 0 )
val = 0;
}
@@ -2415,8 +2415,9 @@
/* Sets Super Round parameters. */
/* */
/* <Input> */
- /* GridPeriod :: Grid period */
- /* selector :: SROUND opcode */
+ /* GridPeriod :: The grid period. */
+ /* */
+ /* selector :: The SROUND opcode. */
/* */
static void
SetSuperRound( EXEC_OP_ FT_F26Dot6 GridPeriod,
@@ -6203,17 +6204,17 @@
Ins_MSIRP( INS_ARG )
{
FT_UShort point;
- FT_F26Dot6 distance,
- control_value_cutin;
+ FT_F26Dot6 distance;
+#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
+ FT_F26Dot6 control_value_cutin;
control_value_cutin = CUR.GS.control_value_cutin;
-#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( CUR.ignore_x_mode &&
CUR.GS.freeVector.x != 0 &&
!( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
- control_value_cutin = 0;
+ control_value_cutin = 0;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
point = (FT_UShort)args[0];
@@ -6266,8 +6267,8 @@
Ins_MDAP( INS_ARG )
{
FT_UShort point;
- FT_F26Dot6 cur_dist,
- distance;
+ FT_F26Dot6 cur_dist;
+ FT_F26Dot6 distance;
point = (FT_UShort)args[0];
@@ -6283,13 +6284,16 @@
{
cur_dist = CUR_fast_project( &CUR.zp0.cur[point] );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
- if ( CUR.ignore_x_mode && CUR.GS.freeVector.x != 0 )
- distance = ROUND_None( cur_dist,
- CUR.tt_metrics.compensations[0] ) - cur_dist;
+ if ( CUR.ignore_x_mode &&
+ CUR.GS.freeVector.x != 0 )
+ distance = ROUND_None(
+ cur_dist,
+ CUR.tt_metrics.compensations[0] ) - cur_dist;
else
#endif
- distance = CUR_Func_round( cur_dist,
- CUR.tt_metrics.compensations[0] ) - cur_dist;
+ distance = CUR_Func_round(
+ cur_dist,
+ CUR.tt_metrics.compensations[0] ) - cur_dist;
}
else
distance = 0;
@@ -6312,20 +6316,20 @@
{
FT_ULong cvtEntry;
FT_UShort point;
- FT_F26Dot6 distance,
- org_dist,
- control_value_cutin;
+ FT_F26Dot6 distance;
+ FT_F26Dot6 org_dist;
+ FT_F26Dot6 control_value_cutin;
control_value_cutin = CUR.GS.control_value_cutin;
- cvtEntry = (FT_ULong)args[1];
- point = (FT_UShort)args[0];
+ cvtEntry = (FT_ULong)args[1];
+ point = (FT_UShort)args[0];
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( CUR.ignore_x_mode &&
CUR.GS.freeVector.x != 0 &&
!( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
- control_value_cutin = 0;
+ control_value_cutin = 0;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
if ( BOUNDS( point, CUR.zp0.n_points ) ||
@@ -6379,18 +6383,20 @@
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 )
distance = org_dist;
#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,
CUR.tt_metrics.compensations[0] );
else
#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 );
@@ -6414,13 +6420,13 @@
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
if ( CUR.ignore_x_mode &&
CUR.GS.freeVector.x != 0 &&
!( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
- minimum_distance = 0;
+ minimum_distance = 0;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
@@ -6561,14 +6567,14 @@
minimum_distance = CUR.GS.minimum_distance;
control_value_cutin = CUR.GS.control_value_cutin;
- point = (FT_UShort)args[0];
- cvtEntry = (FT_ULong)( args[1] + 1 );
+ point = (FT_UShort)args[0];
+ cvtEntry = (FT_ULong)( args[1] + 1 );
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
if ( CUR.ignore_x_mode &&
CUR.GS.freeVector.x != 0 &&
!( 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 */
/* XXX: UNDOCUMENTED! cvt[-1] = 0 always */
diff --git a/src/truetype/ttinterp.h b/src/truetype/ttinterp.h
index 2fc476d..076d9a1 100644
--- a/src/truetype/ttinterp.h
+++ b/src/truetype/ttinterp.h
@@ -301,6 +301,7 @@ FT_BEGIN_HEADER
extern const TT_GraphicsState tt_default_graphics_state;
+#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
FT_LOCAL( FT_Error )
TT_Goto_CodeRange( TT_ExecContext exec,
FT_Int range,
@@ -323,6 +324,7 @@ FT_BEGIN_HEADER
FT_Long multiplier,
void* _pbuff,
FT_ULong new_max );
+#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
/*************************************************************************/
@@ -347,6 +349,8 @@ FT_BEGIN_HEADER
FT_EXPORT( TT_ExecContext )
TT_New_Context( TT_Driver driver );
+
+#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
FT_LOCAL( FT_Error )
TT_Done_Context( TT_ExecContext exec );
@@ -362,6 +366,7 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
TT_Run_Context( TT_ExecContext exec,
FT_Bool debug );
+#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
/*************************************************************************/