diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-05-15 20:21:34 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-05-15 20:21:34 +0200 |
commit | 9c075dc4cdaeef79bc570ed2219bb757cb325c47 (patch) | |
tree | cda2be4b94e235a7c742b0598ee4b13478c1c7b8 /modules/freetype2/src/sfnt/ttsbit.c | |
parent | 7bd7473702918934b4f5751a583c3f459bb06c7b (diff) | |
download | UXP-9c075dc4cdaeef79bc570ed2219bb757cb325c47.tar UXP-9c075dc4cdaeef79bc570ed2219bb757cb325c47.tar.gz UXP-9c075dc4cdaeef79bc570ed2219bb757cb325c47.tar.lz UXP-9c075dc4cdaeef79bc570ed2219bb757cb325c47.tar.xz UXP-9c075dc4cdaeef79bc570ed2219bb757cb325c47.zip |
Update in-tree freetype2 lib (unused) to 2.9.1
Diffstat (limited to 'modules/freetype2/src/sfnt/ttsbit.c')
-rw-r--r-- | modules/freetype2/src/sfnt/ttsbit.c | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/modules/freetype2/src/sfnt/ttsbit.c b/modules/freetype2/src/sfnt/ttsbit.c index bf6ecca5a..33b8640bc 100644 --- a/modules/freetype2/src/sfnt/ttsbit.c +++ b/modules/freetype2/src/sfnt/ttsbit.c @@ -4,7 +4,7 @@ /* */ /* TrueType and OpenType embedded bitmap support (body). */ /* */ -/* Copyright 2005-2016 by */ +/* Copyright 2005-2018 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* Copyright 2013 by Google, Inc. */ @@ -24,6 +24,10 @@ #include FT_INTERNAL_STREAM_H #include FT_TRUETYPE_TAGS_H #include FT_BITMAP_H + + +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS + #include "ttsbit.h" #include "sferrors.h" @@ -444,6 +448,15 @@ metrics->max_advance = FT_MulDiv( hori->advance_Width_Max, ppem_ * 64, upem ); + /* set the scale values (in 16.16 units) so advances */ + /* from the hmtx and vmtx table are scaled correctly */ + metrics->x_scale = FT_MulDiv( metrics->x_ppem, + 64 * 0x10000, + face->header.Units_Per_EM ); + metrics->y_scale = FT_MulDiv( metrics->y_ppem, + 64 * 0x10000, + face->header.Units_Per_EM ); + return error; } @@ -994,8 +1007,9 @@ goto Fail; } - FT_TRACE3(( "tt_sbit_decoder_load_compound: loading %d components\n", - num_components )); + FT_TRACE3(( "tt_sbit_decoder_load_compound: loading %d component%s\n", + num_components, + num_components == 1 ? "" : "s" )); for ( nn = 0; nn < num_components; nn++ ) { @@ -1435,10 +1449,17 @@ return FT_THROW( Invalid_Table ); NoBitmap: + if ( recurse_count ) + { + FT_TRACE4(( "tt_sbit_decoder_load_image:" + " missing subglyph sbit with glyph index %d\n", + glyph_index )); + return FT_THROW( Invalid_Composite ); + } + FT_TRACE4(( "tt_sbit_decoder_load_image:" " no sbit found for glyph index %d\n", glyph_index )); - - return FT_THROW( Invalid_Argument ); + return FT_THROW( Missing_Bitmap ); } @@ -1460,6 +1481,9 @@ FT_Byte* p; FT_UNUSED( map ); +#ifndef FT_CONFIG_OPTION_USE_PNG + FT_UNUSED( metrics_only ); +#endif strike_index = face->sbit_strike_map[strike_index]; @@ -1490,7 +1514,7 @@ FT_FRAME_EXIT(); if ( glyph_start == glyph_end ) - return FT_THROW( Invalid_Argument ); + return FT_THROW( Missing_Bitmap ); if ( glyph_start > glyph_end || glyph_end - glyph_start < 8 || face->ebdt_size - strike_offset < glyph_end ) @@ -1647,5 +1671,12 @@ return error; } +#else /* !TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ + + /* ANSI C doesn't like empty source files */ + typedef int _tt_sbit_dummy; + +#endif /* !TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ + -/* EOF */ +/* END */ |