# How to import .otf fonts? (Docker)

**URL:** <https://forum.collaboraonline.com/t/how-to-import-otf-fonts-docker/2538>\
**Category:** Installation & Configuration\
**Created:** [April 15, 2024, 8:28am UTC](https://forum.collaboraonline.com/t/how-to-import-otf-fonts-docker/2538 "2024-04-15T08:28:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelortnerit](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/michaelortnerit/32/1103_2.png) [@michaelortnerit](https://forum.collaboraonline.com/u/michaelortnerit)\
**Post date:** [April 15, 2024, 8:28am UTC](https://forum.collaboraonline.com/t/how-to-import-otf-fonts-docker/2538/1 "2024-04-15T08:28:32Z")

</div>

Hello,

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?

Thanks

---

<div class="post-metadata">

**Author:** ![Loubens](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@Loubens](https://forum.collaboraonline.com/u/Loubens)\
**Post date:** [April 19, 2024, 8:52am UTC](https://forum.collaboraonline.com/t/how-to-import-otf-fonts-docker/2538/2 "2024-04-19T08:52:44Z")

</div>

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.

https://sdk.collaboraonline.com/docs/installation/Configuration.html#enable-download-and-availability-of-more-fonts-by-pointing-to-a-font-configuration-file

### Enable download and availability of more fonts by pointing to a font configuration file[](https://sdk.collaboraonline.com/docs/installation/Configuration.html#enable-download-and-availability-of-more-fonts-by-pointing-to-a-font-configuration-file)

\<remote\_font\_config\> [https://someserver/path/file.json](https://someserver/path/file.json) \</remote\_font\_config\>

### Remote font configuration JSON format[](https://sdk.collaboraonline.com/docs/installation/Configuration.html#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](https://somehost/path/f1.ttf)” }, { “uri”: “[https://someotherhost/path/f2.ttf](https://someotherhost/path/f2.ttf)”, “stamp”: “foo3” }, { “uri”: “[https://whatever/path/x42.ttf](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.

---

<div class="post-metadata">

**Author:** ![cornouws](https://avatars.discourse-cdn.com/v4/letter/c/7ab992/32.png) [@cornouws](https://forum.collaboraonline.com/u/cornouws)\
**Post date:** [April 23, 2024, 10:48am UTC](https://forum.collaboraonline.com/t/how-to-import-otf-fonts-docker/2538/3 "2024-04-23T10:48:18Z")

</div>

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. [https://www.youtube.com/watch?v=\_vlyjTNCtps&t=345s](https://www.youtube.com/watch?v=_vlyjTNCtps&t=345s)
2. [https://www.youtube.com/watch?v=5FIW3GDrpoo](https://www.youtube.com/watch?v=5FIW3GDrpoo)

---

<div class="post-metadata">

**Author:** ![Tex](https://avatars.discourse-cdn.com/v4/letter/t/eb8c5e/32.png) [@Tex](https://forum.collaboraonline.com/u/Tex)\
**Post date:** [April 25, 2024, 2:52am UTC](https://forum.collaboraonline.com/t/how-to-import-otf-fonts-docker/2538/4 "2024-04-25T02:52:48Z")

</div>

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

> [@michaelortnerit](#):
>
> 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.
> 
> […]
> 
> Restarted the docker container and i have looked at my document, but the font does not come. Any ideas?

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:

> <https://github.com/CollaboraOnline/online/issues/4555#issuecomment-1950295694>
>
> I've installed a few custom fonts in a directory on the server and passed it as …a volume for the docker container to both \`/usr/local/share/fonts/lool\` and \`/opt/lool/systemplate/usr/share/fonts/lool\`. 
> Now the fonts are displayed in the dropdown in the collabora online editor. When I select the new font the text vanishes and I can't select it.
> 
> The fonts are located directly in the directory and are in the format \`TTF\`.
