diff --git a/ChangeLog b/ChangeLog index 5a756bd7a..55c06fb14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2014-10-20 Werner Lemberg + + [sbit] Minor fixes. + + * src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]: + Accept overlay format also, but emit warning message in that case. + (tt_sbit_decoder_load_metrics): Add missing newline to error + message. + (tt_sbit_load_sbix_image): Add `rgbl' graphic type (as used on iOS + 7.1) to the list of unsupported formats. + 2014-10-19 Alexei Podtelezhnikov [truetype] Clean up bytecode rounding. diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 44aa4671b..cfea9cd0b 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -1016,7 +1016,6 @@ if ( is_apple_sbix ) has_outline = FALSE; - /* if this font doesn't contain outlines, we try to load */ /* a `bhed' table */ if ( !has_outline && sfnt->load_bhed ) diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c index 7450b4b8c..da6b01ba4 100644 --- a/src/sfnt/ttsbit.c +++ b/src/sfnt/ttsbit.c @@ -150,12 +150,25 @@ error = FT_THROW( Unknown_File_Format ); goto Exit; } - if ( flags != 0x0001 || num_strikes >= 0x10000UL ) + + /* Bit 0 must always be `1'. */ + /* Bit 1 controls the overlay of bitmaps with outlines. */ + /* All other bits should be zero. */ + if ( !( flags == 1 || flags == 3 ) || + num_strikes >= 0x10000UL ) { error = FT_THROW( Invalid_File_Format ); goto Exit; } + /* we currently don't support bit 1; however, it is better to */ + /* draw at least something... */ + if ( flags == 3 ) + FT_TRACE1(( "tt_face_load_sbit_strikes:" + " sbix overlay not supported yet\n" + " " + " expect bad rendering results\n" )); + /* * Count the number of strikes available in the table. We are a bit * paranoid there and don't trust the data. @@ -518,7 +531,7 @@ return FT_Err_Ok; Fail: - FT_TRACE1(( "tt_sbit_decoder_load_metrics: broken table" )); + FT_TRACE1(( "tt_sbit_decoder_load_metrics: broken table\n" )); return FT_THROW( Invalid_Argument ); } @@ -1342,6 +1355,7 @@ case FT_MAKE_TAG( 'j', 'p', 'g', ' ' ): case FT_MAKE_TAG( 't', 'i', 'f', 'f' ): + case FT_MAKE_TAG( 'r', 'g', 'b', 'l' ): /* used on iOS 7.1 */ error = FT_THROW( Unknown_File_Format ); break;