[justify-demo] Guess segment properties
This commit is contained in:
parent
5c334b9686
commit
5cf54aedde
|
@ -246,15 +246,14 @@ Configuration = namedtuple(
|
|||
|
||||
def makebuffer(text):
|
||||
buf = hb.buffer_create()
|
||||
hb.buffer_set_direction(buf, hb.direction_t.RTL)
|
||||
hb.buffer_set_script(buf, hb.script_t.ARABIC)
|
||||
hb.buffer_set_language(buf, hb.language_from_string(b"ar"))
|
||||
|
||||
# Strip and remove double spaces.
|
||||
text = " ".join(text.split())
|
||||
|
||||
hb.buffer_add_codepoints(buf, [ord(c) for c in text], 0, len(text))
|
||||
|
||||
hb.buffer_guess_segment_properties(buf)
|
||||
|
||||
return buf, text
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue