Commit e1899bcf6f0edf57c38e24c86f3a4cd09403749b

Werner Lemberg 2012-03-10T09:28:24

[truetype] Fix SSW instruction. * src/truetype/ttinterp.c (DO_SSW): SSW *does* use font units. For verification, it took some time to find a font which actually uses this instruction.

diff --git a/ChangeLog b/ChangeLog
index e8060cb..a34f8e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,16 @@
+2012-03-10  Werner Lemberg  <wl@gnu.org>
+
+	[truetype] Fix SSW instruction.
+
+	* src/truetype/ttinterp.c (DO_SSW): SSW *does* use font units.  For
+	verification, it took some time to find a font which actually uses
+	this instruction.
+
 2012-03-09  Vinnie Falco  <vinnie.falco@gmail.com>
 
 	Prepare source code for amalgamation.
 
-	* include\freetype\freetype.h: Swap order of preprocessor blocks.
+	* include/freetype/freetype.h: Swap order of preprocessor blocks.
 
 2012-03-08  Werner Lemberg  <wl@gnu.org>
 
@@ -46,14 +54,14 @@
 
 	Prepare source code for amalgamation.
 
-	* src\autofit\aferrors.h, src\bdf\bdferror.h, src\bzip2\ftbzip2.c,
-	src\cache\ftcerror.h, src\cff\cfferrs.h, src\cid\ciderrs.h,
-	src\gxvalid\gxverror.h, src\gzip\ftgzip.c, src\lzw\ftlzw.c,
-	src\otvalid\otverror.h, src\pcf\pcferror.h, src\pfr\pfrerror.h,
-	src\psaux\psauxerr.h, src\pshinter\pshnterr.h,
-	src\psnames\psnamerr.h, src\raster\rasterrs.h, src\sfnt\sferrors.h,
-	src\smooth\ftsmerrs.h, src\truetype\tterrors.h,
-	src\type1\t1errors.h, src\type42\t42error.h, src\winfonts\fnterrs.h:
+	* src/autofit/aferrors.h, src/bdf/bdferror.h, src/bzip2/ftbzip2.c,
+	src/cache/ftcerror.h, src/cff/cfferrs.h, src/cid/ciderrs.h,
+	src/gxvalid/gxverror.h, src/gzip/ftgzip.c, src/lzw/ftlzw.c,
+	src/otvalid/otverror.h, src/pcf/pcferror.h, src/pfr/pfrerror.h,
+	src/psaux/psauxerr.h, src/pshinter/pshnterr.h,
+	src/psnames/psnamerr.h, src/raster/rasterrs.h, src/sfnt/sferrors.h,
+	src/smooth/ftsmerrs.h, src/truetype/tterrors.h,
+	src/type1/t1errors.h, src/type42/t42error.h, src/winfonts/fnterrs.h:
 	Add #undef FT_ERR_PREFIX before #define FT_ERR_PREFIX.
 
 2012-03-03  Werner Lemberg  <wl@gnu.org>
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 3acb24a..80c38ad 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -3110,14 +3110,9 @@
     CUR.GS.single_width_cutin = (FT_F26Dot6)args[0];
 
 
-    /* XXX: UNDOCUMENTED! or bug in the Windows engine?   */
-    /*                                                    */
-    /*      It seems that the value that is read here is  */
-    /*      expressed in 16.16 format rather than in font */
-    /*      units.                                        */
-    /*                                                    */
-#define DO_SSW                                                 \
-    CUR.GS.single_width_value = (FT_F26Dot6)( args[0] >> 10 );
+#define DO_SSW                                                     \
+    CUR.GS.single_width_value = TT_MULFIX( args[0],                \
+                                           CUR.tt_metrics.scale );
 
 
 #define DO_FLIPON            \