[buffer] Add debugging, aka, message, API
Currently just announces lookup applications. Message-API *will* change.
hb-shape / hb-view are updated to print-out messages to stder if --debug
is specified.
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index 6bb4059..3049fa1 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -1014,23 +1014,15 @@
const stage_map_t *stage = &stages[table_index][stage_index];
for (; i < stage->last_lookup; i++)
{
-#if 0
- char buf[4096];
- hb_buffer_serialize_glyphs (buffer, 0, buffer->len,
- buf, sizeof (buf), NULL,
- font,
- HB_BUFFER_SERIALIZE_FORMAT_TEXT,
- HB_BUFFER_SERIALIZE_FLAG_DEFAULT);
- printf ("buf: [%s]\n", buf);
-#endif
-
unsigned int lookup_index = lookups[table_index][i].index;
+ if (!buffer->message (font, "start lookup %d", lookup_index)) continue;
c.set_lookup_index (lookup_index);
c.set_lookup_mask (lookups[table_index][i].mask);
c.set_auto_zwj (lookups[table_index][i].auto_zwj);
apply_string<Proxy> (&c,
proxy.table.get_lookup (lookup_index),
proxy.accels[lookup_index]);
+ (void) buffer->message (font, "end lookup %d", lookup_index);
}
if (stage->pause_func)