Linux系统字体文件配置
配置文件
/etc/fonts/fonts.conf/etc/fonts/fonts.dtd/etc/fonts/conf.d$XDG_CONFIG_HOME/fontconfig/conf.d$XDG_CONFIG_HOME/fontconfig/fonts.conf~/.fonts.conf.d~/.fonts.conffonts.conf -- Font configuration files
默认字体搜索目录
<!-- Font directory list --><dir>/usr/share/fonts</dir><dir>/usr/share/X11/fonts/Type1</dir> <dir>/usr/share/X11/fonts/TTF</dir> <dir>/usr/local/share/fonts</dir><dir prefix="xdg">fonts</dir><!-- the following element will be removed in the future --><dir>~/.fonts</dir>
新增字体文件
对于root用户,可直接把字体文件放到上述目录中,如/usr/share/fonts
对于非root用户,可放到~/.fonts目录(仅自己可用)
为了使其他人也可以使用,可以通过配置环境变量XDG_CONFIG_HOME,然后编辑配置文件$XDG_CONFIG_HOME/fontconfig/fonts.conf,再添加一个共用目录作为字体搜索目录
<!-- Font directory list --><dir>/path/to/a/public/fonts</dir>...
常用命令
fc-list
查看字体列表
fc-cache
更新缓存
