fix missing space i.e. for:
ox.image.wrapText("VERTEIDIGUNG DER ZEIT", 608, 2, "./data/MontserratBold.ttf", 48)
This commit is contained in:
parent
6996f9c422
commit
330cc5ff3b
1 changed files with 3 additions and 1 deletions
|
@ -215,7 +215,7 @@ def wrapText(text, max_width, max_lines, font_file, font_size):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
# word does not fit in one line
|
# word does not fit in one line
|
||||||
lines[line] += ' '
|
#lines[line] += ' '
|
||||||
chars = list(word)
|
chars = list(word)
|
||||||
for char in chars:
|
for char in chars:
|
||||||
line = len(lines) - 1
|
line = len(lines) - 1
|
||||||
|
@ -236,4 +236,6 @@ def wrapText(text, max_width, max_lines, font_file, font_size):
|
||||||
while get_width(test) > max_width:
|
while get_width(test) > max_width:
|
||||||
test = test[:-2] + ellipsis
|
test = test[:-2] + ellipsis
|
||||||
lines[line] = test
|
lines[line] = test
|
||||||
|
lines[line] += ' '
|
||||||
|
|
||||||
return lines
|
return lines
|
||||||
|
|
Loading…
Reference in a new issue