顯示具有 ubuntu 標籤的文章。 顯示所有文章
顯示具有 ubuntu 標籤的文章。 顯示所有文章

星期一, 6月 04, 2007

換上了 opendesktop-fonts 及 DejaVu

幾年來一直沿用2004年的字型設定, 除了因為自己懶外, 也是沒有需要。Gentoo 由 2005.0 > 2005.1 > 2006.0 > 2006.1 > 2007.0 的升級都沒有出現過什么意外, 也就不會去去動那些設定檔。這段時間看到了 DejaVu fontsopendesktop-fonts 字型的相繼推出, 才想到也是時候更新一下了。

現在的 fontconfig 多了兩目錄以增加設定的彈性, 見 /etc/fonts :
conf.d {啟用的設定檔}
conf.avail {全部可用的設定檔}

其中 conf.d 的內容多是 conf.avail 的 soft link, 連結了就代表啟用, 刪掉了連結就是停用, 方便吧 ?! 更多關於 conf.d 設定檔的說明可以查看 /etc/fonts/conf.avail/README

conf.d/README

Each file in this directory is a fontconfig configuration file. Fontconfig
scans this directory, loading all files of the form [0-9][0-9]*. These files
are normally installed in ../conf.avail and then symlinked here, allowing
them to be easily installed and then enabled/disabled by adjusting the
symlinks.

The files are loaded in numeric order, the structure of the configuration
has led to the following conventions in usage:

Files begining with: Contain:

00 through 09 Font directories
10 through 19 system rendering defaults (AA, etc)
10-autohint.conf
10-no-sub-pixel.conf
10-sub-pixel-bgr.conf
10-sub-pixel-rgb.conf
10-sub-pixel-vbgr.conf
10-sub-pixel-vrgb.conf
10-unhinted.conf
20 through 29 font rendering options
20-fix-globaladvance.conf
20-lohit-gujarati.conf
20-unhint-small-vera.conf
30 through 39 family substitution
30-urw-aliases.conf
30-amt-aliases.conf
40 through 49 generic identification, map family->generic
40-generic-id.conf
49-sansserif.conf
50 through 59 alternate config file loading
50-user.conf Load ~/.fonts.conf
51-local.conf Load local.conf
60 through 69 generic aliases
60-latin.conf
65-fonts-persian.conf
65-nonlatin.conf
69-unifont.conf
70 through 79 select font (adjust which fonts are available)
70-no-bitmaps.conf
70-yes-bitmaps.conf
80 through 89 match target="scan" (modify scanned patterns)
80-delicious.conf
90 through 98 font synthesis
90-synthetic.conf


從 50-user.conf 及 51-local.conf 的說明得知, 固有的 ~/.fonts.conf 及 /etc/fonts/local.conf 設定檔還是有效的, 所以我 2004 年的那個設定檔也一直有效, Linux 真的很可愛呢 :)

新的設定 "借用" 了 ubuntu 的設定檔, 所以很快便完成了更新。下面貼上我的 local.conf 內容, 留意套用前需確保安裝了以下字型 :
opendesktop-fonts
arphic-uming
wqy-bitmapfont
DejaVu fonts

<fontconfig>
<alias>
<family>MingLiU</family>
<accept><family>AR PL New Sung</family></accept>

</alias>
<alias>
<family>細明體</family>
<accept><family>AR PL New Sung</family></accept>

</alias>
<alias>
<family>PMingLiU</family>
<accept><family>AR PL New Sung</family></accept>

</alias>
<alias>
<family>新細明體</family>
<accept><family>AR PL New Sung</family></accept>

</alias>
<alias>
<family>SimSun</family>
<accept><family>WenQuanYi Bitmap Song</family></accept>

</alias>
<alias>
<family>宋体</family>
<accept><family>WenQuanYi Bitmap Song</family></accept>

</alias>
<alias>
<family>標楷體</family>
<accept><family>AR PL ZenKai Uni</family></accept>

</alias>

<alias>
<family>serif</family>
<prefer>
<family>DejaVu Serif</family>

<family>Bitstream Vera Serif</family>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
<family>WenQuanYi Bitmap Song</family>

<family>AR PL ZenKai Uni</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>

