mirror of
https://gitlab.freedesktop.org/freetype/freetype.git
synced 2026-05-05 01:58:00 +02:00
[VARC] Set advance width from the loader
This commit is contained in:
parent
6ab5c9ee64
commit
7185bd81b3
1 changed files with 41 additions and 0 deletions
|
|
@ -2552,6 +2552,47 @@
|
|||
load_flags );
|
||||
if ( !error )
|
||||
{
|
||||
FT_Short left_bearing = 0;
|
||||
FT_Short top_bearing = 0;
|
||||
FT_UShort advance_width = 0;
|
||||
FT_UShort advance_height = 0;
|
||||
|
||||
|
||||
/* Get advance width from hmtx */
|
||||
TT_Get_HMetrics( face, glyph_index,
|
||||
&left_bearing,
|
||||
&advance_width );
|
||||
TT_Get_VMetrics( face, glyph_index,
|
||||
0,
|
||||
&top_bearing,
|
||||
&advance_height );
|
||||
|
||||
glyph->linearHoriAdvance = advance_width;
|
||||
glyph->linearVertAdvance = advance_height;
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
{
|
||||
FT_Int advance = (FT_Int)advance_width;
|
||||
|
||||
|
||||
tt_hadvance_adjust( (FT_Face)face, glyph_index, &advance );
|
||||
advance_width = (FT_UShort)advance;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( load_flags & FT_LOAD_NO_SCALE )
|
||||
{
|
||||
glyph->metrics.horiAdvance = (FT_Pos)advance_width * 64;
|
||||
glyph->metrics.vertAdvance = (FT_Pos)advance_height * 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
glyph->metrics.horiAdvance = FT_MulFix( advance_width,
|
||||
size->metrics->x_scale );
|
||||
glyph->metrics.vertAdvance = FT_MulFix( advance_height,
|
||||
size->metrics->y_scale );
|
||||
}
|
||||
|
||||
FT_TRACE3(( "Successfully loaded VARC glyph\n" ));
|
||||
goto Exit;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue