From 7f44c2db247bdbaea4b369f214fde9614737196e Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Thu, 3 Aug 2017 06:15:30 +0200 Subject: [PATCH] [truetype] Do not set any ClearType flags in v40 monochrome mode. This fixes weird behavior of instructions that resulted in rendering differences between v35 and v40 in monochrome mode, e.g., in `timesbi.ttf'. * src/truetype/ttinterp.c (Ins_GETINFO) [TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL]: Check `subpixel_hinting_lean'. --- ChangeLog | 12 ++++++++++++ src/truetype/ttinterp.c | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3843d48a2..eac89db8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2017-08-03 Nikolaus Waxweiler + + [truetype] Do not set any ClearType flags in v40 monochrome mode. + + This fixes weird behavior of instructions that resulted in rendering + differences between v35 and v40 in monochrome mode, e.g., in + `timesbi.ttf'. + + * src/truetype/ttinterp.c (Ins_GETINFO) + [TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL]: Check + `subpixel_hinting_lean'. + 2017-08-01 Werner Lemberg * src/truetype/ttgxvar.c (TT_Get_MM_Var): Fix thinko. diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c index f8bf4af71..8636d5e3f 100644 --- a/src/truetype/ttinterp.c +++ b/src/truetype/ttinterp.c @@ -7357,7 +7357,11 @@ K |= 1 << 12; #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - if ( SUBPIXEL_HINTING_MINIMAL ) + /* Toggle the following flags only outside of monochrome mode. */ + /* Otherwise, instructions may behave weirdly and rendering results */ + /* may differ between v35 and v40 mode, e.g., in `Times New Roman */ + /* Bold Italic'. */ + if ( SUBPIXEL_HINTING_MINIMAL && exc->subpixel_hinting_lean ) { /********************************/ /* HINTING FOR SUBPIXEL */