freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master c18c391: [truetype] Improving tracing of composite gl


From: Werner LEMBERG
Subject: [freetype2] master c18c391: [truetype] Improving tracing of composite glyphs.
Date: Tue, 28 Nov 2017 06:44:00 -0500 (EST)

branch: master
commit c18c391b688a59a1c1e8366e216e473c1bd6361c
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [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 6bc3a58..a1ebeb3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
+2017-11-28  Werner Lemberg  <address@hidden>
+
+       [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  <address@hidden>
 
-       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 94ba256..dfdeb9e 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
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]