I would like to add fonts (TTFs) to Collabora online running as docker-container on nextcloud / Ubuntu 18.04. Via Internetresearch I found out that I have to put the TTFs into the folder /usr/local/share/fonts/truetype and to add an additional parameter to the docker-command:
As I understand it there are two ways to add Collabora to Nextcloud: as a package or as a Docker image. Both ways use the Collabora Online Developer Edition (CODE) unless you want to pay for the enterprise Collabora Office.
There are CODE packages available for several Linux distributions: https://www.collaboraoffice.com/code/linux-packages/
Using this you would probably be able to add your fonts via the directory you specified; however, this is something I haven’t tried.
I don’t believe you can add fonts to the Docker container; you have to tweak the original and then create your own Docker container. The instructions are here: https://www.collaboraoffice.com/code/docker/
Again, this is not something I have tried as it probably has to be tweaked every time there is a Collabora update.
Sorry this is not the full answer we would all want!
then you have to look what’s in the folder /opt/collaboraoffice???/share/fonts/truetype/local
if there are already ttf files and you use the --volume parameter with docker run you have to make sure that these files are also in /usr/local/share/fonts/truetype. because you map the complete folder /usr/local/share/fonts/truetype from your host to the container folder /opt/collaboraoffice???/share/fonts/truetype/local.
you could also map single files from your host to the container. but if you want to add several file this can be a long list.
btw: i guess the version 6.0 is wrong. the collabora code image has the version 4.
First of all you are right. I used the “exec”-command so I could mount the container and -yes- the folder with the fontfiles
/opt/collaboraoffice6.0/share/fonts/truetype
is now shown. The first step into the right direction, but not yet the solution But the subfolder “truetype/local” in the container mentioned in the commandlet is missing. Shall I create this subfolder? I also dont know the meaning of “local/:ro” at the end of the commandlet. Is its syntax “local/:ro” correct?
Error response from daemon: OCI runtime create failed: container_linux.go:346:
starting container process caused “exec: “–volume”: executable file not found in $PATH”: unknown.
It would be nice if you could post the needed commandlets step-by-step for the solution.
btw: on my ubuntu 18.04 test machine ttf fonts were install to /usr/share/fonts/truetype. so you may want to change that in the docker run command as well.
/usr/local/share/fonts/truetype/ is the location on my host (ubuntu 20.04LTS). To find yours, you should do something like:
sudo updatedb
locate truetype
or with find /usr -name truetype
–name collabora is optional (one will be created dynamically)
collabora/code is the image name and MUST be the last parameter (hint: OCI runtime failure code)
==
EDIT:
Note that if you are using the snap version of docker (i guess stantard since ubuntu 22.04 server), the location of the fonts will NOT be the one of your system, but something like /snap/core22/1033/usr/share/fonts/truetype
You might consider making a symbolic link (I choose to install docker from packages, because a container-like solution into another container like solution was too much inception for me)
On my system the font dir had to be owned by root and chmod 644, at least I didn’t see the fonts in collabora otherwise. I copied in all the ttf fonts from my windows 10.
You’re right! I’ve had wrong permissions on the parent folder, I’ve sorted that and now it works without root as well. I’ve restored snaphot where the perms were root:root, ran sudo chown -R 104:106 collab_fonts/* && sudo chmod 644 collab_fonts/* && sudo chmod 755 collab_fonts/, rebuilt stack and the fonts show up.