From 4aba319560bdf0afcf984b44ef7d56e93d8b9b8e Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Sun, 5 Mar 2023 19:57:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=94=99=E8=AF=AF=E7=9A=84=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E8=BF=87=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/utils/text2img.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/utils/text2img.py b/pkg/utils/text2img.py index 83ad61c3..b21f72ec 100644 --- a/pkg/utils/text2img.py +++ b/pkg/utils/text2img.py @@ -6,10 +6,11 @@ import os import config import traceback +text_render_font: ImageFont = None + if hasattr(config, "blob_message_strategy") and config.blob_message_strategy == "image": # 仅在启用了image时才加载字体 + use_font = config.font_path if hasattr(config, "font_path") else "" try: - use_font = config.font_path if hasattr(config, "font_path") else "" - text_render_font: ImageFont = None # 检查是否存在 if not os.path.exists(use_font):