shithub: freetype+ttf2subf

Download patch

ref: 50f693a78b0da3ee03cec04f48e8a0f0ea34a34d
parent: 994eb2b34934bc5face9f83b2d3b12cf7a9262ab
author: Werner Lemberg <[email protected]>
date: Sat Jan 27 04:33:17 EST 2018

[truetype] Beautify tracing of VF axis records.

* src/truetype/ttgxvar.c (TT_Get_MM_Var): Show axis records in a
table-like manner.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-01-27  Werner Lemberg  <[email protected]>
+
+	[truetype] Beautify tracing of VF axis records.
+
+	* src/truetype/ttgxvar.c (TT_Get_MM_Var): Show axis records in a
+	table-like manner.
+
 2018-01-26  Ben Wagner  <[email protected]>
 
 	[truetype] Fix multiple calls of `FT_Get_MM_Var' (#52955).
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -2043,7 +2043,9 @@
 
       FT_TRACE2(( "loaded\n" ));
 
-      FT_TRACE5(( "number of GX style axes: %d\n", fvar_head.axisCount ));
+      FT_TRACE5(( "%d variation ax%s\n",
+                  fvar_head.axisCount,
+                  fvar_head.axisCount == 1 ? "is" : "es" ));
 
       if ( FT_NEW( face->blend ) )
         goto Exit;
@@ -2143,7 +2145,11 @@
       {
         GX_FVar_Axis  axis_rec;
 
+#ifdef FT_DEBUG_LEVEL_TRACE
+        int  invalid = 0;
+#endif
 
+
         if ( FT_STREAM_READ_FIELDS( fvaraxis_fields, &axis_rec ) )
           goto Exit;
         a->tag     = axis_rec.axisTag;
@@ -2163,22 +2169,31 @@
         if ( a->minimum > a->def ||
              a->def > a->maximum )
         {
-          FT_TRACE2(( "TT_Get_MM_Var:"
-                      " invalid \"%s\" axis record; disabling\n",
-                      a->name ));
-
           a->minimum = a->def;
           a->maximum = a->def;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+          invalid = 1;
+#endif
         }
 
-        FT_TRACE5(( "  \"%s\":"
-                    " minimum=%.5f, default=%.5f, maximum=%.5f,"
-                    " flags=0x%04X\n",
+#ifdef FT_DEBUG_LEVEL_TRACE
+        if ( i == 0 )
+          FT_TRACE5(( "  idx   tag  "
+                   /* "  XXX  `XXXX'" */
+                      "    minimum     default     maximum   flags\n" ));
+                   /* "  XXXX.XXXXX  XXXX.XXXXX  XXXX.XXXXX  0xXXXX" */
+
+        FT_TRACE5(( "  %3d  `%s'"
+                    "  %10.5f  %10.5f  %10.5f  0x%04X%s\n",
+                    i,
                     a->name,
                     a->minimum / 65536.0,
                     a->def / 65536.0,
                     a->maximum / 65536.0,
-                    *axis_flags ));
+                    *axis_flags,
+                    invalid ? " (invalid, disabled)" : "" ));
+#endif
 
         a++;
         axis_flags++;