This commit is contained in:
949036910@qq.com
2026-06-02 23:18:07 +08:00
parent 983d96ce7e
commit 7fa83f57b6
4 changed files with 42 additions and 5 deletions

View File

@@ -79,6 +79,16 @@ def resolve_cjk_font_path(
解析可用于 PIL / ffmpeg 的中文字体文件路径。
"""
family = _normalize_family(font_family)
try:
from modules.font_manager import get_font_manager
ziti_path = get_font_manager().find_font(family, weight)
if ziti_path and os.path.isfile(ziti_path):
return str(Path(ziti_path).resolve())
except Exception as e:
print(f"[chinese_font] font_manager lookup skipped: {e}", file=sys.stderr)
candidates = _candidate_filenames(family, weight)
scripts = _scripts_dir()