These days, I use my server based instance of OnlyOffice in combination with Nextcloud more often than the locally installed LibreOffice. The main reason is that I edit many documents on more than one device, so having them on my own server and to be able to edit them from anywhere is a game changer. Also, OnlyOffice’s Word, Excel and Powerpoint compatibility is significantly better than that of LibreOffice to the point that it is almost perfect. One little thing that was missing so far, however, was the use of extra fonts that are not included in the package. Unfortunately, that is sometimes necessary when I get documents from other people that are not using standard and free fonts. On my notebook, adding fonts is simple: Just copy them to a certain directory and it’s done. Turns out that the same approach also works very nicely for a dockerized OnlyOffice on the server.
So here’s how it works in practice: In the docker-compose directory of OnlyOffice on the server, create a fonts directory and place your additional fonts there:
mkdir fonts
cd fonts
tar xvzf ../my-special-fonts.tar.gz
cd ..
sudo chmod -R 755 fonts
The only other thing to do is to map that folder into the OnlyOffice docker container in the docker-compose.yml file:
volumes:
- /var/www/onlyoffice/Data
- /var/log/onlyoffice
- /var/lib/onlyoffice/documentserver/App_Data/cache/files
- /var/www/onlyoffice/documentserver-example/public/files
- /usr/share/fonts
- ./fonts:/usr/share/fonts/truetype/custom
And that’s it! Restart and done!