Skip to content

Commit

Permalink
🐛 更改已移除的方法
Browse files Browse the repository at this point in the history
  • Loading branch information
zhulinyv committed Apr 9, 2024
1 parent 136a6db commit 6f04811
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nonebot_plugin_fortune/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ def drawing(gid: str, uid: str, theme: str, spec_path: Optional[str] = None) ->
"text": f"{fortune_config.fortune_path}/font/sakura.ttf",
}
ttfront = ImageFont.truetype(fontPath["title"], font_size)
font_length = ttfront.getsize(title)
font_length = ttfront.getbbox(title)
draw.text(
(
image_font_center[0] - font_length[0] / 2,
image_font_center[1] - font_length[1] / 2,
image_font_center[0] - (font_length[2] - font_length[0]) / 2,
image_font_center[1] - (font_length[3] - font_length[1]) / 2,
),
title,
fill=color,
Expand Down

0 comments on commit 6f04811

Please sign in to comment.