歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 字體設置:使用Windows 字體

Ubuntu 字體設置:使用Windows 字體

日期:2017/2/28 14:28:49   编辑:Linux教程

Ubuntu 字體設置:使用Windows 字體

基礎知識

Sans-serif=無襯線體=黑體:並不是具體一款字體,而是一類字體,選擇它其實等於選擇這類字體中優先級最高的那款字體。

Serif=襯線體=白體:同上

Monospace=等寬字體,意思是字符寬度相同:同上

點陣字體=位圖字體

無襯線體更適合電腦屏幕閱讀,襯線體適合打印。——因為襯線可以使得人視線平齊於一行。也就是說不會讀破行。

中文顯示時有不同的方式,一方面因為中文本身擁有的橫和同高度就可以導致這種平齊。行距對中文更重要。

1. 安裝字體

sudo apt-get install ttf-mscorefonts-installer #微軟字體
sudo apt-get install xfonts-wqy #文泉驿-點陣宋體
cd ~
wget http://www.stchman.com/tools/MS_fonts/tahoma.zip #Tahoma 字體
sudo unzip -d /usr/share/fonts/truetype/msttcorefonts ~/tahoma.zip
sudo fc-cache -f -v
rm -f ~/tahoma.zip
fc-cache -f -s -v #刷新字體緩存

2. 進入 “Advanced settings" 設置(如果沒有安裝,執行 sudo apt-get install gnome-tweak-tool)

如下設置:

3. 配置:

注意使用文泉驿的視覺習慣工具把網頁上的英文和中文字體都調整清晰, 點 Create, 按說明保存好。

本人調的是 Tahoma 第一位,wenquanyi bitmap 第二位, 這樣英文和中文都沒問題。

Linux字體

字體文件存放路徑

/usr/share/fonts/ #系統字體,需要root權限才能操作

~/.fonts #用戶字體,隨便怎麼搞,推薦

配置文件路徑

/etc/fonts/fonts.conf #系統配置文件,需要root權限才能操作,對需要輸入root密碼的程序有效

~/.fonts.conf #用戶配置文件,隨便怎麼搞,只對當前用戶運行的程序有效

命令

fc-cache -fv #通常復制字體進~/.fonts就會自動刷新字體,如果沒有,用這個命令,如果復制進的是/usr/share/fonts/,用sudo fc-cache -fv

fc-match sans-serif #抓取當前用戶sans-serif類字體優先級最高的那款字體

fc-match serif #抓取當前用戶serif類字體優先級最高的那款字體

fc-match monospace #抓取當前用戶monospace類字體優先級最高的那款字體

4. 上一步配置對 Firefox 和 Thunderbird 無效, 再設置 ~/.fonts.conf, 在 <fontconfig> 中加入:

<match target="font">
<edit mode="assign" name="autohint">
<bool>false</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hintstyle">
<const>hintfull</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="antialias">
<bool>false</bool>
</edit>
</match>
<!-- 大字體的時候啟用抗鋸齒 -->
<match target="font" >
<test name="size" qual="any" compare="more">
<double>12</double>
</test>
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
</match>
<match target="font" >
<test name="pixelsize" qual="any" compare="more">
<double>16</double>
</test>
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
</match>

5. 登出 或 重啟系統 就可看到完整的效果(由於圖片受到壓縮,請在圖片上點右鍵,在新窗口中查看)

更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2

Copyright © Linux教程網 All Rights Reserved