shithub: freetype+ttf2subf

Download patch

ref: 7d449436e61ea52b248c978b34eb33b1ea6c959a
parent: 35b081898694db8f7865d561ff8cc598a4fe9965
author: Werner Lemberg <[email protected]>
date: Sat Nov 2 07:36:37 EDT 2013

[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.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2013-11-02  Werner Lemberg  <[email protected]>
 
+	[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  <[email protected]>
+
 	Fix Savannah bug #40451.
 
 	Simply apply the patch from the bug report.
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -71,6 +71,11 @@
 
     - 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.
+
 
 ======================================================================
 
--- 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    */