From d2069ac23f829151b9f4dab56f6f2c6a9c99aefc Mon Sep 17 00:00:00 2001 From: Cathgao <21031564+Cathgao@users.noreply.github.com> Date: Thu, 14 Mar 2024 12:30:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dpillow10=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=9A=84textsize=20(#487)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LittlePaimon/utils/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LittlePaimon/utils/image.py b/LittlePaimon/utils/image.py index 937d781..ddf5403 100644 --- a/LittlePaimon/utils/image.py +++ b/LittlePaimon/utils/image.py @@ -217,7 +217,7 @@ class PMImage: height: Tuple[int, int], font: ImageFont.ImageFont, 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] height_now = height[0] for c in text: