shithub: freetype+ttf2subf

Download patch

ref: 2e3dec55093d7853bf741e24a3d5d4c6c4d68ced
parent: c633378a5e76064de06ffafc847adebcf49837fb
author: Werner Lemberg <[email protected]>
date: Wed Aug 8 09:51:18 EDT 2018

Debugging improvements.

* src/base/ftobjs.c (pixel_modes): Move this array to top level
from ...
(FT_Load_Glyph): ... here.
(FT_Render_Glyph_Internal): Use `width' x `height' in trace message.
Use `pixel_modes'.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2018-08-08  Werner Lemberg  <[email protected]>
+
+	Debugging improvements.
+
+	* src/base/ftobjs.c (pixel_modes): Move this array to top level
+	from ...
+	(FT_Load_Glyph): ... here.
+	(FT_Render_Glyph_Internal): Use `width' x `height' in trace message.
+	Use `pixel_modes'.
+
 2018-08-08  Alexei Podtelezhnikov  <[email protected]>
 
 	[pcf] Massive unsigning (part 2).
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -79,6 +79,18 @@
 #pragma warning( pop )
 #endif
 
+  static const char* const  pixel_modes[] =
+  {
+    "none",
+    "monochrome bitmap",
+    "gray 8-bit bitmap",
+    "gray 2-bit bitmap",
+    "gray 4-bit bitmap",
+    "LCD 8-bit bitmap",
+    "vertical LCD 8-bit bitmap",
+    "BGRA 32-bit color image bitmap"
+  };
+
 #endif /* FT_DEBUG_LEVEL_TRACE */
 
 
@@ -1012,34 +1024,19 @@
     }
 
 #ifdef FT_DEBUG_LEVEL_TRACE
-    {
-      static const char* const  pixel_modes[] =
-      {
-        "none",
-        "monochrome bitmap",
-        "gray 8-bit bitmap",
-        "gray 2-bit bitmap",
-        "gray 4-bit bitmap",
-        "LCD 8-bit bitmap",
-        "vertical LCD 8-bit bitmap",
-        "BGRA 32-bit color image bitmap"
-      };
-
-
-      FT_TRACE5(( "FT_Load_Glyph: index %d, flags 0x%x\n",
-                  glyph_index, load_flags ));
-      FT_TRACE5(( "  x advance: %f\n", slot->advance.x / 64.0 ));
-      FT_TRACE5(( "  y advance: %f\n", slot->advance.y / 64.0 ));
-      FT_TRACE5(( "  linear x advance: %f\n",
-                  slot->linearHoriAdvance / 65536.0 ));
-      FT_TRACE5(( "  linear y advance: %f\n",
-                  slot->linearVertAdvance / 65536.0 ));
-      FT_TRACE5(( "  bitmap %dx%d, %s (mode %d)\n",
-                  slot->bitmap.width,
-                  slot->bitmap.rows,
-                  pixel_modes[slot->bitmap.pixel_mode],
-                  slot->bitmap.pixel_mode ));
-    }
+    FT_TRACE5(( "FT_Load_Glyph: index %d, flags 0x%x\n",
+                glyph_index, load_flags ));
+    FT_TRACE5(( "  x advance: %f\n", slot->advance.x / 64.0 ));
+    FT_TRACE5(( "  y advance: %f\n", slot->advance.y / 64.0 ));
+    FT_TRACE5(( "  linear x advance: %f\n",
+                slot->linearHoriAdvance / 65536.0 ));
+    FT_TRACE5(( "  linear y advance: %f\n",
+                slot->linearVertAdvance / 65536.0 ));
+    FT_TRACE5(( "  bitmap %dx%d, %s (mode %d)\n",
+                slot->bitmap.width,
+                slot->bitmap.rows,
+                pixel_modes[slot->bitmap.pixel_mode],
+                slot->bitmap.pixel_mode ));
 #endif
 
   Exit:
@@ -4653,8 +4650,11 @@
         int            pitch = bitmap.pitch;
 
 
-        FT_TRACE3(( "FT_Render_Glyph: bitmap %dx%d, mode %d\n",
-                    rows, pitch, slot->bitmap.pixel_mode ));
+        FT_TRACE3(( "FT_Render_Glyph: bitmap %dx%d, %s (mode %d)\n",
+                    pitch,
+                    rows,
+                    pixel_modes[slot->bitmap.pixel_mode],
+                    slot->bitmap.pixel_mode ));
 
         for ( i = 0; i < rows; i++ )
           for ( j = 0; j < pitch; j++ )