richdocuments icon indicating copy to clipboard operation
richdocuments copied to clipboard

Custom fonts for built-in Nextcloud Office

Open siccovansas opened this issue 2 years ago • 21 comments

Is your feature request related to a problem? Please describe. It currently seems to be hard or impossible to use custom fonts when using the built-in Nextcloud Office

Describe the solution you'd like In 'Administration > Nextcloud Office > Extra Fonts' I’ve uploaded the fonts. This works fine. On that page it says:

Make sure to set this URL: https://<MY_URL>/apps/richdocuments/settings/fonts.json in the coolwsd.xml file of your Collabora Online server to ensure the added fonts get loaded automatically.

I run Nextcloud via Docker. Directly editing the file in the container doesn’t seem to persist after a restart. I tried to mount coolwsd.xml in my docker-compose.yml, but Collabora then doesn’t start (Could not establish connection to the Collabora Online server. is shown in the Nextcloud Office settings).

I see two solutions:

  • Allow coolwsd.xml to be mounted or configured in docker-compose.yml
  • Automatically configure coolwsd.xml with the URL (that seems to make te most sense for the built-in version right?)

siccovansas avatar Jan 17 '23 20:01 siccovansas

Same issue here. Also cant find the coolwsd.xml file anywhere.

yeeahnick avatar Jan 17 '23 22:01 yeeahnick

None of the named files (fonts.json, coolwsd.xml) are present in the latest 25.0.3 docker image. As far as i understand coolwsd is an additional tool/package running for a standalone installation.

So I guess there is some workaround for the built-in solution but no documentation can be found.

derBobby avatar Jan 27 '23 11:01 derBobby

Update: There is a temporal coolwsd.xml file but no obvious solution how to make a permanent change to it.

www-data@624bd21fdd6b:~$ find / -name "*coolwsd*" 2>/dev/null
/tmp/coolwsd.aN5UwJxohX
/tmp/coolwsd.aN5UwJxohX/coolwsd.log
/tmp/coolwsd.pid
/tmp/appimage_extracted_<hex-id>/lib/systemd/system/coolwsd.service
/tmp/appimage_extracted_<hex-id>/usr/bin/coolwsd-generate-proof-key
/tmp/appimage_extracted_<hex-id>/usr/bin/coolwsd-systemplate-setup
/tmp/appimage_extracted_<hex-id>/usr/bin/coolwsd
/tmp/appimage_extracted_<hex-id>/usr/share/man/man1/coolwsd-systemplate-setup.1.gz
/tmp/appimage_extracted_<hex-id>/usr/share/man/man1/coolwsd.1.gz
/tmp/appimage_extracted_<hex-id>/usr/share/man/man1/coolwsd-generate-proof-key.1.gz
/tmp/appimage_extracted_<hex-id>/usr/share/coolwsd
/tmp/appimage_extracted_<hex-id>/usr/share/doc/coolwsd
/tmp/appimage_extracted_<hex-id>/etc/coolwsd
/tmp/appimage_extracted_<hex-id>/etc/coolwsd/coolwsd.xml
/tmp/appimage_extracted_<hex-id>/etc/nginx/snippets/coolwsd.conf
/tmp/appimage_extracted_<hex-id>/etc/apache2/conf-available/coolwsd.conf
/tmp/coolwsd.xF8wKGas1m
/tmp/coolwsd.xF8wKGas1m/coolwsd.log

derBobby avatar Jan 27 '23 12:01 derBobby

Same issue here. Also cant find the coolwsd.xml file anywhere.

arsw1 avatar Mar 16 '23 18:03 arsw1

Same here. Would be nice if someone had checked if that advice actually worked before putting it there....

bepstein111 avatar Jun 22 '23 04:06 bepstein111

We should maybe consider tweaking the language in the "Extra fonts" section to if there is a difference in behavior/capability with the Built-in Server versus Standalone/Dedicated.

Also, if so, there seems to be room for some documentation enhancements. The method available in the Nextcloud Office settings doesn't reflect that it is the documentation at all: https://docs.nextcloud.com/server/latest/admin_manual/office/configuration.html#custom-fonts

I haven't tried to add fonts myself, but I'm left confused. :-)

If someone feels like sorting out one or more of these matters, keep in mind this is a community project. PRs are welcome (whether to code or documentation - there's an edit button at the top of every page in the Admin Manual!).

This Issue probably needs the Enhancement label in the meantime.

joshtrichards avatar Jul 13 '23 16:07 joshtrichards

This looks helpful:

https://github.com/CollaboraOnline/richdocumentscode/commit/c685719bec4bd5adf6d464abd3cc86ac87f349f3

joshtrichards avatar Jul 13 '23 17:07 joshtrichards

@timar Thanks for the fix/commit c685719! I'm running richdocumentscode 23.5.104 and have uploaded fonts via the settings page. I still don't see the fonts when editing a document though. Can you or others confirm that this fix works?

siccovansas avatar Jul 14 '23 18:07 siccovansas

@siccovansas

Some things to check:

  • Visiting https://<MY_URL>/apps/richdocuments/settings/fonts.json from your browser to make sure some fonts are listed
  • Is https://<MY_URL>/apps/richdocuments/settings/fonts.json accessible from within your Docker container? (Thinking about this and looking at the code I'm thinking there could maybe be some issues with some environments depending on whether their external https:// URL -- the front-end of their proxy -- is accessible from their app container...)
  • Waiting >1 minute for the font config refresh to kick in

joshtrichards avatar Nov 06 '23 23:11 joshtrichards

Thanks for looking into this @joshtrichards :pray:!

  • The fonts I added are indeed listed when I visit https://<MY_URL>/apps/richdocuments/settings/fonts.json (from the browser or when using curl).
  • The fonts are also listed when I run curl https://<MY_URL>/apps/richdocuments/settings/fonts.json from within the Nextcloud docker container.
  • When do I have to wait >1 minute? I've added these fonts months ago, so I guess waiting doesn't work :)?

