nextcloud / richdocuments

📑 Collabora Online for Nextcloud
https://nextcloud.com/collaboraonline
349 stars 115 forks source link

Custom fonts for built-in Nextcloud Office #2763

Open siccovansas opened 1 year ago

siccovansas commented 1 year ago

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:///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:

yeeahnick commented 1 year ago

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

derBobby commented 1 year ago

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 commented 1 year ago

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
arsw1 commented 1 year ago

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

bepstein111 commented 1 year ago

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

joshtrichards commented 1 year ago

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 commented 1 year ago

This looks helpful:

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

siccovansas commented 1 year ago

@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?

joshtrichards commented 11 months ago

@siccovansas

Some things to check:

siccovansas commented 11 months ago

Thanks for looking into this @joshtrichards :pray:!

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?

gudaoxongdi commented 8 months ago

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

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

我也是,不能显示中文,

johnmonarch commented 7 months ago

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.

joshtrichards commented 7 months ago

@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 commented 7 months ago

@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.

joshtrichards commented 7 months 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 :-)

johnmonarch commented 7 months ago

@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

pop4ever commented 3 months ago

@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.

iamsilk commented 2 months ago

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>
joshtrichards commented 2 months ago

@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 commented 2 months ago

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:///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 commented 2 months ago

@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!