在 CentOS 上给 LibreOffice 安装/配置字体,通常就是给 系统 安装字体(LibreOffice 会使用系统字体)。下面按常见场景说明。
常见字体格式:
.ttf(TrueType).otf(OpenType)例如:simsun.ttf、msyh.ttf
sudo mkdir -p /usr/share/fonts/custom
sudo cp *.ttf /usr/share/fonts/custom/
sudo cp *.otf /usr/share/fonts/custom/
sudo chmod 644 /usr/share/fonts/custom/*
sudo fc-cache -fv
fc-list | grep 字体名
例如:
fc-list : family | grep -i simsun
mkdir -p ~/.fonts
cp *.ttf ~/.fonts/
fc-cache -fv
安装完字体后:
若仍不显示,可重启系统或重新登录会话。
simsun.ttfmsyh.ttfsimhei.ttfsimkai.ttf⚠️ 注意:Windows 字体有版权,仅限合规使用。
如果不想用 Windows 字体:
sudo yum install -y wqy-microhei wqy-zenhei
sudo dnf install -y wqy-microhei wqy-zenhei
然后:
fc-cache -fv
fc-match
700fc-list 能列出但 LibreOffice 没有,重启 LibreOffice如果你愿意,可以告诉我:
我可以给你更精确的命令。