diff options
author | Alexei Podtelezhnikov <apodtele@gmail.com> | 2021-12-10 22:29:21 -0500 |
---|---|---|
committer | Alexei Podtelezhnikov <apodtele@gmail.com> | 2021-12-10 22:29:21 -0500 |
commit | eaa10b993bb5badf5fd524016a520a3539f1678c (patch) | |
tree | 980419aa2f808d85788ad13c6c54115dddca810a | |
parent | fa3537013547e90a3b1c0bb5947cd4b9defa4a10 (diff) | |
download | freetype2-eaa10b993bb5badf5fd524016a520a3539f1678c.tar.gz |
[truetype] Honor FT_LOAD_ADVANCE_ONLY if `hdmx` is usable.
This simply shortcuts the glyph loading if FT_LOAD_ADVANCE_ONLY
is specified and the `hdmx` data are located.
* src/truetype/ttgload.c (TT_Load_Glyph): Insert the shortcut.
-rw-r--r-- | src/truetype/ttgload.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 637188348..dd0d7e07d 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -2945,6 +2945,15 @@ if ( error ) goto Exit; + /* done if we are only interested in the `hdmx` advance */ + if ( load_flags & FT_LOAD_ADVANCE_ONLY && + !( load_flags & FT_LOAD_VERTICAL_LAYOUT ) && + loader.widthp ) + { + glyph->metrics.horiAdvance = loader.widthp[glyph_index] * 64; + goto Done; + } + glyph->format = FT_GLYPH_FORMAT_OUTLINE; glyph->num_subglyphs = 0; glyph->outline.flags = 0; @@ -3023,6 +3032,7 @@ glyph->outline.n_points, glyph->outline.flags )); + Done: tt_loader_done( &loader ); Exit: |