It works for me! I am adding new fonts to NextCloud Office ( Collabora Online - Built-in CODE Server ) as I found that it does not support Chinese characters originally.
My settings are: Ubuntu, Apache 2.4.52, MySQL 8.0, PHP 8.1 ( LAMP, non docker environment )
Here’s how i made it:
- Put fonts files in any path that are listed in /etc/fonts/fonts.conf (i.e. /usr/share/fonts/truetype by default)
- Run
fc-cache -f -v
- Supposingly, you should see some output like this:
/usr/share/fonts: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/truetype: caching, new cache contents: 0 fonts, 2 dirs
/usr/share/fonts/truetype/dfkai-sb: caching, new cache contents: 6 fonts, 0 dirs
/usr/share/fonts/truetype/dfkai-sb: caching, new cache contents: 1 fonts, 0 dirs
/usr/local/share/fonts: caching, new cache contents: 0 fonts, 0 dirs
/home//.local/share/fonts: skipping, no such directory
/home//.fonts: skipping, no such directory
/usr/share/fonts/truetype: skipping, looped directory detected
/usr/share/fonts/truetype/dejavu: skipping, looped directory detected
/usr/share/fonts/truetype/dfkai-sb: skipping, looped directory detected
/var/cache/fontconfig: not cleaning unwritable cache directory
/home//.cache/fontconfig: cleaning cache directory
/home//.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded
dfkai-sb is the font i added.
The above command do the caching job and shows the output.
- It is done.
- Back to the Nextcloud Office Editor ( Collabora Online - Built-in CODE Server ), you can see the font you added listed in the font selector. ( If not, try restart the apache service by
sudo systemctl reload apache
or evensudo systemctl restart apache
and reboot your server. For me, I cannot see it after these all because I am using Cloudflare, so after these, turn on Development Mode in Cloudflare (only if you are using Cloudflare caching) to see effects immediately. )
This should help those using Collabora with Nextcloud in LAMP environment.
空空如也!