[svg] Set linear advances when loading SVG glyphs

* include/freetype/freetype.h (FT_GlyphSlotRec_): update doc
* src/cff/cffgload.c (cff_slot_load): do it
* src/truetype/ttgload.c (TT_Load_Glyph): do it

Fixes: #1156
This commit is contained in:
Ben Wagner 2022-06-06 15:59:56 -04:00
parent c26872ed59
commit b11074cf6d
3 changed files with 8 additions and 2 deletions

View File

@ -1892,13 +1892,13 @@ FT_BEGIN_HEADER
* The advance width of the unhinted glyph. Its value is expressed in
* 16.16 fractional pixels, unless @FT_LOAD_LINEAR_DESIGN is set when
* loading the glyph. This field can be important to perform correct
* WYSIWYG layout. Only relevant for outline glyphs.
* WYSIWYG layout. Only relevant for scalable glyphs.
*
* linearVertAdvance ::
* The advance height of the unhinted glyph. Its value is expressed in
* 16.16 fractional pixels, unless @FT_LOAD_LINEAR_DESIGN is set when
* loading the glyph. This field can be important to perform correct
* WYSIWYG layout. Only relevant for outline glyphs.
* WYSIWYG layout. Only relevant for scalable glyphs.
*
* advance ::
* This shorthand is, depending on @FT_LOAD_IGNORE_TRANSFORM, the

View File

@ -404,6 +404,9 @@
&dummy,
&advanceY );
glyph->root.linearHoriAdvance = advanceX;
glyph->root.linearVertAdvance = advanceY;
advanceX =
(FT_UShort)FT_MulDiv( advanceX,
glyph->root.face->size->metrics.x_ppem,

View File

@ -3005,6 +3005,9 @@
&topBearing,
&advanceY );
glyph->linearHoriAdvance = advanceX;
glyph->linearVertAdvance = advanceY;
advanceX = (FT_UShort)FT_MulDiv( advanceX,
glyph->face->size->metrics.x_ppem,
glyph->face->units_per_EM );