shithub: freetype+ttf2subf

Download patch

ref: 83c0ebabc2125215d8179fb777366fbce9777bb8
parent: ed6508c41a23831ae173accb5b124da0b6cc3f6d
author: Werner Lemberg <[email protected]>
date: Wed Jun 27 04:16:06 EDT 2012

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.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2012-06-27  Werner Lemberg  <[email protected]>
+
+	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  <[email protected]>
 
 	[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  <[email protected]>
--- a/include/freetype/internal/ftcalc.h
+++ b/include/freetype/internal/ftcalc.h
@@ -78,8 +78,6 @@
   /*************************************************************************/
 
 
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
@@ -107,8 +105,6 @@
   FT_MulDiv_No_Round( FT_Long  a,
                       FT_Long  b,
                       FT_Long  c );
-
-#endif /* TT_USE_BYTECODE_INTERPRETER */
 
 
   /*
--- 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 @@
   } 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 @@
   af_cjk_metrics_init_widths( AF_CJKMetrics  metrics,
                               FT_Face        face,
                               FT_ULong       charcode );
+#endif /* AF_CONFIG_OPTION_CJK */
 
 
 /* */
--- 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;
--- 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,9 +2415,10 @@
   /*    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,
                           FT_Long     selector )
@@ -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 */
--- a/src/truetype/ttinterp.h
+++ b/src/truetype/ttinterp.h
@@ -301,6 +301,7 @@
   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_Long    multiplier,
               void*      _pbuff,
               FT_ULong   new_max );
+#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
 
 
   /*************************************************************************/
@@ -347,6 +349,8 @@
   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_LOCAL( FT_Error )
   TT_Run_Context( TT_ExecContext  exec,
                   FT_Bool         debug );
+#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
 
 
   /*************************************************************************/