FreeBSD/Linux的中文字型美化__Linux

來源:互聯網
上載者:User
網上太多此類的文章了,且記下自己用的方法,以備日後參考。

首先當然是要挖出Windows中所使用的TrueType字型了,列表如下:

courbd.ttf
courbi.ttf
couri.ttf
cour.ttf
simsun.ttf  <-- 宋體,原本為simsun.ttc,請修改副檔名為ttf
tahomabd.ttf
tahoma.ttf
verdanab.ttf
verdanai.ttf
verdana.ttf


將上面這些檔案放到這裡:

[root@redhat /tmp] # cd /usr/share/fonts
[root@redhat /usr/share/fonts] # mkdir local
[root@redhat /usr/share/fonts] # cd local
[root@redhat /usr/share/fonts/local] # cp /tmp/*.ttf ./


重新整理字型緩衝:

[root@redhat /usr/share/fonts/local] # fc-cache -fv
fc-cache: "/usr/share/fonts": caching, 0 fonts, 6 dirs
fc-cache: "/usr/share/fonts/bitmap-fonts": caching, 32 fonts, 0 dirs
fc-cache: "/usr/share/fonts/zh_TW": caching, 0 fonts, 1 dirs
fc-cache: "/usr/share/fonts/zh_TW/TrueType": caching, 2 fonts, 0 dirs
fc-cache: "/usr/share/fonts/local": caching, 11 fonts, 0 dirs
fc-cache: "/usr/share/fonts/default": caching, 0 fonts, 2 dirs
fc-cache: "/usr/share/fonts/default/ghostscript": caching, 8 fonts, 0 dirs
fc-cache: "/usr/share/fonts/default/Type1": caching, 35 fonts, 0 dirs
fc-cache: "/usr/share/fonts/zh_CN": caching, 0 fonts, 1 dirs
fc-cache: "/usr/share/fonts/zh_CN/TrueType": caching, 3 fonts, 0 dirs
fc-cache: "/usr/share/fonts/bitstream-vera": caching, 10 fonts, 0 dirs
fc-cache: "/usr/X11R6/lib/X11/fonts/Type1": caching, 29 fonts, 0 dirs
fc-cache: "/usr/X11R6/lib/X11/fonts/OTF": caching, 0 fonts, 0 dirs
fc-cache: "/root/.fonts": skipping, no such directory
fc-cache: succeeded


產生fonts.dir和fonts.scale檔案:

[root@redhat /usr/share/fonts/local] # ttmkfdir -d ./ -o fonts.dir
[root@redhat /usr/share/fonts/local] # vi fonts.dir


記著把fonts.dir複製一份,並更名為fonts.scale

接下來我們需要修改/etc/fonts/local.conf來調整中英文顯示的優先順序:

[root@redhat /etc/fonts] # vi local.conf


內容如下:


<fontconfig>

<!--//
===============================
Linux Dist: Ubuntu 7.04 Feisty
===============================
fontconfig: 2.4.2-1ubuntu1
freetype: 2.2.1-5ubuntu1.1
libxft: 2.1.12-1
xorg: 7.2-0ubuntu11
==============================
file: ~/.fonts.conf
version: 20070606 final
//-->

<!--// 對字型簇中的字型進行重新排序 //-->
<alias>
<family>serif</family>
<prefer>
<family>Bitstream Vera Serif</family>
<family>DejaVu Serif</family>
<family>SimSun</family>
<family>MingLiu</family>
<family>WenQuanYi Bitmap Song</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Tahoma</family>
<family>Bitstream Vera Sans</family>
<family>DejaVu Sans</family>
<family>SimSun</family>
<family>MingLiu</family>
<family>WenQuanYi Bitmap Song</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Bitstream Vera Sans Mono</family>
<family>DejaVu Sans Mono</family>
<family>SimSun</family>
<family>MingLiu</family>
<family>WenQuanYi Bitmap Song</family>
</prefer>
</alias>

<!--// 字型別名的設定-01 //-->
<!--// 這段的設定測試的時候發現並沒有起作用,但還是留著,作為01部分。 //-->
<alias>
<family>SimSun</family>
<accept><family>宋體</family></accept>
</alias>
<alias>
<family>NSimSun</family>
<accept><family>新宋體</family></accept>
</alias>
<alias>
<family>SimHei</family>
<accept><family>黑體</family></accept>
</alias>
<alias>
<family>Microsoft YaHei</family>
<accept><family>微軟雅黑</family></accept>
</alias>
<alias>
<family>FangSong_GB2312</family>
<accept>
<family>仿宋</family>
<family>仿宋_GB2312</family>
</accept>
</alias>
<alias>
<family>KaiTi_GB2312</family>
<accept>
<family>楷體</family>
<family>楷體_GB2312</family>
</accept>
</alias>
<alias>
<family>YouYuan</family>
<accept><family>幼圓</family></accept>
</alias>
<alias>
<family>MingLiU</family>
<accept><family>細明體</family></accept>
</alias>
<alias>
<family>PMingLiU</family>
<accept><family>新細明體</
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.