[py] minor, comment buffer_add_utf8 call
mainly to apply lgtm suggestion, looks better also however, some minor spacing is also applied.
This commit is contained in:
parent
2c1d699409
commit
2a182128b9
|
@ -33,14 +33,13 @@ hb.buffer_set_message_func (buf, debugger.message, 1, 0)
|
|||
#
|
||||
# See https://github.com/harfbuzz/harfbuzz/pull/271
|
||||
#
|
||||
if False:
|
||||
# If you do not care about cluster values reflecting Python
|
||||
# string indices, then this is quickest way to add text to
|
||||
# buffer:
|
||||
hb.buffer_add_utf8 (buf, text.encode('utf-8'), 0, -1)
|
||||
# hb.buffer_add_utf8 (buf, text.encode('utf-8'), 0, -1)
|
||||
# Otherwise, then following handles both narrow and wide
|
||||
# Python builds (the first item in the array is BOM, so we skip it):
|
||||
elif sys.maxunicode == 0x10FFFF:
|
||||
if sys.maxunicode == 0x10FFFF:
|
||||
hb.buffer_add_utf32 (buf, array.array ('I', text.encode ('utf-32'))[1:], 0, -1)
|
||||
else:
|
||||
hb.buffer_add_utf16 (buf, array.array ('H', text.encode ('utf-16'))[1:], 0, -1)
|
||||
|
|
Loading…
Reference in New Issue