mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2024-10-21 16:27:15 +08:00
修复pillow10不支持的textsize (#487)
This commit is contained in:
parent
a5921148ff
commit
d2069ac23f
@ -217,7 +217,7 @@ class PMImage:
|
|||||||
height: Tuple[int, int],
|
height: Tuple[int, int],
|
||||||
font: ImageFont.ImageFont,
|
font: ImageFont.ImageFont,
|
||||||
color: Union[str, Tuple[int, int, int, int]] = 'white'):
|
color: Union[str, Tuple[int, int, int, int]] = 'white'):
|
||||||
text_height = self.draw.textsize(text, font=font)[1]
|
text_height = self.draw.textbbox((0, 0), text = text, font=font)[3] - self.draw.textbbox((0, 0), text = text, font=font)[1]
|
||||||
width_now = width[0]
|
width_now = width[0]
|
||||||
height_now = height[0]
|
height_now = height[0]
|
||||||
for c in text:
|
for c in text:
|
||||||
|
Loading…
Reference in New Issue
Block a user