Pango: get_log_attrs seems not to write anything
I'm trying to use Pango.get_log_attrs() as documented, c-api but all fields of the PangoLogAttrs stay at their original values, see this minimal test case:
import gi
gi.require_version('Pango', '1.0')
from gi.repository import Pango as pango
# setup
pango_language = pango.language_from_string('en_US')
text = '''This is a test sentence.'''
text_bytes = text.encode()
# get attributes
log_attributes = [pango.LogAttr() for i in range(len(text) + 1)]
pango.get_log_attrs(text, len(text_bytes), -1, pango_language, log_attributes)
# testing
whitespaces = [a.is_white != 0 for a in log_attributes]
print(whitespaces)
assert any(whitespaces)
I get this output:
$ python log.py
[False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False]
Traceback (most recent call last):
File "log.py", line 19, in <module>
assert any(whitespaces)
AssertionError
If I initialize/overwrite is_white values with e.g. 1 before the call, they do not change.
My versions:
$ pacman -Q python-gobject
python-gobject 3.32.1-1
$ python --version
Python 3.7.3
$ pacman -Q pango
pango 1:1.43.0-2
Pango.version() prints: 14300