Commit 7d449436e61ea52b248c978b34eb33b1ea6c959a

Werner Lemberg 2013-11-02T11:36:37

[truetype] Fix GETINFO opcode handling of subpixel hinting bits. * src/truetype/ttinterp.c (Ins_GETINFO): Don't request bit 6 set to get info on subpixel hinting. * docs/CHANGES: Updated.

diff --git a/ChangeLog b/ChangeLog
index dc327ec..927397c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2013-11-02  Werner Lemberg  <wl@gnu.org>
 
+	[truetype] Fix GETINFO opcode handling of subpixel hinting bits.
+
+	* src/truetype/ttinterp.c (Ins_GETINFO): Don't request bit 6 set to
+	get info on subpixel hinting.
+
+	* docs/CHANGES: Updated.
+
+2013-11-02  Werner Lemberg  <wl@gnu.org>
+
 	Fix Savannah bug #40451.
 
 	Simply apply the patch from the bug report.
diff --git a/docs/CHANGES b/docs/CHANGES
index 51ac320..ddd24e0 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -71,6 +71,11 @@ CHANGES BETWEEN 2.5 and 2.5.1
 
     - Manual pages for most demo programs have been added.
 
+    - The GETINFO bytecode instruction for TrueType fonts was buggy if
+      used to retrieve subpixel hinting information.  It was necessary
+      to set  selector bit 6  to get  results for selector  bits 7-10,
+      which is wrong.
+
 
 ======================================================================
 
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index 56bc7f8..92e6d43 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -7828,18 +7828,15 @@
       if ( ( args[0] & 32 ) != 0 && CUR.grayscale_hinting )
         K |= 1 << 12;
 
-      /********************************/
-      /* HINTING FOR SUBPIXEL         */
-      /* Selector Bit:  6             */
-      /* Return Bit(s): 13            */
-      /*                              */
-      if ( ( args[0] & 64 ) != 0        &&
-           CUR.subpixel_hinting         &&
-           CUR.rasterizer_version >= 37 )
+      if ( CUR.rasterizer_version >= 37 )
       {
-        K |= 1 << 13;
-
-        /* the stuff below is irrelevant if subpixel_hinting is not set */
+        /********************************/
+        /* HINTING FOR SUBPIXEL         */
+        /* Selector Bit:  6             */
+        /* Return Bit(s): 13            */
+        /*                              */
+        if ( ( args[0] & 64 ) != 0 && CUR.subpixel_hinting )
+          K |= 1 << 13;
 
         /********************************/
         /* COMPATIBLE WIDTHS ENABLED    */