11
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user