在使用Docker安裝Jellyfin之後,可能會遇到缺字問題。
如果影片的.ass字幕檔有使用額外字型,需要手動放入字型,否則中文字幕會變成方塊。
將要使用的.ttf或者.otf字型集中放在一個Linux的資料夾。例如中日文字型可以使用Noto CJK fonts,有些漢化組也會在資源中提供.ass用到的字幕樣式。並參照FreeDesktop的XDG標準,放到
/home/user/.local/share/fonts/
資料夾。修改Jellyfin的
docker-compose.yml
,修改Docker volume的部份,將字型所在的資料夾掛載進容器裡面的/usr/local/share/fonts/custom/
volumes:
- "./config:/config"
- "./cache:/cache"
- type: bind
source: "/home/user/電影/"
target: "/電影/"
read_only: true
- type: bind
source: "/home/user/動畫/"
target: "/動畫/"
read_only: true
- type: bind
source: "/home/user/音樂/"
target: "/音樂/"
read_only: true
- type: bind # 掛載字型目錄
source: "/home/user/.local/share/fonts/"
target: "/usr/local/share/fonts/custom/"
read_only: true
- 重新啟動Jellyfin的Docker服務。
sudo docker compose down
sudo docker compose up -d
開啟Jellyfin,點右上角 → 控制台 → 播放 → 轉檔,勾選啟用備用字體,在這裡填入字型所在目錄。捲動到畫面最下面儲存。
嘗試播放影片字幕應該就會正常顯示了。還是不行的話重新啟動Jellyfin的Docker服務。