shithub: freetype+ttf2subf

Download patch

ref: 97ba5109bd73eb6bdb24ef768710ce4109673e17
parent: a5fe359596df306666b7f5abc13f1b605359d22c
author: Infinality <[email protected]>
date: Sat Jan 26 12:05:40 EST 2013

[truetype] Fix rasterizer_version logic in sph.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2013-01-26  Infinality  <[email protected]>
 
+	[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  <[email protected]>
+
 	[truetype] Align more to ClearType whitepaper for sph.
 
 	* include/freetype/internal/tttypes.h (TT_FaceRec): Add flags
--- 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 ) )