summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2021-12-10 22:05:51 -0500
committerAlexei Podtelezhnikov <apodtele@gmail.com>2021-12-10 22:05:51 -0500
commit2e3455b135967b9e0e9d3cec52f0bb4a3da1f9e1 (patch)
treeb2ef3b304ade215832c472b874b3f22da844db1a
parent34fc55de47a5abe310f3c5a3f7d8cf9c5443e07f (diff)
downloadfreetype2-2e3455b135967b9e0e9d3cec52f0bb4a3da1f9e1.tar.gz
[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.
-rw-r--r--src/truetype/ttinterp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index ee8e1523f..cb17e25eb 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 used 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 */
+ else if ( exc->iniRange == tt_coderange_glyph && K == 3 )
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
/* INSTCTRL modifying flag 3 also has an effect */