default font is system

This commit is contained in:
sun-guannan
2025-08-12 15:29:35 +08:00
parent 93c1c76e5b
commit 4a77eea949

View File

@@ -14,7 +14,7 @@ def add_text_impl(
draft_id: str | None = None, # Python 3.10+ 新语法
transform_y: float = -0.8,
transform_x: float = 0,
font: str = "文轩体",
font: Optional[str] = None,
font_color: str = "#ffffff",
font_size: float = 8.0,
track_name: str = "text_main",
@@ -102,6 +102,9 @@ def add_text_impl(
:return: Updated draft information
"""
# Validate if font is in Font_type
if font is None:
font_type = None
else:
try:
font_type = getattr(Font_type, font)
except: