Merge pull request #280 from behdad/revert-271-patch-2
Revert "use utf32"
This commit is contained in:
commit
d8273aac19
|
@ -20,7 +20,6 @@ def tounicode(s, encoding='utf-8'):
|
||||||
|
|
||||||
fontdata = open (sys.argv[1], 'rb').read ()
|
fontdata = open (sys.argv[1], 'rb').read ()
|
||||||
text = tounicode(sys.argv[2])
|
text = tounicode(sys.argv[2])
|
||||||
codepoints = list(map(ord, text))
|
|
||||||
# Need to create GLib.Bytes explicitly until this bug is fixed:
|
# Need to create GLib.Bytes explicitly until this bug is fixed:
|
||||||
# https://bugzilla.gnome.org/show_bug.cgi?id=729541
|
# https://bugzilla.gnome.org/show_bug.cgi?id=729541
|
||||||
blob = hb.glib_blob_create (GLib.Bytes.new (fontdata))
|
blob = hb.glib_blob_create (GLib.Bytes.new (fontdata))
|
||||||
|
@ -40,7 +39,7 @@ class Debugger(object):
|
||||||
return True
|
return True
|
||||||
debugger = Debugger()
|
debugger = Debugger()
|
||||||
hb.buffer_set_message_func (buf, debugger.message, 1, 0)
|
hb.buffer_set_message_func (buf, debugger.message, 1, 0)
|
||||||
hb.buffer_add_utf32 (buf, codepoints, 0, len(codepoints))
|
hb.buffer_add_utf8 (buf, text.encode('utf-8'), 0, -1)
|
||||||
hb.buffer_guess_segment_properties (buf)
|
hb.buffer_guess_segment_properties (buf)
|
||||||
|
|
||||||
hb.shape (font, buf, [])
|
hb.shape (font, buf, [])
|
||||||
|
|
Loading…
Reference in New Issue