[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.
This commit is contained in:
Alexei Podtelezhnikov 2021-12-10 22:05:51 -05:00
parent 34fc55de47
commit 2e3455b135
1 changed files with 8 additions and 3 deletions

View File

@ -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 */