温馨提示×

centos liboffice字体如何装

小樊
51
2026-09-24 14:08:23
栏目: 智能运维

在 CentOS 上给 LibreOffice 安装/配置字体,通常就是给 系统 安装字体(LibreOffice 会使用系统字体)。下面按常见场景说明。


一、系统级安装字体(最常用)

1. 准备字体文件

常见字体格式:

  • .ttf(TrueType)
  • .otf(OpenType)

例如:simsun.ttf、msyh.ttf


2. 创建字体目录(可选但推荐)

sudo mkdir -p /usr/share/fonts/custom

3. 拷贝字体文件

sudo cp *.ttf /usr/share/fonts/custom/
sudo cp *.otf /usr/share/fonts/custom/

4. 修改权限

sudo chmod 644 /usr/share/fonts/custom/*

5. 更新字体缓存

sudo fc-cache -fv

6. 验证字体

fc-list | grep 字体名

例如:

fc-list : family | grep -i simsun

二、只给当前用户安装字体(无需 root)

mkdir -p ~/.fonts
cp *.ttf ~/.fonts/
fc-cache -fv

三、LibreOffice 中生效

安装完字体后:

  1. 关闭 LibreOffice
  2. 重新打开 LibreOffice
  3. 在 格式 → 字体 中即可看到新字体

若仍不显示,可重启系统或重新登录会话。


四、常见中文字体推荐(Windows 迁移)

  • 宋体 simsun.ttf
  • 微软雅黑 msyh.ttf
  • 黑体 simhei.ttf
  • 楷体 simkai.ttf

⚠️ 注意:Windows 字体有版权,仅限合规使用。


五、安装开源中文字体(推荐)

如果不想用 Windows 字体:

CentOS 7

sudo yum install -y wqy-microhei wqy-zenhei

CentOS 8 / Stream

sudo dnf install -y wqy-microhei wqy-zenhei

然后:

fc-cache -fv

六、排查问题

查看字体路径

fc-match

LibreOffice 不识别字体

  • 确保字体权限不是 700
  • 确保字体未损坏
  • 用 fc-list 能列出但 LibreOffice 没有,重启 LibreOffice

如果你愿意,可以告诉我:

  • CentOS 版本(7 / 8 / Stream)
  • 是否需要 中文字体
  • 字体来源(Windows / 开源 / 公司字体)

我可以给你更精确的命令。

0 踩