[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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
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 */