diff options
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.c')
-rw-r--r-- | Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.c | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.c b/Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.c index be3922bfa07..731095ed0cb 100644 --- a/Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.c +++ b/Build/source/libs/freetype2/freetype-src/src/truetype/ttinterp.c @@ -4,7 +4,7 @@ * * TrueType bytecode interpreter (body). * - * Copyright (C) 1996-2022 by + * Copyright (C) 1996-2021 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -516,14 +516,6 @@ exec->GS.round_state = 1; exec->GS.loop = 1; -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - exec->iup_called = FALSE; -#endif -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL - exec->iupx_called = FALSE; - exec->iupy_called = FALSE; -#endif - /* some glyphs leave something on the stack. so we clean it */ /* before a new execution. */ exec->top = 0; @@ -5268,21 +5260,16 @@ } } - /* 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; - } + exc->GS.instruct_control &= ~(FT_Byte)Kf; + exc->GS.instruct_control |= (FT_Byte)L; - /* except to change the subpixel flags temporarily */ - else if ( exc->iniRange == tt_coderange_glyph && K == 3 ) + if ( K == 3 ) { #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY /* INSTCTRL modifying flag 3 also has an effect */ /* outside of the CVT program */ if ( SUBPIXEL_HINTING_INFINALITY ) - exc->ignore_x_mode = !FT_BOOL( L == 4 ); + exc->ignore_x_mode = FT_BOOL( L == 4 ); #endif #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL @@ -5293,8 +5280,6 @@ exc->backward_compatibility = !FT_BOOL( L == 4 ); #endif } - else if ( exc->pedantic_hinting ) - exc->error = FT_THROW( Invalid_Reference ); } @@ -7770,6 +7755,35 @@ #endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY + exc->iup_called = FALSE; +#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ + +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL + /* + * Toggle backward compatibility according to what font wants, except + * when + * + * 1) we have a `tricky' font that heavily relies on the interpreter to + * render glyphs correctly, for example DFKai-SB, or + * 2) FT_RENDER_MODE_MONO (i.e, monochome rendering) is requested. + * + * In those cases, backward compatibility needs to be turned off to get + * correct rendering. The rendering is then completely up to the + * font's programming. + * + */ + if ( SUBPIXEL_HINTING_MINIMAL && + exc->subpixel_hinting_lean && + !FT_IS_TRICKY( &exc->face->root ) ) + exc->backward_compatibility = !( exc->GS.instruct_control & 4 ); + else + exc->backward_compatibility = FALSE; + + exc->iupx_called = FALSE; + exc->iupy_called = FALSE; +#endif + /* We restrict the number of twilight points to a reasonable, */ /* heuristic value to avoid slow execution of malformed bytecode. */ num_twilight_points = FT_MAX( 30, |