From 45fbb947daadf258d162ea9efe7ad2c1f43d58bd Mon Sep 17 00:00:00 2001 From: "Mr.Xia" <1424473282@qq.com> Date: Sat, 4 Apr 2026 22:19:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(image=5Frender):=20=E4=B8=BA=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E8=B7=AF=E5=BE=84=E6=8F=90=E4=BE=9B=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 避免在未提供字体路径时出现None值错误,确保渲染器能正常初始化。 默认使用NotoSansCJK-Regular.ttc和NotoColorEmoji.ttf字体文件。 --- danding_bot/plugins/danding_qqpush/image_render.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/danding_bot/plugins/danding_qqpush/image_render.py b/danding_bot/plugins/danding_qqpush/image_render.py index bcc68b0..5cb3b23 100644 --- a/danding_bot/plugins/danding_qqpush/image_render.py +++ b/danding_bot/plugins/danding_qqpush/image_render.py @@ -16,7 +16,10 @@ class ImageRenderer: line_spacing: float = 1.4, bg_color: Tuple[int, int, int] = (252, 252, 252), text_color: Tuple[int, int, int] = (0, 0, 0), - font_paths: list = None + font_paths: list = [ + "/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc", # 中文 + "/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf" # emoji + ] ): """ 初始化图片渲染器