freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] hdmx-advances 7db5e6e 2/5: [truetype] Limit INSTCTRL appicat


From: Werner Lemberg
Subject: [freetype2] hdmx-advances 7db5e6e 2/5: [truetype] Limit INSTCTRL appication within specs.
Date: Fri, 10 Dec 2021 00:12:57 -0500 (EST)

branch: hdmx-advances
commit 7db5e6e7c5b23b4de7cac2834e37a8e815b8d5a8
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    [truetype] Limit INSTCTRL appication within specs.
    
    * src/truetype/ttinterp.c (Ins_INSTCTRL): Limit its global effects
    to the CVT program and local effects to the glyph program.
---
 src/truetype/ttinterp.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index ee8e152..3b3d658 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -5260,10 +5260,15 @@
       }
     }
 
-    exc->GS.instruct_control &= ~(FT_Byte)Kf;
-    exc->GS.instruct_control |= (FT_Byte)L;
+    /* INSTCTRL should only be use in the CVT program */
+    if ( exc->iniRange == tt_coderange_cvt )
+    {
+      exc->GS.instruct_control &= ~(FT_Byte)Kf;
+      exc->GS.instruct_control |= (FT_Byte)L;
+    }
 
-    if ( K == 3 )
+    /* except to change the subpixel flags temporarily */
+    if ( K == 3 && exc->iniRange == tt_coderange_glyph )
     {
 #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
       /* INSTCTRL modifying flag 3 also has an effect */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]