diff options
author | Alexei Podtelezhnikov <apodtele@gmail.com> | 2021-12-07 10:19:06 -0500 |
---|---|---|
committer | Alexei Podtelezhnikov <apodtele@gmail.com> | 2021-12-07 10:19:06 -0500 |
commit | 012b00f3e67d8d17d411ec1c777b8672e4dffad5 (patch) | |
tree | 14b108afac4f83f940e82769576e8a5379368eff /src/truetype/ttgload.c | |
parent | 1f951898751365e9bd2a920ce76652f2a59c3305 (diff) | |
download | freetype2-012b00f3e67d8d17d411ec1c777b8672e4dffad5.tar.gz |
[truetype] Reduce Infinality footprint again.
* src/truetype/ttgload.c (compute_glyph_metrics): Streamline and
prioritize the Infinality checks to use `hdmx`.
Diffstat (limited to 'src/truetype/ttgload.c')
-rw-r--r-- | src/truetype/ttgload.c | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 11968f6fd..ae2c0cb00 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -2262,14 +2262,20 @@ /* unless FT_LOAD_COMPUTE_METRICS is set or backward compatibility */ /* mode of the v40 interpreter is active. See `ttinterp.h' for */ /* details on backward compatibility mode. */ - if ( + if ( IS_HINTED( loader->load_flags ) && + !( loader->load_flags & FT_LOAD_COMPUTE_METRICS ) && #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL !( driver->interpreter_version == TT_INTERPRETER_VERSION_40 && ( loader->exec && loader->exec->backward_compatibility ) ) && #endif - !face->postscript.isFixedPitch && - IS_HINTED( loader->load_flags ) && - !( loader->load_flags & FT_LOAD_COMPUTE_METRICS ) ) +#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY + !( driver->interpreter_version == TT_INTERPRETER_VERSION_38 && + !SPH_OPTION_BITMAP_WIDTHS && + FT_LOAD_TARGET_MODE( loader->load_flags ) != + FT_RENDER_MODE_MONO && + ( loader->exec && !loader->exec->compatible_widths ) ) && +#endif + !face->postscript.isFixedPitch ) { FT_Byte* widthp; @@ -2278,30 +2284,8 @@ size->metrics->x_ppem, glyph_index ); -#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY - - if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 ) - { - FT_Bool ignore_x_mode; - - - ignore_x_mode = FT_BOOL( FT_LOAD_TARGET_MODE( loader->load_flags ) != - FT_RENDER_MODE_MONO ); - - if ( widthp && - ( ( ignore_x_mode && loader->exec->compatible_widths ) || - !ignore_x_mode || - SPH_OPTION_BITMAP_WIDTHS ) ) - glyph->metrics.horiAdvance = *widthp * 64; - } - else - -#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ - - { - if ( widthp ) - glyph->metrics.horiAdvance = *widthp * 64; - } + if ( widthp ) + glyph->metrics.horiAdvance = *widthp * 64; } /* set glyph dimensions */ |