From 8718dae818b22c3933c33bdfc8a7413ef4c3110a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 18 Dec 2015 19:53:40 +0000 Subject: [PATCH] [python] Hook up sample debugger --- src/sample.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sample.py b/src/sample.py index f8d221699..19a4fdcbc 100755 --- a/src/sample.py +++ b/src/sample.py @@ -33,6 +33,12 @@ hb.font_set_scale (font, upem, upem) hb.ot_font_set_funcs (font) buf = hb.buffer_create () +class Debugger(object): + def message (self, buf, font, msg, data, _x_what_is_this): + print(msg) + return True +debugger = Debugger() +hb.buffer_set_message_func (buf, debugger.message, 1, 0) hb.buffer_add_utf8 (buf, text.encode('utf-8'), 0, -1) hb.buffer_guess_segment_properties (buf)