* src/cff/cffgload.c (cff_slot_load): Scale `vertBearingY`.

Towards the end of the the function there is a call to
`FT_Outline_Get_CBox` that retrieves the glyph bbox in scaled units.
That sets `horiBearing{X,Y}` and `vertBearingX` but `vertBearingY`
is left alone, and is not scaled.

Patch from Eric Muller <emuller@amazon.com>.
This commit is contained in:
Werner Lemberg 2020-09-24 09:35:24 +02:00
parent bed960d948
commit 4f13a43ab3
2 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,14 @@
2020-09-24 Werner Lemberg <wl@gnu.org>
* src/cff/cffgload.c (cff_slot_load): Scale `vertBearingY`.
Towards the end of the the function there is a call to
`FT_Outline_Get_CBox` that retrieves the glyph bbox in scaled units.
That sets `horiBearing{X,Y}` and `vertBearingX` but `vertBearingY`
is left alone, and is not scaled.
Patch from Eric Muller <emuller@amazon.com>.
2020-09-24 Werner Lemberg <wl@gnu.org>
* src/base/ftobjs.c (FT_Load_Glyph): Trace glyph metrics.

View File

@ -206,8 +206,8 @@
PSAux_Service psaux = (PSAux_Service)face->psaux;
const CFF_Decoder_Funcs decoder_funcs = psaux->cff_decoder_funcs;
FT_Matrix font_matrix;
FT_Vector font_offset;
FT_Matrix font_matrix;
FT_Vector font_offset;
force_scaling = FALSE;
@ -363,7 +363,6 @@
top_upm = (FT_Long)cff->top_font.font_dict.units_per_em;
sub_upm = (FT_Long)cff->subfonts[fd_index]->font_dict.units_per_em;
font_matrix = cff->subfonts[fd_index]->font_dict.font_matrix;
font_offset = cff->subfonts[fd_index]->font_dict.font_offset;
@ -398,7 +397,6 @@
PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( face );
#endif
FT_Byte* charstring;
FT_ULong charstring_len;
@ -664,8 +662,12 @@
metrics->horiBearingY = cbox.yMax;
if ( has_vertical_info )
{
metrics->vertBearingX = metrics->horiBearingX -
metrics->horiAdvance / 2;
metrics->vertBearingY = FT_MulFix( metrics->vertBearingY,
glyph->y_scale );
}
else
{
if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )