mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-12-01 10:34:23 +01:00
[justify-demo] Guess segment properties
This commit is contained in:
1 parent
5c334b9686
commit
5cf54aedde
1 file changed
+2
-3
+2
-3
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user