[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'.
diff --git a/ChangeLog b/ChangeLog
index 3843d48..eac89db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2017-08-03  Nikolaus Waxweiler  <madigens@gmail.com>
+
+	[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  <wl@gnu.org>
 
 	* src/truetype/ttgxvar.c (TT_Get_MM_Var): Fix thinko.
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index f8bf4af..8636d5e 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         */