ref: a25ecfddbad6d6e5a534bf0374f4f522349fc158
parent: 99e60d840db667ec9f50e481572aa5df97d23836
author: Werner Lemberg <[email protected]>
date: Mon Jun 10 08:57:16 EDT 2013
[sfnt] Improve embedded bitmap tracing. * src/base/ftobjs.c (FT_Request_Size): Move trace message regarding bitmap strike match to... (FT_Match_Size): This function. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics, tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned, tt_sbit_decoder_load_compound, tt_sbit_decoder_load_png, tt_sbit_decoder_load_image): Decorate with tracing messages.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2013-06-10 Werner Lemberg <[email protected]>
+ [sfnt] Improve embedded bitmap tracing.
+
+ * src/base/ftobjs.c (FT_Request_Size): Move trace message regarding
+ bitmap strike match to...
+ (FT_Match_Size): This function.
+
+ * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics,
+ tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned,
+ tt_sbit_decoder_load_compound, tt_sbit_decoder_load_png,
+ tt_sbit_decoder_load_image): Decorate with tracing messages.
+
+2013-06-10 Werner Lemberg <[email protected]>
+
Fix Savannah bug #39160.
* src/truetype/ttinterp.c (Ins_SDPVTL): Set projection vector too
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -2541,6 +2541,8 @@
if ( w == FT_PIX_ROUND( bsize->x_ppem ) || ignore_width )
{
+ FT_TRACE3(( "FT_Match_Size: bitmap strike %d matches\n", i ));
+
if ( size_index )
*size_index = (FT_ULong)i;
@@ -2896,9 +2898,6 @@
error = FT_Match_Size( face, req, 0, &strike_index );
if ( error )
return error;
-
- FT_TRACE3(( "FT_Request_Size: bitmap strike %lu matched\n",
- strike_index ));
return FT_Select_Size( face, (FT_Int)strike_index );
}
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -374,6 +374,7 @@
return FT_Err_Ok;
Fail:
+ FT_TRACE1(( "tt_sbit_decoder_load_metrics: broken table" ));
return FT_THROW( Invalid_Argument );
}
@@ -425,6 +426,8 @@
if ( x_pos < 0 || x_pos + width > bit_width ||
y_pos < 0 || y_pos + height > bit_height )
{
+ FT_TRACE1(( "tt_sbit_decoder_load_byte_aligned:"
+ " invalid bitmap dimensions\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
@@ -431,6 +434,7 @@
if ( p + ( ( line_bits + 7 ) >> 3 ) * height > limit )
{
+ FT_TRACE1(( "tt_sbit_decoder_load_byte_aligned: broken bitmap\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
@@ -491,6 +495,8 @@
}
Exit:
+ if ( !error )
+ FT_TRACE3(( "tt_sbit_decoder_load_byte_aligned: loaded\n" ));
return error;
}
@@ -562,6 +568,8 @@
if ( x_pos < 0 || x_pos + width > bit_width ||
y_pos < 0 || y_pos + height > bit_height )
{
+ FT_TRACE1(( "tt_sbit_decoder_load_bit_aligned:"
+ " invalid bitmap dimensions\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
@@ -568,6 +576,7 @@
if ( p + ( ( line_bits * height + 7 ) >> 3 ) > limit )
{
+ FT_TRACE1(( "tt_sbit_decoder_load_bit_aligned: broken bitmap\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
@@ -647,6 +656,8 @@
}
Exit:
+ if ( !error )
+ FT_TRACE3(( "tt_sbit_decoder_load_bit_aligned: loaded\n" ));
return error;
}
@@ -675,8 +686,14 @@
num_components = FT_NEXT_USHORT( p );
if ( p + 4 * num_components > limit )
+ {
+ FT_TRACE1(( "tt_sbit_decoder_load_compound: broken table\n" ));
goto Fail;
+ }
+ FT_TRACE3(( "tt_sbit_decoder_load_compound: loading %d components\n",
+ num_components ));
+
for ( nn = 0; nn < num_components; nn++ )
{
FT_UInt gindex = FT_NEXT_USHORT( p );
@@ -691,6 +708,8 @@
break;
}
+ FT_TRACE3(( "tt_sbit_decoder_load_compound: done\n" ));
+
decoder->metrics->horiBearingX = horiBearingX;
decoder->metrics->horiBearingY = horiBearingY;
decoder->metrics->horiAdvance = horiAdvance;
@@ -727,6 +746,7 @@
if ( limit - p < 4 )
{
+ FT_TRACE1(( "tt_sbit_decoder_load_png: broken bitmap\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
@@ -734,6 +754,7 @@
png_len = FT_NEXT_ULONG( p );
if ( (FT_ULong)( limit - p ) < png_len )
{
+ FT_TRACE1(( "tt_sbit_decoder_load_png: broken bitmap\n" ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
}
@@ -748,6 +769,8 @@
png_len );
Exit:
+ if ( !error )
+ FT_TRACE3(( "tt_sbit_decoder_load_png: loaded\n" ));
return error;
}
@@ -1096,6 +1119,10 @@
image_end -= image_start;
image_start = image_offset + image_start;
+ FT_TRACE3(( "tt_sbit_decoder_load_image:"
+ " found sbit (format %d) for glyph index %d\n",
+ image_format, glyph_index ));
+
return tt_sbit_decoder_load_bitmap( decoder,
load_flags,
image_format,
@@ -1108,6 +1135,9 @@
return FT_THROW( Invalid_Table );
NoBitmap:
+ FT_TRACE4(( "tt_sbit_decoder_load_image:"
+ " no sbit found for glyph index %d\n", glyph_index ));
+
return FT_THROW( Invalid_Argument );
}