一、增加字体
准备字体(ttf格式),使用renamer重命名为非中文。
删除原版自带字体(可选)
进入容器:docker exec -it onlyoffice bash
cd /usr/share/fonts/
rm -rf *
cd /var/www/onlyoffice/documentserver/core-fonts/
rm -rf *
注:如果删除出错就直接去宝塔文件删除
复制字体到onlyOffice中
打开docker目录,找到
/usr/share/fonts/
将之前准备好的ttf字体上传到该文件夹
ssh进入docker
docker exec -it onlyoffice bash
更改目录
/usr/bin
执行
documentserver-generate-allfonts.sh
完成以后,先重启docker容器,再重启系统,最后手动清空浏览器缓存,重新加载
注:如果需要将onlyoffice站点进行域名访问,则进行反向代理。反向代理时候需要配置缓存,并且设置缓存时间为0分钟。
不确定部分:
不确定需不需要将准备安装到onlyoffice的字体,提前安装到系统中。如果需要,步骤如下:
复制字体到系统的fonts文件夹:
/usr/share/fonts
更新字体缓存(这将扫描指定目录下的字体文件并更新字体缓存):
sudo fc-cache -fv /usr/share/fonts
验证字体安装:
使用fc-list
命令查看系统中已经安装的字体。这个命令会列出所有已安装的字体。如果要查看已经安装的中文字体,可以使用fc-list :lang=zh
命令
二、设置不同文档的打开类型
docker目录下修改配置文件default.json,配置文件路径:
etc/onlyoffice/documentserver
打开配置文件,找到
"wopi": { "enable": true, "host" : "https://onlyoffice.quanquan.site", "htmlTemplate" : "../../web-apps/apps/api/wopi", "wopiZone" : "external-http", "favIconUrlWord" : "/web-apps/apps/documenteditor/main/resources/img/favicon.ico", "favIconUrlCell" : "/web-apps/apps/spreadsheeteditor/main/resources/img/favicon.ico", "favIconUrlSlide" : "/web-apps/apps/presentationeditor/main/resources/img/favicon.ico", "fileInfoBlockList" : ["FileUrl"], "pdfView": ["pdf", "djvu", "xps", "oxps"], "wordView": [], "wordEdit": ["docx", "docm", "docxf", "oform", "odt", "doc", "dotx", "dotm", "dot", "fodt", "ott", "rtf", "mht", "mhtml", "epub", "fb2", "sxw", "stw", "wps", "wpt"], "cellView": [], "cellEdit": ["xlsx", "xlsm", "ods", "csv", "xls", "xlsb", "xltx", "xltm", "xlt", "fods", "ots", "sxc", "et", "ett"], "slideView": [], "slideEdit": ["pptx", "pptm", "odp" , "ppt" ,"ppsx", "ppsm", "pps", "potx", "potm", "pot", "fodp", "otp", "sxi", "dps", "dpt"], …………
修改相应部分后先重启docker,再重启系统(必须)。
注:此种情况是通过wopi进行访问的,所以需要再cloudreve里面取消掉服务地址,再开启wopi。
https://onlyoffice.quanquan.site/hosting/discovery