基于自编译的onlyoffice镜像,关于修改字体的问题
自编译onlyoffice镜像来自于 https://blog.csdn.net/Gemini1995/article/details/132427908
-
该镜像里面没有documentserver-generate-allfonts.sh文件,所以需要自己创建一个(建议放在/usr/bin下面),内容贴在下面
#!/bin/sh
ONLYOFFICE_DATA_CONTAINER=false
if [ "$1" != "" ]; then
ONLYOFFICE_DATA_CONTAINER=$1
fiDIR="/out/linux_64/onlyoffice/documentserver"
#Start generate AllFonts.js, font thumbnails and font_selection.bin
echo -n Generating AllFonts.js, please wait..."DIR/server/tools/allfontsgen"\ --allfonts-web="DIR/sdkjs/common/AllFonts.js"
--allfonts="DIR/server/FileConverter/bin/AllFonts.js"\ --images="DIR/sdkjs/common/Images"
--selection="DIR/server/FileConverter/bin/font_selection.bin"\ --output-web="DIR/fonts"
--use-system="true"echo Done
echo -n Generating presentation themes, please wait...
"DIR/server/tools/allthemesgen"\ --converter-dir="DIR/server/FileConverter/bin"
--src="DIR/sdkjs/slide/themes"\ --output="DIR/sdkjs/common/Images""DIR/server/tools/allthemesgen"\ --converter-dir="DIR/server/FileConverter/bin"
--src="DIR/sdkjs/slide/themes"\ --output="DIR/sdkjs/common/Images"
--postfix="ios"
--params="280,224""DIR/server/tools/allthemesgen"\ --converter-dir="DIR/server/FileConverter/bin"
--src="DIR/sdkjs/slide/themes"\ --output="DIR/sdkjs/common/Images"
--postfix="android"
--params="280,224"echo Done
echo -n Generating js caches, please wait...
"$DIR/server/FileConverter/bin/x2t" -create-js-cacheecho Done
Setting user rights for files created in the previous steps
chown -R root:root "DIR/sdkjs" chown -R root:root "DIR/server/FileConverter/bin"
chown -R root:root "$DIR/fonts"#Remove gzipped files
rm -f
$DIR/fonts/*.gz
$DIR/sdkjs/common/AllFonts.js.gz
$DIR/sdkjs/slide/themes/themes.js.gz#Restart web-site and converter
if [ "$ONLYOFFICE_DATA_CONTAINER" != "true" ]; then
if pgrep -x ""systemd"" >/dev/null; then
systemctl restart ds-docservice
systemctl restart ds-converter
elif pgrep -x ""supervisord"" >/dev/null; then
supervisorctl restart docservice
supervisorctl restart converter
fi
fi
然后用 cp 命令把该文件传到容器里面去
注意:直接贴过去可能会遇到 sh文件无法执行的问题,主要是因为 windows和 linux 的编码问题,使用 set ff=unix
就可以搞定了
该解决方案参考的是
https://www.cnblogs.com/tester-yu/p/17503243.html
- 再次运行后会遇到找不到
libicuuc.so.58
的问题,解决方案如下
执行
vim /etc/ld.so.conf.d/libc.conf
然后在下面加一行
/out/linux_64/onlyoffice/documentserver/server/FileConverter/bin
加上后保存退出,并执行以下命令
/sbin/ldconfig -v
该解决方案参考的是
https://blog.csdn.net/weixin_42310458/article/details/125180410
最后就可以执行
/usr/bin/documentserver-generate-allfonts.sh
了
最后再注意!
字体放在 /out/linux_64/onlyoffice/documentserver/fonts/
下字体不会生效,得放在 /usr/share/fonts/
下面才行