From 1291b32494b1118c28e3ceb8c6fbadb2accf4786 Mon Sep 17 00:00:00 2001 From: p0358 Date: Sat, 28 Sep 2024 18:29:43 +0200 Subject: [PATCH 1/2] How to install font files in Docker --- docs/general/administration/configuration.md | 4 ++-- docs/general/installation/container.md | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/general/administration/configuration.md b/docs/general/administration/configuration.md index 1691853e7..8d8b5fb5f 100644 --- a/docs/general/administration/configuration.md +++ b/docs/general/administration/configuration.md @@ -113,7 +113,7 @@ Jellyfin uses fonts to render text in many places. ### Server Side System Fonts -The system fonts installed on the server are used for burning in subtitles and rendering cover images. How to install them depends on the operating system. +The system fonts installed on the server are used for burning in subtitles and rendering cover images. How to install them depends on the operating system or container being used. ### Client Side System Fonts @@ -121,7 +121,7 @@ The system fonts installed on the client devices are used to display the text in ### Fallback Fonts -The `Fallback Fonts` option is currently used by the web client to render subtitles only. This can be set to a folder containing fonts for this purpose. These fonts are limited to a total size of 20MB. Lightweight formats optimized for web like woff2 are recommended. A tool to convert normal TrueType (`.ttf`) and OpenType (`.otf`) fonts to woff2 can be found [in their repo](https://github.com/google/woff2). +The `Fallback Fonts` option is currently used by the web client to render subtitles only. This can be set to a folder on the server containing fonts for this purpose, which will then be streamed to the client during playback, negating the need to manually install them to all clients locally. These fonts are limited to a total size of 20 MB. Lightweight formats optimized for web like woff2 are recommended. A tool to convert normal TrueType (`.ttf`) and OpenType (`.otf`) fonts to woff2 can be found [in their repo](https://github.com/google/woff2). ### Downloading Fonts diff --git a/docs/general/installation/container.md b/docs/general/installation/container.md index 986b8c02b..3e3b52407 100644 --- a/docs/general/installation/container.md +++ b/docs/general/installation/container.md @@ -83,6 +83,12 @@ Multiple media libraries can be bind mounted if needed: ...etc ``` +Custom [server-side system fonts](/docs/general/administration/configuration/#server-side-system-fonts) directory can be optionally bind mounted in order to use these fonts during transcoding with subtitle burn-in: + +```sh +--mount type=bind,source=/path/to/fonts,target=/usr/local/share/fonts/custom,readonly +``` + ### Using Docker Compose Create a `docker-compose.yml` file with the following contents. Add in the UID and GID that you would like to run jellyfin as in the user line below, or remove the user line to use the default (root). @@ -104,6 +110,11 @@ services: source: /path/to/media2 target: /media2 read_only: true + # Optional - extra fonts to be used during transcoding with subtitle burn-in + - type: bind + source: /path/to/fonts + target: /usr/local/share/fonts/custom + read_only: true restart: 'unless-stopped' # Optional - alternative address used for autodiscovery environment: From 46fe1d25b676360bc40a585dc7afa316a42436a0 Mon Sep 17 00:00:00 2001 From: p0358 Date: Tue, 22 Oct 2024 11:11:36 +0200 Subject: [PATCH 2/2] Further changes to font instructions --- docs/general/administration/configuration.md | 6 ++++-- docs/general/installation/container.md | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/general/administration/configuration.md b/docs/general/administration/configuration.md index 8d8b5fb5f..bd11fa3f3 100644 --- a/docs/general/administration/configuration.md +++ b/docs/general/administration/configuration.md @@ -113,7 +113,7 @@ Jellyfin uses fonts to render text in many places. ### Server Side System Fonts -The system fonts installed on the server are used for burning in subtitles and rendering cover images. How to install them depends on the operating system or container being used. +The system fonts installed on the server are used for burning in subtitles and rendering cover images. How to install them depends on the operating system or if a container is being used. ### Client Side System Fonts @@ -121,7 +121,9 @@ The system fonts installed on the client devices are used to display the text in ### Fallback Fonts -The `Fallback Fonts` option is currently used by the web client to render subtitles only. This can be set to a folder on the server containing fonts for this purpose, which will then be streamed to the client during playback, negating the need to manually install them to all clients locally. These fonts are limited to a total size of 20 MB. Lightweight formats optimized for web like woff2 are recommended. A tool to convert normal TrueType (`.ttf`) and OpenType (`.otf`) fonts to woff2 can be found [in their repo](https://github.com/google/woff2). +The `Fallback Fonts` installed on the server are loaded up by the web client to render ASS subtitles. They will be used if no other existing fonts (such as MKV attachments or client-side fonts) can be used to render certain glyphs, such as CJK characters, instead of displaying an empty "tofu" block. + +This setting can be set to a folder on the server containing fonts for this purpose. These fonts are limited to a total size of 20 MB, since all of them will be always preloaded in the browser, regardless of whether they'll be needed or not. Lightweight formats optimized for web like woff2 are recommended. A tool to convert normal TrueType (`.ttf`) and OpenType (`.otf`) fonts to woff2 can be found [in their repo](https://github.com/google/woff2). ### Downloading Fonts diff --git a/docs/general/installation/container.md b/docs/general/installation/container.md index 3e3b52407..2ac405e0f 100644 --- a/docs/general/installation/container.md +++ b/docs/general/installation/container.md @@ -89,6 +89,12 @@ Custom [server-side system fonts](/docs/general/administration/configuration/#se --mount type=bind,source=/path/to/fonts,target=/usr/local/share/fonts/custom,readonly ``` +A directory of [fallback fonts](/docs/general/administration/configuration/#fallback-fonts) can be mounted as well. In this case, you will have to set the directory of fallback fonts to `/fallback_fonts` in Jellyfin server settings panel: + +```sh +--mount type=bind,source=/path/to/fallback/fonts,target=/fallback_fonts,readonly +``` + ### Using Docker Compose Create a `docker-compose.yml` file with the following contents. Add in the UID and GID that you would like to run jellyfin as in the user line below, or remove the user line to use the default (root).