fix: 修复 Noto Sans CJK SC Bold 字体混入 Mono 等宽变体问题 #1510

Merged
xiaoxia merged 1 commits from fix/noto-cjk-font-bold-mono-issue into develop 2026-08-26 19:12:00 +08:00
2 changed files with 25 additions and 3 deletions
+12 -1
View File
@@ -12,6 +12,8 @@ RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debia
sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list 2>/dev/null || true
# 预装系统依赖(gcc 编译 psycopg/pg 扩展,libpq-dev 编译期,libpq5 运行期,ffmpeg 封面取帧)
# 字体修复:fonts-noto-cjk 包的 .ttc 文件混入了 Mono 变体,导致 Bold 匹配到等宽字体
# 解决方案:删除有问题的 .ttc,从 Google Fonts 下载单独的 Noto Sans SC(不含 Mono
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
@@ -19,7 +21,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
fonts-noto-cjk \
fontconfig \
&& rm -rf /var/lib/apt/lists/*
curl \
&& rm -rf /var/lib/apt/lists/* \
# 删除有问题的 .ttc 文件(包含 Mono 变体)
&& rm -f /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc \
&& rm -f /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc \
# 下载单独的 Noto Sans SCVariable Font,包含所有字重,不含 Mono)
&& curl -fsSL -o /usr/share/fonts/opentype/noto/NotoSansSC-VF.ttf \
"https://github.com/google/fonts/raw/main/ofl/notosanssc/NotoSansSC%5Bwght%5D.ttf" \
# 刷新字体缓存
&& fc-cache -fv
# 创建虚拟环境
RUN python -m venv /opt/venv
+13 -2
View File
@@ -12,6 +12,8 @@ RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debia
sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list 2>/dev/null || true
# 预装系统依赖(编译工具 + 运行时 + CJK 字体用于 ASS 字幕渲染)
# 字体修复:fonts-noto-cjk 包的 .ttc 文件混入了 Mono 变体,导致 Bold 匹配到等宽字体
# 解决方案:删除有问题的 .ttc,从 Google Fonts 下载单独的 Noto Sans SC(不含 Mono
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
@@ -20,8 +22,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
libglib2.0-0 \
fonts-noto-cjk \
&& fc-cache -fv \
&& rm -rf /var/lib/apt/lists/*
fontconfig \
curl \
&& rm -rf /var/lib/apt/lists/* \
# 删除有问题的 .ttc 文件(包含 Mono 变体)
&& rm -f /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc \
&& rm -f /usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc \
# 下载单独的 Noto Sans SCVariable Font,包含所有字重,不含 Mono)
&& curl -fsSL -o /usr/share/fonts/opentype/noto/NotoSansSC-VF.ttf \
"https://github.com/google/fonts/raw/main/ofl/notosanssc/NotoSansSC%5Bwght%5D.ttf" \
# 刷新字体缓存
&& fc-cache -fv
# 创建虚拟环境
RUN python -m venv /opt/venv