CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.87k stars 710 forks source link

Issue while installing custom fonts #4555

Open JWaldecker opened 2 years ago

JWaldecker commented 2 years ago

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.

pedropintosilva commented 2 years ago

Hi @JWaldecker and thanks for reporting this. A couple of questions:

tml1024 commented 2 years ago

Just guessing: Shouldn't the second path be /opt/lool/systemplate/usr/local/share/fonts/lool ?

MatejKovacic commented 2 years ago

I am using Nextcloud AIO (all-in-one) where Collabora is integrated. I would like to add new fonts, but don't know how. Any help, suggestion will be highly appreciated.

Lumrenion commented 2 years ago

I am using the collabora docker image. I have a folder fonts, inside a folder for each font containing the ttf-files. I created a volume : ./fonts:/usr/share/fonts/truetype. All seven fonts show up in the dropdown list but are not rendered, just like described above. Then I changed the volume to point to /opt/cool/systemplate/usr/share/fonts/truetype and restarted the container. Now two of my seven fonts show up in the dropdown. Those two are Caudex and Rubik from Google, consisting of multiple ttf-files. The ones missing only have a single ttf-file in their respective folders. Besides Caudex and Rubik are now rendered, but completely wrong: ExampleCollabora

This is what they should look like ExampleWord

Lumrenion commented 2 years ago

I managed to get six of my seven custom fonts to render correctly. Don't know why the seventh font won't render correctly (it simply shows as a generic non-serif font), might be an issue with the font itself. I had to mount my folder with all my fonts to BOTH directories:

volumes:
  - ./fonts:/opt/cool/systemplate/usr/share/fonts/truetype
  - ./fonts:/usr/share/fonts/truetype

Afterwards, I stopped, removed and restarted the container, just to be sure.

dirdi commented 1 year ago

I also stumbled over this bug and documented my findigs over at https://forum.collaboraonline.com/t/adding-fonts-to-collabora-online-causes-segfault/1493.

juliusknorr commented 1 year ago

I also ran into this today when trying to setup fonts in /usr/local/share/fonts. They were picked up properly by fc-cache and also listed in the font select box but rendering was broken and I also had a crash (don't have access to the logs yet though for that instance).

Moving the fonts to /usr/share/fonts/truetype worked then.

SBizienFilippiPEReN commented 1 year ago

The problem comes from coolwsd-systemplate-setup :

Note that the problem may be more general : it's not so easy to cherry-pick some essential files from a live system to make a chroot based on this system without missing parts (but this chroot is a very nice security measure, so it's worth trying !).

BeardOverflow commented 9 months ago

In order to add new fonts, binding folders between host and container no longer works (and maybe it has never worked properly by using huge collections). After reading the docs and try-and-error, the reliable way is: build a new docker image, copy the fonts to /usr/share/fonts/truetype and execute coolconfig as root user. Here an example:

FROM collabora/code:23.05.9.1.1
USER root
COPY fonts /usr/local/share/fonts/truetype
RUN fc-cache -fv && coolconfig update-system-template
USER cool

image

chris-fj commented 2 months ago

I managed to get six of my seven custom fonts to render correctly. Don't know why the seventh font won't render correctly (it simply shows as a generic non-serif font), might be an issue with the font itself. I had to mount my folder with all my fonts to BOTH directories:

volumes:
  - ./fonts:/opt/cool/systemplate/usr/share/fonts/truetype
  - ./fonts:/usr/share/fonts/truetype

Afterwards, I stopped, removed and restarted the container, just to be sure.

I use collabora with owncloud both in docker and this helped. Big thanks @Lumrenion