Something I noticed recently. I can copy text in my added font (IBM Plex Sans Condensed) from another application (Google Docs)! The font is then showed correctly in my Nextcloud Office document and the font name is shown in font menu field, see this screenshot: Screenshot from 2023-11-07 11-54-43

But when I open the font selection menu, the font is still not shown: Screenshot from 2023-11-07 11-56-48

So it seems that the font is technically available but (only?) not shown in the font selection menu?

siccovansas avatar Nov 07 '23 11:11 siccovansas

最新的 25.0.3 docker 映像中不存在任何指定文件(fonts.json、coolwsd.xml)。 据我了解,coolwsd 是一个为独立安装运行的附加工具/包。

所以我猜内置解决方案有一些解决方法,但找不到文档。

我也是,不能显示中文,

gudaoxongdi avatar Jan 11 '24 03:01 gudaoxongdi

Looks like this still hasn't been updated/resolved. Attempts at using coolconfig force a container/pod restart that clears the changes anyway. I'm attempting to do this on TrueNAS within a Kubernetes pod.

johnmonarch avatar Feb 19 '24 21:02 johnmonarch

@johnmonarch Are you uploading fonts via Admin settings->Nextcloud Office? And are you using Built-in CODE?

https://github.com/nextcloud/richdocuments/issues/2763#issuecomment-1634599095

joshtrichards avatar Feb 26 '24 12:02 joshtrichards

@johnmonarch Are you uploading fonts via Admin settings->Nextcloud Office? And are you using Built-in CODE?

#2763 (comment)

Yes - and built in CODE. The fonts when editing in Nextcloud Office haven't updated despite being uploaded days ago.

johnmonarch avatar Feb 26 '24 18:02 johnmonarch

@johnmonarch. Interesting. I'd never even considered someone might try to run Built-in CODE in a k8s environment. You may want to consider a dedicated independent CODE deployment: https://sdk.collaboraonline.com/docs/installation/Kubernetes.html :-)

joshtrichards avatar Feb 26 '24 19:02 joshtrichards

@joshtrichards so this is the standard install for TrueNAS as an app. I had done it as a Collabora app in a separate container, but was a worse experience than just doing the built in CODE server. Neither one would allow for custom fonts to load due to coolwsd.xml not being updatable

johnmonarch avatar Feb 26 '24 20:02 johnmonarch

@johnmonarch and @siccovansas here is my solution: 1) copy your custom fonts to host machine 2) mount your fonts folder to docker container with target location: /usr/share/fonts/truetype 3)done. I've succeffuly solve this issue, load and edit office files in Chinese w/o any problems.

pop4ever avatar Jun 25 '24 14:06 pop4ever

Also having this issue with my Nextcloud instance using Docker Compose. I have gone into the collabora container and the remote_font_config does not seem to point at the instance by default.

cool@d392bb640557:/etc/coolwsd$ cat coolwsd.xml | grep remote_font_config -B 1 -A 1

    <remote_font_config>
        <url desc="URL of optional JSON file that lists fonts to be included in Online" type="string" default=""></url>
    </remote_font_config>

iamsilk avatar Jul 10 '24 11:07 iamsilk

@iamsilk This thread is about the Built-in CODE, not a standalone Docker-based CODE installation. Of course the standalone doesn't point at it. You have to configure it like it says on the setup screen. :)

joshtrichards avatar Jul 10 '24 14:07 joshtrichards

In 'Administration > Nextcloud Office > Extra Fonts' I’ve uploaded the fonts. This works fine. On that page it says:

Make sure to set this URL: https://<MY_URL>/apps/richdocuments/settings/fonts.json in the coolwsd.xml file of your Collabora Online server to ensure the added fonts get loaded automatically.

Related, which will make the setup less confusing for Built-in CODE users:

#3804 #3805

joshtrichards avatar Jul 10 '24 14:07 joshtrichards

@iamsilk This thread is about the Built-in CODE, not a standalone Docker-based CODE installation. Of course the standalone doesn't point at it. You have to configure it like it says on the setup screen. :)

Sorry I should've clarified: NextCloud AIO with Docker Compose. Either way, this probably isn't relevant to this repo and I should create an issue over there. Thank you!

iamsilk avatar Jul 10 '24 15:07 iamsilk