From 86fa2ebc1f2a73693b5da1076a0871439256db2b Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Fri, 19 Jun 2009 14:56:26 +0200 Subject: [PATCH] Improve debug messages for Type1 charstrings. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Emit newlines after instructions. Prettify output. --- ChangeLog | 8 ++++++++ src/psaux/t1decode.c | 28 ++++++++++++++++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b00dc3552..df83e9af5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-06-19 Werner Lemberg + + Improve debug messages for Type1 charstrings. + + * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Emit newlines + after instructions. + Prettify output. + 2009-06-19 Werner Lemberg More ftgray fixes for FT_STATIC_RASTER. diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c index 4ccf30f10..d396a6803 100644 --- a/src/psaux/t1decode.c +++ b/src/psaux/t1decode.c @@ -340,6 +340,10 @@ T1_Hints_Funcs hinter; +#ifdef FT_DEBUG_LEVEL_TRACE + FT_Bool bol = TRUE; +#endif + /* we don't want to touch the source code -- use macro trick */ #define start_point t1_builder_start_point @@ -394,7 +398,13 @@ FT_ASSERT( known_othersubr_result_cnt == 0 || unknown_othersubr_result_cnt == 0 ); - FT_TRACE5(( " (%d)", decoder->top - decoder->stack )); +#ifdef FT_DEBUG_LEVEL_TRACE + if ( bol ) + { + FT_TRACE5(( " (%d)", decoder->top - decoder->stack )); + bol = FALSE; + } +#endif /*********************************************************************/ /* */ @@ -592,7 +602,10 @@ FT_Int arg_cnt; - FT_TRACE4(( " callothersubr" )); +#ifdef FT_DEBUG_LEVEL_TRACE + FT_TRACE4(( " callothersubr\n" )); + bol = TRUE; +#endif if ( top - decoder->stack < 2 ) goto Stack_Underflow; @@ -974,7 +987,7 @@ switch ( op ) { case op_endchar: - FT_TRACE4(( " endchar" )); + FT_TRACE4(( " endchar\n" )); close_contour( builder ); @@ -994,8 +1007,6 @@ /* add current outline to the glyph slot */ FT_GlyphLoader_Add( builder->loader ); - FT_TRACE4(( "\n" )); - /* the compiler should optimize away this empty loop but ... */ #ifdef FT_DEBUG_LEVEL_TRACE @@ -1144,7 +1155,7 @@ break; case op_rrcurveto: - FT_TRACE4(( " rcurveto" )); + FT_TRACE4(( " rrcurveto" )); if ( start_point( builder, x, y ) || check_points( builder, 3 ) ) @@ -1399,6 +1410,11 @@ decoder->top = top; +#ifdef FT_DEBUG_LEVEL_TRACE + FT_TRACE4(( "\n" )); + bol = TRUE; +#endif + } /* general operator processing */ } /* while ip < limit */