1.从Windows下获取四种基本字体的字体文件(文件名类似于 simsun.ttc
)并复制到 /usr/share/fonts/winfonts/
目录下
2.下载脚本 cjk-gs-integrate.pl
3.cjk-gs-integrate.pl
脚本的执行依赖于命令 kpsewhich
,该命令由 TeXLive 提供。执行 kpsewhich --version
检查 kpsewhich
这个命令是否存在。若不存在,则需要单独安装。
对于Ubuntu/Debian用户,执行:
sudo apt install texlive-binaries
执行脚本
GMT的中文支持
在 ~/.gmt
(若无该文件夹,请自行新建)下创建字体配置文件:
touch ~/.gmt/PSL_custom_fonts.txt
gedit ~/.gmt/PSL_custom_fonts.txt
打开 GMT 字体配置文件,在文件中加入如下语句
STSong-Light--UniGB-UTF8-H 0.700 1
STFangsong-Light--UniGB-UTF8-H 0.700 1
STHeiti-Regular--UniGB-UTF8-H 0.700 1
STKaiti-Regular--UniGB-UTF8-H 0.700 1
STSong-Light--UniGB-UTF8-V 0.700 1
STFangsong-Light--UniGB-UTF8-V 0.700 1
STHeiti-Regular--UniGB-UTF8-V 0.700 1
STKaiti-Regular--UniGB-UTF8-V 0.700 1
这几句话分别添加了宋体、仿宋、黑体和楷体四种字体的横排和竖排两种方式。
用 gmt text -L
命令查看 GMT 当前的字体配置:
gmt text -L
0 Helvetica
1 Helvetica-Bold
... ......
39 STSong-Light--UniGB-UTF8-H
40 STFangsong-Light--UniGB-UTF8-H
41 STHeiti-Regular--UniGB-UTF8-H
42 STKaiti-Regular--UniGB-UTF8-H
43 STSong-Light--UniGB-UTF8-V
44 STFangsong-Light--UniGB-UTF8-V
45 STHeiti-Regular--UniGB-UTF8-V
46 STKaiti-Regular--UniGB-UTF8-V