richdocuments
richdocuments copied to clipboard
Custom fonts for built-in Nextcloud Office
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 indocker-compose.yml
- Automatically configure
coolwsd.xml
with the URL (that seems to make te most sense for the built-in version right?)
Same issue here. Also cant find the coolwsd.xml file anywhere.
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.
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
Same issue here. Also cant find the coolwsd.xml file anywhere.
Same here. Would be nice if someone had checked if that advice actually worked before putting it there....
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.
This looks helpful:
https://github.com/CollaboraOnline/richdocumentscode/commit/c685719bec4bd5adf6d464abd3cc86ac87f349f3
@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
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 externalhttps://
URL -- the front-end of their proxy -- is accessible from their app container...) - Waiting >1 minute for the font config refresh to kick in
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 usingcurl
). - 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:
But when I open the font selection menu, the font is still not shown:
So it seems that the font is technically available but (only?) not shown in the font selection menu?
最新的 25.0.3 docker 映像中不存在任何指定文件(fonts.json、coolwsd.xml)。 据我了解,coolwsd 是一个为独立安装运行的附加工具/包。
所以我猜内置解决方案有一些解决方法,但找不到文档。
我也是,不能显示中文,
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 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
@johnmonarch Are you uploading fonts via Admin settings->Nextcloud Office? And are you using Built-in CODE?
Yes - and built in CODE. The fonts when editing in Nextcloud Office haven't updated despite being uploaded days ago.
@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 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 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.
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 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. :)
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
@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!