[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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
diff --git a/ChangeLog b/ChangeLog
index 5a756bd..55c06fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2014-10-20 Werner Lemberg <wl@gnu.org>
+
+ [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 <apodtele@gmail.com>
[truetype] Clean up bytecode rounding.
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 44aa467..cfea9cd 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 7450b4b..da6b01b 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;