fix(image_render): 为字体路径提供默认值
避免在未提供字体路径时出现None值错误,确保渲染器能正常初始化。 默认使用NotoSansCJK-Regular.ttc和NotoColorEmoji.ttf字体文件。
This commit is contained in:
@@ -16,7 +16,10 @@ class ImageRenderer:
|
|||||||
line_spacing: float = 1.4,
|
line_spacing: float = 1.4,
|
||||||
bg_color: Tuple[int, int, int] = (252, 252, 252),
|
bg_color: Tuple[int, int, int] = (252, 252, 252),
|
||||||
text_color: Tuple[int, int, int] = (0, 0, 0),
|
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
|
||||||
|
]
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
初始化图片渲染器
|
初始化图片渲染器
|
||||||
|
|||||||
Reference in New Issue
Block a user