mirror of
https://gitlab.freedesktop.org/freetype/freetype.git
synced 2026-01-03 05:10:09 +01:00
* src/cff/cffgload.c (cff_slot_load): Fix autohinter scaling.
Fixes #1330.
This commit is contained in:
parent
ab0fe6d55e
commit
c1278179dc
1 changed files with 20 additions and 12 deletions
|
|
@ -408,12 +408,28 @@
|
|||
|
||||
#endif /* FT_CONFIG_OPTION_SVG */
|
||||
|
||||
/* top-level code ensures that FT_LOAD_NO_HINTING is set */
|
||||
/* if FT_LOAD_NO_SCALE is active */
|
||||
hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_HINTING ) == 0 );
|
||||
scaled = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 );
|
||||
|
||||
glyph->hint = hinting;
|
||||
glyph->scaled = scaled;
|
||||
|
||||
if ( scaled )
|
||||
{
|
||||
glyph->x_scale = size->root.metrics.x_scale;
|
||||
glyph->y_scale = size->root.metrics.y_scale;
|
||||
}
|
||||
else
|
||||
{
|
||||
glyph->x_scale = 0x10000L;
|
||||
glyph->y_scale = 0x10000L;
|
||||
}
|
||||
|
||||
/* if we have a CID subfont, use its matrix (which has already */
|
||||
/* been multiplied with the root matrix) */
|
||||
|
||||
glyph->x_scale = size->root.metrics.x_scale;
|
||||
glyph->y_scale = size->root.metrics.y_scale;
|
||||
|
||||
/* this scaling is only relevant if the PS hinter isn't active */
|
||||
if ( cff->num_subfonts )
|
||||
{
|
||||
|
|
@ -445,14 +461,6 @@
|
|||
font_offset = cff->top_font.font_dict.font_offset;
|
||||
}
|
||||
|
||||
/* top-level code ensures that FT_LOAD_NO_HINTING is set */
|
||||
/* if FT_LOAD_NO_SCALE is active */
|
||||
hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_HINTING ) == 0 );
|
||||
scaled = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 );
|
||||
|
||||
glyph->hint = hinting;
|
||||
glyph->scaled = scaled;
|
||||
|
||||
{
|
||||
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
|
||||
PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( face );
|
||||
|
|
@ -687,7 +695,7 @@
|
|||
metrics->vertAdvance += font_offset.y;
|
||||
}
|
||||
|
||||
if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 || force_scaling )
|
||||
if ( scaled || force_scaling )
|
||||
{
|
||||
/* scale the outline and the metrics */
|
||||
FT_Int n;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue