How to import .otf fonts? (Docker)


i have created a docker-compose for collabora/code. I have some .otf fonts which i want to import. I don’t find anything releated to this on the documentation site.

I have made a volume for /usr/share/fonts

I created a new folder in truetype with the font name.

Now i executed the command: fc-cache

Restarted the docker container and i have looked at my document, but the font does not come. Any ideas?


1 Like

Hello, I found this in the configuration, but I’m looking for a solution too, because even with the documentation I can’t find the solution, I need to add the Comic Sans MS font.
When I copy text from an editor with this font, it appears in my Collabora/code, however I cannot save it to use it later.

Enable download and availability of more fonts by pointing to a font configuration file

<remote_font_config> https://someserver/path/file.json </remote_font_config>

Remote font configuration JSON format

The JSON file pointed to by the above should have contents like in this example

{ “kind”: “fontconfiguration”, “server”: “Some pretty name”, “fonts”: [ { “uri”: “https://somehost/path/f1.ttf” }, { “uri”: “https://someotherhost/path/f2.ttf”, “stamp”: “foo3” }, { “uri”: “https://whatever/path/x42.ttf” } ] }

The JSON file is re-downloaded and scanned whenever it has changed. This is checked once a minute.

If an element in the fonts array has a stamp property then the font file will be re-downloaded and taken into use whenever the stamp has been changed. (And the old version of the font is forgotten.) The stamp can be any string, its contents is not interpreted in any way. The only thing checked is whether it changes. If no stamp property is provided, the web server in question is queried once a minute to check whether the font file has been updated.

The name of a font file is irrelevant. The name of the font is read from the contents of the file. The file should be a TrueType or OpenType font.

1 Like

Hi Loubens,
Can you pls explain how far you followed the explanation of the documentation?
AFAICS, it is similar to what tml explained in his presentation on COOL Days 2022 and 2023.

thnx - Cor

1 Like

Hey @michaelortnerit, welcome to the forum and thanks for the question. :slight_smile:

Hmm… the Docker makes it a little trickier.

I also stumbled across this response by BeardOverflow a few months ago too where he explained how he got custom fonts working inside his docker: