This commit is contained in:
HibiKier
2022-05-21 13:15:53 +08:00
parent 86a8fe7096
commit 188ae38525
25 changed files with 153 additions and 124 deletions
+5 -4
View File
@@ -1493,10 +1493,11 @@ async def text2image(
height = 0
_tmp = BuildImage(0, 0, font=font, font_size=font_size)
for x in text.split("\n"):
x = x if x.strip() else "正"
w, h = _tmp.getsize(x)
height += h + _add_height
width = width if width > w else w
if x:
w, _ = _tmp.getsize(x)
_, h = _tmp.getsize("正")
height += h + _add_height
width = width if width > w else w
width += pw
height += ph
A = BuildImage(