diff options
author | Werner Lemberg <wl@gnu.org> | 2020-09-24 09:35:24 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2020-09-24 09:35:24 +0200 |
commit | 4f13a43ab32ba77793d8528d4b4c057c6f76b835 (patch) | |
tree | c952ea2890b0aa357fc7963fd993ee3d6fc830ac | |
parent | bed960d9484df1a0c9547ba6855f457d6629ffb5 (diff) | |
download | freetype2-4f13a43ab32ba77793d8528d4b4c057c6f76b835.tar.gz |
* 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>.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | src/cff/cffgload.c | 10 |
2 files changed, 17 insertions, 4 deletions
@@ -1,5 +1,16 @@ 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. 2020-09-22 Werner Lemberg <wl@gnu.org> diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c index 5381489ed..feee38a41 100644 --- a/src/cff/cffgload.c +++ b/src/cff/cffgload.c @@ -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 ) |