fix(backend): #1896 修复字体映射补充开源字体文件 #1912
Reference in New Issue
Block a user
Delete Branch "fix/1896-font-mapping-open-source"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
Issue #1896:后端 DRAWTEXT_FONT_MAP 把所有前端字体选项(思源宋体/苹方/微软雅黑/楷体/华康俪金黑)全部映射到 NotoSansSC,导致成片无论选什么字体都渲染为思源黑体。FONT_NAME_MAP 也将楷体错误映射到 Noto Serif CJK SC(宋体),ASS 字幕楷体显示为宋体。
修复
1. 字体映射修复
packages/domain/video_filter_builder.py:packages/domain/ass_subtitle_builder.py:"LXGW WenKai"(已通过 fc-list 验证注册名),思源宋体已正确映射"Noto Serif CJK SC"(fonts-noto-cjk 包自带 + VF.otf)2. 开源字体文件补充(SIL OFL / Apache 2.0 免费可商用)
infra/fonts/NotoSerifCJKsc-VF.otf(53MB):思源宋体 Noto Serif CJK SC 可变字体,含多字重infra/fonts/LXGWWenKai-Regular.ttf(25MB):霞鹜文楷 v1.522 开源楷体,SIL OFL3. Dockerfile 更新
infra/docker/worker-base.Dockerfile+api-base.Dockerfile:mkdir -p /usr/share/fonts/truetype/lxgw创建楷体目录字体选型说明
前端需按 #1896 同步:删除"华康俪金黑"选项(或替换为"思源黑体粗体"用 font_weight 控制)。
测试
LXGW WenKai,霞鹜文楷:style=Regular和Noto Serif CJK SC注册名均可被 fontconfig 识别Refs: #1896
🚀 预览环境已部署
🗑️ 预览环境已清理
PR #1912 已关闭或合并,对应的预览环境已被清理。