Commit 97ba5109bd73eb6bdb24ef768710ce4109673e17

Infinality 2013-01-26T17:05:40

[truetype] Fix rasterizer_version logic in sph.

diff --git a/ChangeLog b/ChangeLog
index fab11e8..b26aaae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2013-01-26  Infinality  <infinality@infinality.net>
 
+	[truetype] Fix rasterizer_version logic in sph.
+
+	* src/truetype/ttsubpix.c: Updated.
+	(ALWAYS_SKIP_DELTAP_Rules): Remove rule for Trebuchet MS.
+	(sph_set_tweaks): Fix rasterizer_version logic.
+
+2013-01-26  Infinality  <infinality@infinality.net>
+
 	[truetype] Align more to ClearType whitepaper for sph.
 
 	* include/freetype/internal/tttypes.h (TT_FaceRec): Add flags
diff --git a/src/truetype/ttsubpix.c b/src/truetype/ttsubpix.c
index 29eda92..6d88ef0 100644
--- a/src/truetype/ttsubpix.c
+++ b/src/truetype/ttsubpix.c
@@ -481,14 +481,12 @@
 
 
   /* Skip DELTAP instructions if matched.                                  */
-#define ALWAYS_SKIP_DELTAP_RULES_SIZE  16
+#define ALWAYS_SKIP_DELTAP_RULES_SIZE  15
 
   const SPH_TweakRule  ALWAYS_SKIP_DELTAP_Rules
                        [ALWAYS_SKIP_DELTAP_RULES_SIZE] =
   {
     { "Georgia", 0, "Regular", 'k' },
-    /* fixes problems with W M w */
-    { "Trebuchet MS", 0, "Italic", 0 },
     /* fix various problems with e in different versions */
     { "Trebuchet MS", 14, "Regular", 'e' },
     { "Trebuchet MS", 13, "Regular", 'e' },
@@ -1027,21 +1025,27 @@
     TWEAK_RULES( ROUND_NONPIXEL_Y_MOVES );
     TWEAK_RULES_EXCEPTIONS( ROUND_NONPIXEL_Y_MOVES );
 
-    if ( loader->exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 &&
-         loader->exec->rasterizer_version != 35                  )
+    if ( loader->exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 )
     {
-      loader->exec->rasterizer_version = 35;
-      loader->exec->size->cvt_ready = FALSE;
-      tt_size_ready_bytecode( loader->exec->size,
-                          FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) );
+      if ( loader->exec->rasterizer_version != 35 )
+      {
+        loader->exec->rasterizer_version = 35;
+        loader->exec->size->cvt_ready = FALSE;
+        tt_size_ready_bytecode( loader->exec->size,
+                            FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) );
+      }
+      else loader->exec->rasterizer_version = 35;
     }
-    else if ( loader->exec->rasterizer_version  !=
-              SPH_OPTION_SET_RASTERIZER_VERSION )
+    else
     {
-      loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
-      loader->exec->size->cvt_ready = FALSE;
-      tt_size_ready_bytecode( loader->exec->size,
-                          FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) );
+      if ( loader->exec->rasterizer_version != SPH_OPTION_SET_RASTERIZER_VERSION )
+      {
+        loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
+        loader->exec->size->cvt_ready = FALSE;
+        tt_size_ready_bytecode( loader->exec->size,
+                            FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) );
+      }
+      else loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
     }
 
     if ( IS_HINTED( loader->load_flags ) )