[autofit] Make debugging stuff work again. The interface to ftgrid was broken in the series of commits starting with [autofit] Allocate AF_Loader on the stack instead of AF_Module. from 2015-01-14. * src/autofit/afmodule.c (_af_debug_hints_rec) [FT_DEBUG_AUTOFIT]: Use a global AF_GlyphHintsRec object for debugging. (af_autofitter_done, af_autofitter_load_glyph): Updated. * src/autofit/afloader.c (af_loader_init, af_loader_done): Updated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
diff --git a/ChangeLog b/ChangeLog
index 97bf293..6693943 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
2015-04-01 Werner Lemberg <wl@gnu.org>
+ [autofit] Make debugging stuff work again.
+
+ The interface to ftgrid was broken in the series of commits starting
+ with
+
+ [autofit] Allocate AF_Loader on the stack instead of AF_Module.
+
+ from 2015-01-14.
+
+ * src/autofit/afmodule.c (_af_debug_hints_rec) [FT_DEBUG_AUTOFIT]:
+ Use a global AF_GlyphHintsRec object for debugging.
+ (af_autofitter_done, af_autofitter_load_glyph): Updated.
+
+ * src/autofit/afloader.c (af_loader_init, af_loader_done): Updated.
+
+2015-04-01 Werner Lemberg <wl@gnu.org>
+
* src/autofit/afhints.c (af_glyph_hints_done): Fix minor thinko.
2015-03-29 Werner Lemberg <wl@gnu.org>
diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c
index 5f68c8c..7c2fa7c 100644
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -33,9 +33,6 @@
FT_ZERO( loader );
loader->hints = hints;
-#ifdef FT_DEBUG_AUTOFIT
- _af_debug_hints = loader->hints;
-#endif
}
@@ -76,10 +73,6 @@
loader->face = NULL;
loader->globals = NULL;
loader->hints = NULL;
-
-#ifdef FT_DEBUG_AUTOFIT
- _af_debug_hints = NULL;
-#endif
}
diff --git a/src/autofit/afmodule.c b/src/autofit/afmodule.c
index 35ce6ad..4968e01 100644
--- a/src/autofit/afmodule.c
+++ b/src/autofit/afmodule.c
@@ -23,10 +23,14 @@
#include "afpic.h"
#ifdef FT_DEBUG_AUTOFIT
- int _af_debug_disable_horz_hints;
- int _af_debug_disable_vert_hints;
- int _af_debug_disable_blue_hints;
- void* _af_debug_hints;
+ int _af_debug_disable_horz_hints;
+ int _af_debug_disable_vert_hints;
+ int _af_debug_disable_blue_hints;
+
+ /* we use a global object instead of a local one for debugging */
+ AF_GlyphHintsRec _af_debug_hints_rec[1];
+
+ void* _af_debug_hints = _af_debug_hints_rec;
#endif
#include FT_INTERNAL_OBJECTS_H
@@ -261,6 +265,11 @@
af_autofitter_done( FT_Module ft_module ) /* AF_Module */
{
FT_UNUSED( ft_module );
+
+#ifdef FT_DEBUG_AUTOFIT
+ if ( _af_debug_hints_rec->memory )
+ af_glyph_hints_done( _af_debug_hints_rec );
+#endif
}
@@ -274,6 +283,31 @@
FT_Error error = FT_Err_Ok;
FT_Memory memory = module->root.library->memory;
+#ifdef FT_DEBUG_AUTOFIT
+
+ /* in debug mode, we use a global object that survives this routine */
+
+ AF_GlyphHints hints = _af_debug_hints_rec;
+ AF_LoaderRec loader[1];
+
+ FT_UNUSED( size );
+
+
+ if ( hints->memory )
+ af_glyph_hints_done( hints );
+
+ af_glyph_hints_init( hints, memory );
+ af_loader_init( loader, hints );
+
+ error = af_loader_load_glyph( loader, module, slot->face,
+ glyph_index, load_flags );
+
+ af_loader_done( loader );
+
+ return error;
+
+#else /* !FT_DEBUG_AUTOFIT */
+
AF_GlyphHintsRec hints[1];
AF_LoaderRec loader[1];
@@ -290,6 +324,8 @@
af_glyph_hints_done( hints );
return error;
+
+#endif /* !FT_DEBUG_AUTOFIT */
}