最治标治本的方法是挂载字体到容器下的 /usr/share/fonts/里
例如:
下载 Sarasa Gothic (更纱黑体)
https://github.com/be5invis/Sarasa-Gothic/releases把你想要的简繁字体放到一个文件夹里
例如:
/home/docker/data/jellyfin/fonts/sarasa
sarasa-gothic-sc-bolditalic.ttf sarasa-gothic-sc-regular.ttf sarasa-gothic-tc-italic.ttf
sarasa-gothic-sc-bold.ttf sarasa-gothic-sc-semibolditalic.ttf sarasa-gothic-tc-lightitalic.ttf
sarasa-gothic-sc-extralightitalic.ttf sarasa-gothic-sc-semibold.ttf sarasa-gothic-tc-light.ttf
sarasa-gothic-sc-extralight.ttf sarasa-gothic-tc-bolditalic.ttf sarasa-gothic-tc-regular.ttf
sarasa-gothic-sc-italic.ttf sarasa-gothic-tc-bold.ttf sarasa-gothic-tc-semibolditalic.ttf
sarasa-gothic-sc-lightitalic.ttf sarasa-gothic-tc-extralightitalic.ttf sarasa-gothic-tc-semibold.ttf
把这个文件夹挂载到容器的 /usr/share/fonts/ 底下
docker-compose:
- /home/docker/data/jellyfin/fonts/sarasa:/usr/share/fonts/sarasa
这样视频转码的时候, 出现找不到字体的情况, 会自动去读取这个字体
[Parsed_subtitles_3 @ 0x56524347a040] Using font provider fontconfig
[Parsed_subtitles_3 @ 0x56524347a040] fontselect: (方正中雅宋_GBK, 400, 0) -> /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf, 0, DejaVuSans
[Parsed_subtitles_3 @ 0x56524347a040] Glyph 0x672C not found, selecting one more font for (方正中雅宋_GBK, 400, 0)
[Parsed_subtitles_3 @ 0x56524347a040] fontselect: (方正中雅宋_GBK, 400, 0) -> /usr/share/fonts/sarasa/sarasa-gothic-sc-regular.ttf, 0, Sarasa-Gothic-SC-Regular