From 7d449436e61ea52b248c978b34eb33b1ea6c959a Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 2 Nov 2013 11:36:37 +0100 Subject: [PATCH] [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. --- ChangeLog | 9 +++++++++ docs/CHANGES | 5 +++++ src/truetype/ttinterp.c | 19 ++++++++----------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc327ec8c..927397ca6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2013-11-02 Werner Lemberg + + [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 Fix Savannah bug #40451. diff --git a/docs/CHANGES b/docs/CHANGES index 51ac320b7..ddd24e027 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 56bc7f8f7..92e6d43b6 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 */