diff options
author | Werner Lemberg <wl@gnu.org> | 2016-11-06 12:37:55 +0100 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2016-11-06 12:37:55 +0100 |
commit | 1c6fd994376c182f07cd59558a2f9bdd082b9509 (patch) | |
tree | b2f69fe85f75f178ab36fe221961f0df62d9b37a /src/sfnt/ttsbit.c | |
parent | 565db95b5cc87f8875576afb4282f443a5a10a8e (diff) | |
download | freetype2-1c6fd994376c182f07cd59558a2f9bdd082b9509.tar.gz |
[sfnt] Improve FT_LOAD_BITMAP_METRICS_ONLY for `sbix' format.
It's unavoidable to call the PNG engine, but to get the metrics it
is sufficient to read the PNG image's header only.
* src/sfnt/pngshim.c (Load_SBit_Png): Add argument to control the
allocation of the glyph slot.
* src/sfnt/pngshim.h: Updated.
* src/sfnt/ttsbit.c (tt_sbit_decoder_load_png,
tt_face_load_sbix_image, tt_face_load_sbit_image): Updated.
Diffstat (limited to 'src/sfnt/ttsbit.c')
-rw-r--r-- | src/sfnt/ttsbit.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c index de59673e9..bc51304b6 100644 --- a/src/sfnt/ttsbit.c +++ b/src/sfnt/ttsbit.c @@ -1071,6 +1071,7 @@ decoder->stream->memory, p, png_len, + FALSE, FALSE ); Exit: @@ -1443,7 +1444,8 @@ FT_UInt glyph_index, FT_Stream stream, FT_Bitmap *map, - TT_SBit_MetricsRec *metrics ) + TT_SBit_MetricsRec *metrics, + FT_Bool metrics_only ) { FT_UInt strike_offset, glyph_start, glyph_end; FT_Int originOffsetX, originOffsetY; @@ -1522,7 +1524,8 @@ stream->memory, stream->cursor, glyph_end - glyph_start - 8, - TRUE ); + TRUE, + metrics_only ); #else error = FT_THROW( Unimplemented_Feature ); #endif @@ -1595,12 +1598,14 @@ break; case TT_SBIT_TABLE_TYPE_SBIX: - error = tt_face_load_sbix_image( face, - strike_index, - glyph_index, - stream, - map, - metrics ); + error = tt_face_load_sbix_image( + face, + strike_index, + glyph_index, + stream, + map, + metrics, + ( load_flags & FT_LOAD_BITMAP_METRICS_ONLY ) != 0 ); break; default: |