作者s9209122222 (海海海)
看板Linux
標題[問題] Ubuntu 思源黑體設定問題
時間Fri Mar 18 12:13:46 2016
請問要怎麼讓全部的使用者都使用思源黑體呢?
我的字體是放在 /usr/share/fonts/noto/ 內
我只要在 /etc/fonts/conf.d/69-language-selector-zh-tw.conf 內加入 Noto Sans CJK TC,
在登入畫面的中文就會變成方框,但如果是在家目錄內的 .fonts.conf 就可以成功設定,
只是就變成只有單一使用者可以使用了。
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 122.117.207.31
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Linux/M.1458274429.A.007.html
1F:推 mmis1000: 字型檔的user是?有些軟體只要不是root:root就不會正確 03/18 12:15
2F:→ mmis1000: 運作 03/18 12:15
3F:推 Bencrie: 把你的 .fonts.conf 複製成 /etc/fonts/local.conf 03/18 12:48
4F:→ s9209122222: 照 mmis1000 說的把字體的 user 和 group 改成 root 03/18 13:24
5F:→ s9209122222: 結果會全變成框框 03/18 13:25
6F:→ s9209122222: 照 Bencrie 的做還是一樣只有我的使用者可以用耶, 03/18 13:25
7F:→ s9209122222: 其他全都變成方框 03/18 13:25
目前的狀況是:
| /usr/share/fonts/noto/* | /etc/fonts/local.conf | 結果
----------------------------------------------------------------------------
1. | user:root,group:root | user:root,group:root | 全部變成方框
2. | user:我,group:我 | user:root,group:root | 自己能用,其他都是方框
※ 編輯: s9209122222 (122.117.207.31), 03/18/2016 13:36:45
8F:推 acidjazz: 其它使用者的home也各放一份conf? 03/18 14:01
9F:推 Bencrie: 你有改 sans-serif 的 fallback 清單? 03/18 14:08
我照您說的把原本的 .conf/fontconfig/fonts.conf 給移動到 /etc/fonts/local.conf
以下是我 /etc/fonts/local.conf 的內容:
<fontconfig>
<match target="pattern">
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans CJK TC</string>
<string>Noto Sans CJK SC</string>
<string>Noto Sans CJK JP</string>
<string>Noto Sans CJK KR</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans CJK TC</string>
<string>Noto Sans CJK SC</string>
<string>Noto Sans CJK JP</string>
<string>Noto Sans CJK KR</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans CJK TC</string>
<string>Noto Sans CJK SC</string>
<string>Noto Sans CJK JP</string>
<string>Noto Sans CJK KR</string>
</edit>
</match>
<match target="font">
<edit name="hinting" mode="assign">
<bool>false</bool>
</edit>
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintnone</const>
</edit>
</match>
</fontconfig>
※ 編輯: s9209122222 (122.117.207.31), 03/18/2016 14:17:27
10F:推 Bencrie: prepend 改成 append 看看 03/18 14:25
11F:→ Bencrie: 或者用 fc-match -a sans-serif 檢查看看結果 03/18 14:27
12F:→ s9209122222: 那個是什麼? 03/18 14:28
fc-match -a sans-serif|grep "Noto Sans CJK TC" 後的結果:
NotoSansCJKtc-Medium.otf: "Noto Sans CJK TC" "Medium"
NotoSansCJKtc-DemiLight.otf: "Noto Sans CJK TC" "DemiLight"
NotoSansCJKtc-Regular.otf: "Noto Sans CJK TC" "Regular"
NotoSansCJKtc-Light.otf: "Noto Sans CJK TC" "Light"
NotoSansCJKtc-Thin.otf: "Noto Sans CJK TC" "Thin"
NotoSansCJKtc-Bold.otf: "Noto Sans CJK TC" "Bold"
NotoSansCJKtc-Black.otf: "Noto Sans CJK TC" "Black"
※ 編輯: s9209122222 (122.117.207.31), 03/18/2016 14:35:06
13F:推 Bencrie: 呃 ... 你這樣 grep 有意義嗎 orz 03/18 14:40
14F:→ Bencrie: fc-match 查取 glyph 的優先順序 03/18 14:41
15F:→ s9209122222: 請問那是?我剛剛看了一下全部,最開頭是這幾個 03/18 14:51
16F:→ s9209122222: 還是說這是 Ubuntu 的 BUG? 03/18 15:05
17F:推 Bencrie: 不然就找看看 fonts.conf 到底有沒有 include local.conf 03/18 15:14
18F:→ s9209122222: 抱歉,我耍笨了,我字體權限是 640,調到 644 就好了 03/18 15:16
19F:→ obarisk: package裡就有noto cjk了,不用自己裝了 03/18 19:37
20F:→ obarisk: 要套用就動一下69 zh tw 03/18 19:38
21F:→ s9209122222: 試用了 69 zh tw 那個之後發現有些字體不會套用思源 03/18 21:52
22F:→ s9209122222: 黑體,譬如 Firefox 某些網頁的聊天室 03/18 21:52
23F:→ s9209122222: 還是要用 local.conf 來解決 03/18 21:53
24F:→ s9209122222: Ubuntu 官方的 noto cjk 好像很舊? 03/18 21:54
25F:→ obarisk: 沒有套的應該有更後面的設定檔,比如99 03/19 13:45
26F:→ obarisk: 新版本好像主要差在粗細 03/19 13:46
27F:→ s9209122222: 如果和 openSUSE 他們用的版本一樣的話,那我看到的 03/19 13:54
28F:→ s9209122222: 差別是舊版在有些字的顯示上有問題,譬如部首的手部 03/19 13:56
29F:→ s9209122222: 在左邊的末端會拖一長條下來,但自己裝的不會有這種 03/19 13:56
30F:→ s9209122222: 裝況 03/19 13:56