让思源宋体成为默认的宋体,各位老师看看这样对不

系统字体配置、中文显示和输入法问题
回复
头像
NetDreamer
帖子: 858
注册时间: 2007-10-19 20:40
联系:

让思源宋体成为默认的宋体,各位老师看看这样对不

#1

帖子 NetDreamer » 2017-04-16 18:09

1、参考这个帖子viewtopic.php?f=8&t=483447下载思源宋体;
2、将字体文件放在 ~/.fonts 目录;
3、在 ~/.config/fontconfig 目录中,新建 fonts.conf 文件,内容如下:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

<match target="pattern">
<test qual="any" name="family"><string>宋体</string></test>
<edit name="family" mode="assign" binding="same"><string>Source Han Serif CN</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>SimSun</string></test>
<edit name="family" mode="assign" binding="same"><string>Source Han Serif CN</string></edit>
</match>
</fontconfig>
4、将浏览器的 Serif 字体指定为思源宋体。
2017-04-16 18-08-33屏幕截图.png
2017-04-16 18-08-33屏幕截图.png (61.95 KiB) 查看 4365 次
2017-04-16 20-08-23屏幕截图.png
2017-04-16 20-20-01屏幕截图.png
上次由 NetDreamer 在 2017-04-16 20:21,总共编辑 2 次。
Live and let live.
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 让思源宋体成为默认的宋体,各位老师看看这样对不

#2

帖子 poloshiao » 2017-04-16 18:59

把下面指令 複製 貼進終端機 執行
1. sudo cat /etc/fonts/conf.avail/69-language-selector-zh-cn.conf
2. sudo ls -al /etc/fonts/conf.d | grep 69-language-selector-zh-cn.conf
把結果全部直接 選取/複製/貼上來
头像
NetDreamer
帖子: 858
注册时间: 2007-10-19 20:40
联系:

Re: 让思源宋体成为默认的宋体,各位老师看看这样对不

#3

帖子 NetDreamer » 2017-04-16 19:03

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

<match target="pattern">
<test name="lang">
<string>zh-cn</string>
</test>
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>HYSong</string>
<string>AR PL UMing CN</string>
<string>AR PL UMing HK</string>
<string>AR PL New Sung</string>
<string>WenQuanYi Bitmap Song</string>
<string>AR PL UKai CN</string>
<string>AR PL ZenKai Uni</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<test name="lang">
<string>zh-cn</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans CJK SC</string>
<string>WenQuanYi Zen Hei</string>
<string>HYSong</string>
<string>AR PL UMing CN</string>
<string>AR PL UMing HK</string>
<string>AR PL New Sung</string>
<string>AR PL UKai CN</string>
<string>AR PL ZenKai Uni</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>monospace</string>
</test>
<test name="lang">
<string>zh-cn</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>DejaVu Sans Mono</string>
<string>Noto Sans Mono CJK SC</string>
<string>WenQuanYi Zen Hei Mono</string>
<string>HYSong</string>
<string>AR PL UMing CN</string>
<string>AR PL UMing HK</string>
<string>AR PL New Sung</string>
<string>AR PL UKai CN</string>
<string>AR PL ZenKai Uni</string>
</edit>
</match>

</fontconfig>
lrwxrwxrwx 1 root root 45 3月 12 04:43 69-language-selector-zh-cn.conf -> ../conf.avail/69-language-selector-zh-cn.conf
Live and let live.
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 让思源宋体成为默认的宋体,各位老师看看这样对不

#4

帖子 poloshiao » 2017-04-16 19:50

<edit name="family" mode="assign" binding="same"><string>Source Han Serif CN</string></edit>
</match>
将浏览器的 Serif 字体指定为思源宋体。
1. 如果你想將全系統的 Serif 中文字体指定为思源宋体

代码: 全选

gksudo gedit /etc/fonts/conf.avail/69-language-selector-zh-cn.conf
找到
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>HYSong</string>
把 <string>Source Han Serif CN</string>
加在
<string>HYSong</string>
的上方 (即 排行第一)

2. 重開機 試試

3. 補充 gksudo gedit 參閱
viewtopic.php?p=3189006#p3189006

4. 如果 全系統設定 成功 瀏覽器 或 個別程式 也可以選擇 系統設定 即可
头像
NetDreamer
帖子: 858
注册时间: 2007-10-19 20:40
联系:

Re: 让思源宋体成为默认的宋体,各位老师看看这样对不

#5

帖子 NetDreamer » 2017-04-16 20:01

HYSong 是不是指的 AR PL Uming 啊?
Live and let live.
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 让思源宋体成为默认的宋体,各位老师看看这样对不

#6

帖子 poloshiao » 2017-04-16 20:34

HYSong 是不是指的 AR PL Uming 啊?
/etc/fonts/conf.avail/69-language-selector-zh-cn.conf
<string>HYSong</string>
<string>AR PL UMing CN</string>
應該不是
否則這裡就不必分開列兩項了
如果有懷疑 再查證一下
头像
TeliuTe
论坛版主
帖子: 7668
注册时间: 2007-11-25 13:29
系统: 16/18/20/w7
来自: 新疆博乐
联系:

Re: 让思源宋体成为默认的宋体,各位老师看看这样对不

#7

帖子 TeliuTe » 2017-04-17 1:47

学习一下,标记备用
dddp
帖子: 27
注册时间: 2008-12-10 13:37

Re: 让思源宋体成为默认的宋体,各位老师看看这样对不

#8

帖子 dddp » 2017-04-20 13:13

老师们你们在干什么看不懂啊

将字体文件放在 ~/.local/share/fonts 目录;
cd ~/.local/share/fonts
sudo fc-cache -fsv
不就搞定了么?
你们设置的天书看不懂啊!
你们做法 和我的效果有什么区别
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 让思源宋体成为默认的宋体,各位老师看看这样对不

#9

帖子 poloshiao » 2017-04-20 18:27

将字体文件放在 ~/.local/share/fonts 目录;
cd ~/.local/share/fonts
sudo fc-cache -fsv
http://manpages.ubuntu.com/manpages/xen ... che.1.html
fc-cache - build font information cache files
-s Only scan system-wide directories, omitting the places located in the user's home directory.

加了 -s 參數
跳過 ~/.local
只掃描 system-wide 目錄
意思是 你放在 ~/.local 的字型 或 設定
沒列入

建議
試試
sudo fc-cache -fv

重新登出再登入

重新開機
看看 有何不同
回复