<prefer>
<family>DejaVu Sans</family>
<family>Bitstream Vera Sans</family>
<family>AR PL New Sung</family>

<family>AR PL ShanHeiSun Uni</family>
<family>WenQuanYi Bitmap Song</family>
<family>AR PL ZenKai Uni</family>
</prefer>

</alias>
<alias>
<family>monospace</family>
<prefer>
<family>DejaVu Sans Mono</family>

<family>Bitstream Vera Sans Mono</family>
<family>AR PL New Sung Mono</family>
<family>AR PL ShanHeiSun Uni</family>
<family>WenQuanYi Bitmap Song</family>

<family>AR PL ZenKai Uni</family>
</prefer>
</alias>

<match target="font" >
<test name="family" compare="contains" >

<string>Song</string>
<string>Sun</string>
<string>Kai</string>
<string>Ming</string>

</test>
<!-- check to see if the font is just regular -->
<test name="weight" compare="less_eq">
<int>100</int>
</test>
<test compare="more_eq" target="pattern" name="weight" >

<int>180</int>
</test>
<edit mode="assign" name="embolden" >
<bool>true</bool>
</edit>

</match>

<match target="font" >
<test name="family" compare="contains" >
<string>Song</string>
<string>Sun</string>

<string>Ming</string>
</test>
<edit name="globaladvance">
<bool>false</bool>
</edit>

<edit name="spacing">
<int>0</int>
</edit>
<edit name="hinting">
<bool>true</bool>

</edit>
<edit name="autohint">
<bool>false</bool>
</edit>
<edit name="antialias" mode="assign">

<bool>true</bool>
</edit>
<test compare="more_eq" name="pixelsize">
<double>9</double>
</test>

<test compare="less_eq" name="pixelsize">
<double>16</double>
</test>
<edit name="antialias" mode="assign" >
<bool>false</bool>

</edit>
</match>
</fontconfig>


下面是兩張前后比較圖, 首先是舊版的 fireflysung :



然后是 opendesktop-fonts 的效果 :



新版的 opendesktop-fonts 字體橫了, 不像以往的瘦瘦高高, 現在是方方正正, 更像新細明體。而DejaVu 就沒有看出那裡跟 Bitstream 不一樣 :P

Linux 字型設定是比較深入的技巧, 沒有經過 2003-2004 或更早的中文設定的磨練過的話可能會較難上手, 所以希望下次再由理論開始講講。

星期五, 2月 09, 2007

Console-based mouse driver

晚上掛上 #ubuntu-tw, 閒聊間freesamael提到了gpm (general purpose mouse) 這個東西, 剛才有幸一試, 果然是好物 :) 在console下使用frame buffer好一段時間, 就知道欠點什麼, 現在有了 gpm, 真的很爽很爽 ~~

先說說 ubuntu 上的步驟,抱歉我沒有實機試驗,有錯請指出 :

# apt-get install gpm
# gpm -m /dev/input/mice -t imps2
{註: 這是ps/2滑鼠+滾動輪的意思}


如果是 gentoo 的話可容易得多 :
# emerge -av sys-libs/gpm
然后編輯 /etc/conf.d/gpm,指定正確的類型及裝置 :
MOUSE=imps2
MOUSEDEV=/dev/input/mice


然后啟動 gpm 去爽吧 ^^
# /etc/init.d/gpm start
如果想開機就能爽的話再將這個 script 加入到 default runlevel :
# rc-update add gpm default

說了這么多,其實都是從 gentoo 的文件抄過來的,原文見這裡。Happy mousing :)

星期三, 5月 17, 2006

我想, 我會喜歡 ubuntu


也就是上周的事, 把那台debian換了個ubuntu 6.06 beta 2, 一切都很順利, 也因為沒有什么特別的要求吧! 感覺很好, 軟件庫很豐富, 一些版權有限制的軟件都收錄了, 或是提供了很方便的途徑去取得, 感覺是繼承了debian的優點, 改善了debian的不足處, 真的是 "以人為本" 開發的版本呢。ubuntu 加 gentoo, 很不錯的組合 :)

星期日, 3月 12, 2006

打個招呼

你還好嗎 Linux ?
我的Debian及Gentoo