From c18c391b688a59a1c1e8366e216e473c1bd6361c Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 28 Nov 2017 12:43:45 +0100 Subject: [PATCH] [truetype] Improving tracing of composite glyphs. * src/truetype/ttgload.c (TT_Load_Composite_Glyph) [FT_DEBUG_LEVEL_TRACE]: Show composite glyph information. --- ChangeLog | 9 +++++++- src/truetype/ttgload.c | 47 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6bc3a5869..a1ebeb353 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,13 @@ +2017-11-28 Werner Lemberg + + [truetype] Improving tracing of composite glyphs. + + * src/truetype/ttgload.c (TT_Load_Composite_Glyph) + [FT_DEBUG_LEVEL_TRACE]: Show composite glyph information. + 2017-11-27 Werner Lemberg - Allow (again) encoding vectors with more than 256 elements (#52464). + [type1] Allow (again) `/Encoding' with >256 elements (#52464). In version 2.6.1, this has been disallowed to better reject malformed fonts; however, this restriction was too strong. This diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 94ba25673..dfdeb9eb6 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -664,7 +664,52 @@ } while ( subglyph->flags & MORE_COMPONENTS ); gloader->current.num_subglyphs = num_subglyphs; - FT_TRACE5(( " %d components\n", num_subglyphs )); + FT_TRACE5(( " %d component%s\n", + num_subglyphs, + num_subglyphs > 1 ? "s" : "" )); + +#ifdef FT_DEBUG_LEVEL_TRACE + { + FT_UInt i; + + + subglyph = gloader->current.subglyphs; + + for ( i = 0; i < num_subglyphs; i++ ) + { + if ( num_subglyphs > 1 ) + FT_TRACE7(( " subglyph %d:\n", i )); + + FT_TRACE7(( " glyph index: %d\n", subglyph->index )); + + if ( subglyph->flags & ARGS_ARE_XY_VALUES ) + FT_TRACE7(( " offset: x=%d, y=%d\n", + subglyph->arg1, + subglyph->arg2 )); + else + FT_TRACE7(( " matching points: base=%d, component=%d\n", + subglyph->arg1, + subglyph->arg2 )); + + if ( subglyph->flags & WE_HAVE_A_SCALE ) + FT_TRACE7(( " scaling: %f\n", + subglyph->transform.xx / 65536.0 )); + else if ( subglyph->flags & WE_HAVE_AN_XY_SCALE ) + FT_TRACE7(( " scaling: x=%f, y=%f\n", + subglyph->transform.xx / 65536.0, + subglyph->transform.yy / 65536.0 )); + else if ( subglyph->flags & WE_HAVE_A_2X2 ) + FT_TRACE7(( " scaling: xx=%f, yx=%f\n" + " xy=%f, yy=%f\n", + subglyph->transform.xx / 65536.0, + subglyph->transform.yx / 65536.0, + subglyph->transform.xy / 65536.0, + subglyph->transform.yy / 65536.0 )); + + subglyph++; + } + } +#endif /* FT_DEBUG_LEVEL_TRACE */ #ifdef TT_USE_BYTECODE_INTERPRETER