Linux字体管理

安装字体

以安装微软雅黑为例

添加 ttf 文件。

1
2
3
4
cd /usr/share/fonts
sudo mkdir /usr/share/fonts/yahei
sudo cp <file> /usr/share/fonts/yahei/
sudo chmod 644 /usr/share/fonts/yahei/*.ttf
1
2
3
mkfontscale
mkfontdir
fc-cache -fv # 没有的话安装一个

wsl 安装 win 字体

1
2
sudo ln -s /mnt/c/Windows/Fonts /usr/share/fonts/font
fc-cache -fv