<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>DB2</title>
<link>http://www.aiview.com/</link>
<description>Alex&apos;s Public Information Portal.</description>
<copyright>Copyright 2008</copyright>
<lastBuildDate>Sat, 08 Nov 2008 01:52:21 +0700</lastBuildDate>
<generator>http://www.movabletype.org/?v=3.34</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> 

<item>
<title>Nokia E71 杂记</title>
<description><![CDATA[<h4>说点废话<br />
</h4>
<p>
E71是一款可以打动我的手机，无论是外形还是内在。相比使用了两年的Windows Mobile 平台的多普达手机，我对Symbian 系统的评价更高，或许是我的D700 型号太老了，总之，我能找到一大堆理由替换掉她：
</p>
<p>
多任务切换需要第三方支持，更重要的是切换过程的反应速度过慢；内存占用过多时，会出现中文输入无法呼出的问题；无线或者蓝牙有时需要reboot一下系统才能启动；因电池耗尽更换电池后，需要手工关闭飞行模式，作为PDA设计无可厚非，作为电话却繁缛了点；最重要的一点，通信模块有时会假死，PDA功能正常，但电话打不进来；决定性的因素，她终于被我摔坏了:(
</p>
<p>
黑莓、iPhone、Gphone或许都是不错的选择，尤其后两者的Shell 环境尤其吸引我，但E71 现在占据了我的心灵:)
</p>
<p>
E71已经用了月余，让我欣慰的是，仅仅花费了一周左右的时间，就获得了在Mobile平台折腾月余的<a href="http://www.aiview.com/2007/06/pda_may_get_things_worse.html">成果</a> 。
</p>
<p>
废话到此为止，现在分享一下E71经验。
</p>
<h4>E71 可以共享PC连接上网吗？ </h4>
<p>
通过数据线目前似乎不能。 <br />
通过蓝牙似乎需要安装第三方软件才可以。 <br />
通过WIFI可以，参考下面链接。测试成功！ <br />
http://bbs.dospy.com/thread-1935390-1-2.html <br />
&nbsp;<br />
PC端，配置adhoc类型的热点，如果需要修改配置，不要直接修改，删除-确定退出之后，重新添加，否则可能会有非常奇怪的旧配置无法更新问题。 
</p>
<p>
不需要配置手机端的ipv4地址。PC端的无线连接也不需要手动指定DNS。 <br />
如果为adhoc 指定了加密协议，那么两端必须输入相同的key，PC端不能用自动分配一个key。 
</p>
<h4>E71 使用8G卡会不会因为扫描大容量降低反应速度？ </h4>
<p>
已升级Sandisk 8G，无速度降低。
</p>
<h4>每次开机都自动安装软件，最后提示失败，为什么？ </h4>
<p>
我购的是欧版，已在上级批发商统一刷过BOIS，估计是新系统与原TF卡的兼容问题。
</p>
<p>
删除TF卡上此目录下的文件可解决问题:\private\10202dce 
</p>
<h4>使用条码扫描工具扫描商品上的条码，没有任何结果。 </h4>
<p>
E71自带条码扫描工具仅支持二维条码，通常商品包装是一维条码，可以这个页面中的<a href="http://discussions.europe.nokia.com/discussions/board/message?board.id=communicators&amp;thread.id=24005">二维条码</a> ，识别速度很快。 
</p>
<h4>是否有手机版飞信？</h4>
<p>
可使用这个E62版的<a href="http://www.fetion.com.cn/Downloads/mobile.aspx">飞信程序</a>&nbsp; 
</p>
<h4>有关E71的辐射 </h4>
<p>
降低辐射的<a href="http://bbs.dospy.com/viewthread.php?tid=1985626">方法</a> 。
</p>
<h4>通话中录音 </h4>
<p>
使用系统录音机，启动有些繁琐，录音过程对方能听到提示音，音质很好。有第三方可避免以上问题，不过不喜欢复杂。
</p>
<p>
录音过程中如果离开录音机的画面，则自动暂停录音，注意不是停止，返回后可按键继续录音。 
</p>
<h4>MSN, Gtalk, ICQ...</h4>
<p>
<a href="http://www.fring.com">Fring</a> ，不二的选择。
</p>
<p>
最近msn官方刚发布了移动版，同样支持Symbian平台，不过服务页面不支持Firefox，未下载成功，哪位有空可尝试下。
</p>
<h4>Podcast <br />
</h4>
<p>
系统内置Podcast目录, 可直接订阅下载（小心GPRS下会产生巨大流量），系统播放器会自动读出播放列表。 
</p>
<h4>字典<br />
</h4>
<p>
可在线下载Dictionary Language 并安装 Chinese等感兴趣语种，并设置source/targe language 
</p>
<h4>有关GPRS流量</h4>
<p>
Log中可查看GPRS 单次数据传输量，以及总量，可在月初手工清零。
</p>
<p>
彩信导致的流量也会计入，一般这部分是按条单独收费，需要考虑。
</p>
<h4>Nokia Maps 语音导航 <br />
</h4>
<p>
使用破解的Nokia Maps 2.0 + 证书签名，驾驶导航功能一直在计算路径，无法进入导航。
</p>
<p>
如果地图与语音文件已安装好，那么可能是TF卡上缺少以下文件导致：
</p>
<p>
\cities\diskcache\CacheddatHeader.cdt 文件<a href="http://club.ccmove.com/nclub/topicdisplay-9789-1157519-1.html">必须存在</a> ！
</p>
<p>
另外：
</p>
<p>
\cities\diskcache\ffffffff.cdt 文件不能离线自动生成，但缺失情况下也可以语音导航。 <br />
\cities\diskcache\config.cfg 文件可以离线自动生成。 <br />
2个qf 文件可离线自动生成。 <br />
\cities\qf <br />
\cities\diskcache\qf 
</p>
<p>
此问题与语音文件的语言无关，可以配置成与地图使用不同种类的语言。 <br />
</p>
<p>
与选择的开始或者目的地点没有详细道路没有关系（两点之间必须有完整的地图道路数据，区别于地图未下载完整）。
</p>
<h4>如果希望使用与系统语言不同的Nokia Maps数据</h4>
<p>
那么千万不能在Nokia Maps中使用go online选项，否则会瞬间丢失所有本地地图数据。 
</p>
<p>
go online 之后Nokia Maps会自动在线更新地图，并且会根据系统的语言选择相应语言版本的地图数据，如果不符，会删除所有本地地图数据，并下载新的符合语言版本的地图数据。有人说修改qf文件中的languageID可避免不期望的删除，但经测试无效：
</p>
<p>
English 是129,大陆是31，但修改后软件会自动根据系统语言更新这个文件，如果修改后设为只读，虽然软件无法修改成功，但依然删除原有数据并下载与系统语言相符的地图数据。
</p>
<h4>开心网</h4>
<p>
可通过手机短信在开心网发布记录，或者通过彩信在开心网发布图片，目前(2008-11-08)免费。
</p>
<p>
以上功能需要在开心网进行手机号码绑定设置。
</p>
<h4>GPS<br />
</h4>
<p>
GPS 在野外开阔地带第一次定位速度在1分钟内，经过长途导航测试，GPS表现非常稳定。开启GPS 利用地图持续导航的情况下（另外运行一个SportTracker保留轨迹），满电电池可以坚持10小时左右。 
</p>
<h4>其他<br />
</h4>
通过WIFI 共享PC Internet连接，速度非常快，最高160k左右，几乎达到了电信宽带实际速度的上限。 <br />
&nbsp;<br />
运行第三方Energy Prifile 1.1 过久会导致手机自动重起。<br />
<p>
Activated connection中可查看WIFI连接的当前状态和速率。 
</p>
<p>
使用蓝牙连接PC suite，没有卡正在使用的问题。平时开着PC端蓝牙，一旦打开手机蓝牙即可自动连接PC suite，十分方便，缺点是文件传输速度稍慢。 <br />
&nbsp;<br />
SMS Spam Message 后台运行导致PC suite 连接后找不到TF卡，只有内存卡。 
</p>
<p>
科大讯飞语音电子书for Symbian 1.0 还不支持第三版，已经咨询过官方，目前无法运行在E71上。已注册了软件，等待升级，对于未来升级版，注册码在同一手机上有效。
</p>
<p>
输入法我用A4，奥运五环E71专用版。
</p>
<p>
BizReader在有的版本系统自带，没有的可自己下载，其利用摄像头扫描名片，出人意料的实用。
</p>
<p>
拍照时，按数字键2 先对焦，否则你可能会更嘲笑这个350w的。
</p>
<p>
（未完） 
</p>
<h4>延展阅读<br />
</h4>
<ul>
	<li><a href="http://bbs.dospy.com/thread-2067785-1-2.html">用E71做你真正的商务助手（持续更新）</a> </li>
	<li><a href="http://www.aiview.com/2007/06/pda_may_get_things_worse.html">别让PDA 拖了后腿</a>&nbsp; <br />
	</li>
</ul>
]]></description>
<link>http://www.aiview.com/2008/11/all_about_nokia_e71.html</link>
<guid>http://www.aiview.com/2008/11/all_about_nokia_e71.html</guid>
<category>Thinkpad and PDA</category>
<pubDate>Sat, 08 Nov 2008 01:52:21 +0700</pubDate>
</item>
<item>
<title>Gentoo Linux on T43 (15) Fn + Keys</title>
<description><![CDATA[<p>
对于Linux 对Thinkpad Fn 组合键的支持的了解一直比较模糊，有很多内核中的支持以及软件包，不太清楚具体的分工以及关系，今天查阅了一些资料，试图清理一下自己的思路，也把自己的配置共享一下。
</p>
<p>
下面给一些包及内核Module加一些注释：
</p>
<h4>内核Thinkpad ACPI</h4>
<p>
在2.6.20 中叫做IBM ACPI，这里是它的<a href="http://ibm-acpi.sourceforge.net/">项目主页</a>。如果编译为module，名字为thinkpad_acpi，它的功能是把Fn 组合按键的事件export 到/proc/acpi（在kernel-2.6.24 中应该选择此项：[*]   Deprecated /proc/acpi/event support ），但其并不负责处理事件，需要其它userspace 程序来处理。
</p>
<h4>app-laptop/tp_smapi</h4>
<p>
来自<a href="http://tpctl.sourceforge.net/">Tpctl 项目</a> ，将thinkpad 硬件的信息export 到sysfs，供其它程序使用，目前主要实现了电池管理和HDAPS的功能。Fn keys应该不需要这个软件包，但我一直使用patched kernel + tp_smapi 来驱动HDAPS。
</p>
<p>
包含moduels：
</p>
<pre class="output">
hdaps
thinkpad_ec
tp_smapi
</pre>
<h4>app-laptop/thinkpad</h4>
<p>
也来自<a href="http://tpctl.sourceforge.net/">Tpctl 项目</a> ，但目前已经被上面的tp_smapi 所取代，除非使用很古老的笔记本（before 2001），应该不需要这个软件包。
</p>
<h4>sys-power/acpid</h4>
<p>
<a href="http://acpid.sourceforge.net">acpid</a>需要配合thinkpad-acpi使用，它默认读取/proc/acpi/event 中的条目，并将其传递给事件处理脚本，作出相应动作，比如关闭屏幕、待机等。 这些条目由/etc/acpi/events/default 捕获，并传递给/etc/acpi/default.sh 处理，但默认的/etc/acpi/default.sh 功能十分有限，必须自己修改。
</p>
<h4>配置Fn＋Keys<br />
</h4>
<p>
这里已经<a href="http://www2.informatik.hu-berlin.de/~pilop/HOWTO_Gentoo_T43/#ACPI-handler">有人写好了一些常用脚本</a>，我根据他的内容整理了一份<a href="/ref/2008/03/default.sh">default.sh</a>，目前可以处理Fn+F3(关屏), Fn+F4(Suspend to ram), Fn+F5(开关蓝牙), Fn+F6(开关wifi)，Fn+F7(Toggle VGA-out)，Fn+F12(Suspend to disk) 。这个脚本会用到radeontool，如果系统没有这么命令，merge它（也可以使用xset，但需要自己更改default.sh）。
</p>
<pre class="cmd">
# emerge -av1 radeontool
</pre>
<p>
另外，我注释了脚本中的xosd 命令，如果你有GUI 程序需要显示Fn控制程序的状态，那么可以去掉注释（需要merge xosd）
</p>
<h4>调试 <br />
</h4>
<p>
共享一下调试Fn 组合键的方法，thinkpad_acpi 会将按键事件写入/proc/acpi/event，但acpid 运行时我们无法读取这个文件，先停掉服务：
</p>
<pre class="cmd">
# /etc/init.d/acpid stop
</pre>
<p>
然后cat这个文件（确保module thinkpad_acpi 已经装载，或者内建在内核）
</p>
<pre class="cmd">
# cat /proc/acpi/event
</pre>
<p>
接着按Fn 组合键，console 中会打印出事件条目，括号中是我的注释。default.sh 将解析这些条目，并调用不同的命令进行处理。
</p>
<pre class="output">
ibm/hotkey HKEY 00000080 00001001 (Fn+F1)
ibm/hotkey HKEY 00000080 00001002 (Fn+..)
ibm/hotkey HKEY 00000080 00001003
ibm/hotkey HKEY 00000080 00001004
ibm/hotkey HKEY 00000080 00001005
ibm/hotkey HKEY 00000080 00001006
ibm/hotkey HKEY 00000080 00001007
ibm/hotkey HKEY 00000080 00001008
ibm/hotkey HKEY 00000080 00001009
ibm/hotkey HKEY 00000080 0000100a
ibm/hotkey HKEY 00000080 0000100b
ibm/hotkey HKEY 00000080 0000100c (Fn+F12)
ibm/hotkey HKEY 00000080 00001018 (Access IBM)
ibm/hotkey HKEY 00000080 00001014 (Fn+Space)
</pre>
<p>
在我这里，调整屏幕亮度、屏幕灯、音量几个按键thinkpad_acpi 似乎是捕获不到的，event 没有输出，但功能正常，是不是xmodmap 处理了？
</p>
<p>
另外，内核中还有一个ACPI Button 支持，如果编译为module，在rmmod thinkpad_acpi之后，并且已经装在button，诸如Fn+F4 的事件会被其捕获，同样写入/proc/acpi/event：
</p>
<pre class="output">
button/sleep SLPB 00000080 00000001
button/sleep SLPB 00000080 00000002
</pre>
<h4>下载</h4>
<p>
使用<a href="/ref/2008/03/default.sh">default.sh</a> 覆盖acpid 默认的文件/etc/acpi/default.sh 即可，/etc/acpi/events/default 不用更改。
</p>
<p class="emphasis">
更新了default.sh，加入了toggleVGA-out 的脚本。（2008-11-06）
</p>
<h4>更新 2008-04-09&nbsp;</h4>
<p>
今天偶然发现hal (0.5.10)中已经包含全系列thinkpad 型号hotkey的policy 配置文件，包括最新的T/X 6系列，这个文件位于：/usr/share/hal/fdi/information/10freedesktop/30-keymap-module-thinkpad-acpi.fdi，对于T4&nbsp; 系列，有如下定义：
</p>
<pre class="code">
&lt;match key=&quot;/org/freedesktop/Hal/devices/computer:system.hardware.version&quot; contains=&quot;T4&quot;&gt;
&lt;append key=&quot;input.keymap.data&quot; type=&quot;strlist&quot;&gt;0x02:screenlock&lt;/append&gt; &lt;!-- Fn+F3 lock --&gt;
&lt;append key=&quot;input.keymap.data&quot; type=&quot;strlist&quot;&gt;0x03:sleep&lt;/append&gt; &lt;!-- Fn+F4 suspend --&gt;
&lt;append key=&quot;input.keymap.data&quot; type=&quot;strlist&quot;&gt;0x04:radio&lt;/append&gt; &lt;!-- Fn+F5 switch radio --&gt;
&lt;append key=&quot;input.keymap.data&quot; type=&quot;strlist&quot;&gt;0x06:switchvideomode&lt;/append&gt; &lt;!-- Fn+F7 switch video output device --&gt;
&lt;append key=&quot;input.keymap.data&quot; type=&quot;strlist&quot;&gt;0x0b:suspend&lt;/append&gt; &lt;!-- Fn+F12 hibernate --&gt;
&lt;append key=&quot;input.keymap.data&quot; type=&quot;strlist&quot;&gt;0x0f:brightnessup&lt;/append&gt; &lt;!-- Fn+Home --&gt;
&lt;append key=&quot;input.keymap.data&quot; type=&quot;strlist&quot;&gt;0x10:brightnessdown&lt;/append&gt; &lt;!-- Fn+End --&gt;
&lt;append key=&quot;input.keymap.data&quot; type=&quot;strlist&quot;&gt;0x13:zoom&lt;/append&gt; &lt;!-- Fn+Space --&gt;
&lt;append key=&quot;input.keymap.data&quot; type=&quot;strlist&quot;&gt;0x17:vendor&lt;/append&gt; &lt;!-- ThinkPad/ThinkVantage button --&gt;
&lt;append key=&quot;info.capabilities&quot; type=&quot;strlist&quot;&gt;input.keymap&lt;/append&gt;
&lt;/match&gt; 
</pre>
<p>
我猜想如果使用这个配置文件，应该可以免去上面手工配置Fn keys的步骤，或者不再使用/proc/acpi/event 这个interface，代之使用经由hal 提供的事件绑定？
</p>
<p>
尝试将其copy 至/etc/hal/fdi/policy 或者/usr/share/hal/fdi/policy/10osvendor，然后重启/etc/init.d/hald 服务，同时关闭了可能与其冲突的acpid 服务，但并没有预期的作用。查看lshal，似乎也都符合配置文件：
</p>
<pre class="cmd">
$ lshal |grep input.product 
</pre>
<pre class="output">
  input.product = &#39;ThinkPad Extra Buttons&#39;  (string)
...
</pre>
<pre class="cmd">
$ lshal |grep system.hardware.vendor
</pre>
<pre class="output">
  system.hardware.vendor = &#39;IBM&#39;  (string)
</pre>
<pre class="cmd">
$ lshal |grep system.hardware.version
</pre>
<pre class="output">
  system.hardware.version = &#39;ThinkPad T43&#39;  (string)
</pre>
<p>
继续关注这个问题。
</p>
<p>
下面添加了一篇Gentoo 配置的参考文章。
</p>
<h4>延展阅读</h4>
<ul>
	<li><a href="http://www2.informatik.hu-berlin.de/%7Epilop/HOWTO_Gentoo_T43/#download">DE.STRUCTION:private - Gentoo on IBM ThinkPad T43</a> （参考其事件处理脚本）</li>
	<li><a href="http://www.thinkwiki.org/wiki/How_to_get_special_keys_to_work" title="How to get special keys to work">How to setup/configure the extra keys</a></li>
	<li><a href="http://www.linuxsir.org/bbs/lastpostinthread313431.html" target="_blank" onmousedown="return clk(0,'','','res','1','')">[分享]在IBM ThinkPad X41上安装Gentoo全记录!（第二部分）</a>（一篇不错的参考）</li>
	<li><a href="http://www.aiview.com/2008/11/gentoo_linux_on_t43_17_vga-out.html" title="Tags: gentoo, linux, VGA-Out ">Gentoo Linux on T43 (17) VGA输出</a></li>
	<li><a href="http://www.aiview.com/2008/11/gentoo_linux_on_t43_16_bluetooth.html" title="Tags: bluetooth, gentoo, linux, t43, 蓝牙 ">Gentoo Linux on T43 (16) 蓝牙传输文件</a></li>
</ul>
]]></description>
<link>http://www.aiview.com/2008/03/gentoo_linux_on_t43_15_fn_keys.html</link>
<guid>http://www.aiview.com/2008/03/gentoo_linux_on_t43_15_fn_keys.html</guid>
<category>Linux</category>
<pubDate>Mon, 31 Mar 2008 02:04:42 +0700</pubDate>
</item>
<item>
<title>Gentoo Linux on T43 总结：环境与配置文件</title>
<description><![CDATA[<p>
这篇笔记将集中给出一些系统中的环境设置与配置文件，有些配置文件在前面可能有所提及，有些并未涉及到，算作对<a href="http://www.aiview.com/2008/01/gentoo_linux_on_t43_3_the_manual_of_manual.html">前面内容</a>的总结和补充。
</p>
<h4>环境&nbsp;</h4>
<pre class="cmd">
$ emerge --info&nbsp;
</pre>
<pre class="output">
Portage 2.1.3.18 (default-linux/x86/2007.0, gcc-4.2.2, glibc-2.6.1-r0, 2.6.23-gentoo i686)
=================================================================
System uname: 2.6.23-gentoo i686 Intel(R) Pentium(R) M processor 2.00GHz
Timestamp of tree: Mon, 05 Nov 2007 13:20:01 +0000
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.2-r1
dev-lang/python:     2.5.1-r3
sys-apps/baselayout: 1.12.10-r5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r1
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23
ACCEPT_KEYWORDS=&quot;x86 ~x86&quot;
CBUILD=&quot;i686-pc-linux-gnu&quot;
CFLAGS=&quot;-Os -march=pentium-m -pipe&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/env.d/java/ /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/udev/rules.d&quot;
CXXFLAGS=&quot;-Os -march=pentium-m -pipe&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch&quot;
GENTOO_MIRRORS=&quot;http://ftp.ncnu.edu.tw/Linux/Gentoo/     http://distro.ibiblio.org/pub/linux/distributions/gentoo/     http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/&quot;
LANG=&quot;en_US&quot;
LINGUAS=&quot;en zh zh_CN&quot;
MAKEOPTS=&quot;-j3&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://rsync.asia.gentoo.org/gentoo-portage&quot;
USE=&quot;X a52 aac aalib acl acpi alsa apache2 asf avahi avi berkdb bitmap-fonts bluetooth bzip2 cdparanoia cdr cjk cli console cracklib crypt cups dbus divx4linux dri dv dvd dvdr dvdread emacs encode esd exif ffmpeg firefox flac foomatic fortran gdbm gif glitz gnome gphoto2 gpm gstreamer gtk hal hdaps iconv immqt-bc irda isdnlog java jpeg lame live mad madwifi midi mjpeg mmx mp3 mp4 mpeg msn mudflap mysql ncurses nls nptl nptlonly nsplugin ogg opengl openmp oss pam pcre pda pdf perl png ppds pppd python qq quicktime rar readline real reflection ruby session sound spell spl sse sse2 ssl svg symlink tcpd tiff truetype truetype-fonts type1 type1-fonts unicode usb userlocales vcd vidix vorbis wav win32codecs wmv x86 xcb xine xinerama xml xorg xv xvid zip zlib&quot; ALSA_CARDS=&quot;intel8x0&quot; ALSA_PCM_PLUGINS=&quot;adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol&quot; ELIBC=&quot;glibc&quot; INPUT_DEVICES=&quot;keyboard evdev mouse synaptics&quot; KERNEL=&quot;linux&quot; LCD_DEVICES=&quot;bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text&quot; LINGUAS=&quot;en zh zh_CN&quot; USERLAND=&quot;GNU&quot; VIDEO_CARDS=&quot;radeon vesa&quot;
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS&nbsp;
</pre>
<pre class="cmd">
$ set&nbsp;
</pre>
<pre class="output">
ANT_HOME=/usr/share/ant-core
BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]=&quot;3&quot; [1]=&quot;2&quot; [2]=&quot;17&quot; [3]=&quot;1&quot; [4]=&quot;release&quot; [5]=&quot;i686-pc-linux-gnu&quot;)
BASH_VERSION=&#39;3.2.17(1)-release&#39;
CLASSPATH=/home/db2amor/sqllib/java/db2java.zip:/home/db2amor/sqllib/java/db2jcc.jar:/home/db2amor/sqllib/java/sqlj.zip:/home/db2amor/sqllib/function:/home/db2amor/sqllib/java/db2jcc_license_cisuz.jar:/home/db2amor/sqllib/java/db2jcc_license_cu.jar:.
COLORTERM=gnome-terminal
COLUMNS=152
CONFIG_PROTECT=&#39;/usr/share/X11/xkb /usr/kde/3.5/share/config /usr/kde/3.5/env /usr/kde/3.5/shutdown /usr/share/config&#39;
CONFIG_PROTECT_MASK=&#39;/etc/env.d/java/ /etc/udev/rules.d /etc/gconf /etc/terminfo /etc/revdep-rebuild /etc/splash&#39;
CVS_RSH=ssh
DB2INSTANCE=db2amor
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-S9K8WiCEnf,guid=d7447ddfa94cec100759df0047da3397
DIRSTACK=()
DISPLAY=:0.0
EDITOR=/usr/bin/emacs
EUID=1000
FLTK_DOCDIR=/usr/share/doc/fltk-1.1.7-r2/html
GCC_SPECS=
GDK_USE_XFT=1
GENERATION=2
GNOME_DESKTOP_SESSION_ID=Default
GNOME_KEYRING_SOCKET=/tmp/keyring-HarWwA/socket
GROUPS=()
GTK_IM_MODULE=scim
GTK_RC_FILES=/etc/gtk/gtkrc:/home/alex/.gtkrc-1.2-gnome2
G_BROKEN_FILENAMES=1
HISTFILE=/home/alex/.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOME=/home/alex
HOSTTYPE=i686
HUSHLOGIN=FALSE
IFS=$&#39; \t\n&#39;
INFOPATH=/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.18/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.2.2/info:/usr/share/info/emacs-22
JAVAC=/home/alex/.gentoo/java-config-2/current-user-vm/bin/javac
JAVA_HOME=/home/alex/.gentoo/java-config-2/current-user-vm
JDK_HOME=/home/alex/.gentoo/java-config-2/current-user-vm
KDEDIRS=/usr:/usr/local:/usr/kde/3.5
LANG=en_US
LC_CTYPE=zh_CN
LD_LIBRARY_PATH=/opt/ibm-jdk-bin-1.4.2.9/bin:/opt/ibm-jdk-bin-1.4.2.9/jre/bin:/home/db2amor/sqllib/lib
LESS=&#39;-R -M --shift 5&#39;
LESSOPEN=&#39;|lesspipe.sh %s&#39;
LIBPATH=/home/db2amor/sqllib/lib
LINES=51
LOGNAME=alex
LS_COLORS=&#39;no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:&#39;
MACHTYPE=i686-pc-linux-gnu
MAIL=/var/mail/alex
MAILCHECK=60
MANPATH=/home/alex/.gentoo/java-config-2/current-user-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.18/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.2.2/man:/etc/java-config/system-vm/man/:/usr/kde/3.5/share/man:/usr/qt/3/doc/man
OPENGL_PROFILE=xorg-x11
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PAGER=/usr/bin/less
PATH=/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.2.2:/opt/mts-client:/opt/mts:/opt/ibm-jdk-bin-1.4.2.9/bin:/opt/ibm-jdk-bin-1.4.2.9/jre/bin:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin:/home/alex/bin:/home/alex/foo:/home/alex/foo/order:/home/db2amor/sqllib/bin:/home/db2amor/sqllib/adm:/home/db2amor/sqllib/misc:/home/alex/bin:/home/alex/foo:/home/alex/foo/order
PIPESTATUS=([0]=&quot;2&quot;)
PKG_CONFIG_PATH=/usr/qt/3/lib/pkgconfig
PPID=7553
PRELINK_PATH_MASK=/usr/lib/gstreamer-0.10:/usr/lib/klibc
PYTHONPATH=/usr/lib/portage/pym
QMAKESPEC=linux-g++
QTDIR=/usr/qt/3
QT_IM_MODULE=scim
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=3
SSH_AGENT_PID=7403
SSH_AUTH_SOCK=/tmp/ssh-VHqDnq7373/agent.7373
TERM=xterm
USER=alex
VMHANDLE=ibm-jdk-bin-1.4
VWSPATH=/home/db2amor/sqllib
VWS_LOGGING=/home/db2amor/sqllib/logging
VWS_TEMPLATES=/home/db2amor/sqllib/templates
WINDOWID=20980933
WINDOWPATH=7
XAUTHORITY=/home/alex/.Xauthority
XDG_DATA_DIRS=/usr/share:/usr/kde/3.5/share:/usr/local/share
XDG_SESSION_COOKIE=
XMODIFIERS=@im=SCIM
</pre>
<h4>配置文件</h4>
<ul>
	<li><a href="http://www.aiview.com/ref/2008/03/make.conf">/etc/make.conf</a> </li>
	<li><a href="http://www.aiview.com/ref/2008/03/.config">/usr/src/linux/.config</a> </li>
	<li><a href="http://www.aiview.com/ref/2008/03/fstab">/etc/fstab</a> </li>
	<li><a href="http://www.aiview.com/ref/2008/03/xorg.conf">/etc/X11/xorg.conf</a> </li>
	<li><a href="http://www.aiview.com/ref/2008/03/locale.gen">/etc/locale.gen</a> </li>
	<li><a href="http://www.aiview.com/ref/2008/03/kernel-2.6">/etc/modules.autoload/kernel-2.6</a></li>
	<li><a href="http://www.aiview.com/ref/2008/03/wpa_supplicant.conf">/etc/wpa_supplicant/wpa_supplicant.conf</a> </li>
	<li><a href="http://www.aiview.com/ref/2008/03/jdk.conf&quot;">/etc/java-config-2/build/jdk.conf</a> </li>
	<li><a href="http://www.aiview.com/ref/2008/03/clock">/etc/conf.d/clock</a> </li>
	<li><a href="http://www.aiview.com/ref/2008/03/hdapsd">/etc/conf.d/hdapsd</a></li>
	<li><a href="http://www.aiview.com/ref/2008/03/package.use">/etc/portage/package.use</a> </li>
	<li><a href="http://www.aiview.com/ref/2008/03/package.keywords">/etc/portage/package.keywords</a> </li>
	<li><a href="http://www.aiview.com/ref/2008/03/.fonts.conf">/home/alex/.fonts.conf</a></li>
</ul>
<h4>后记<br />
</h4>
<p>
这篇笔记不会是这个系列的最后一篇，因为有些部分自己还没有整理清楚，待合适的时候，将继续更新。 
</p>
<h4>延展阅读</h4>
<ul>
	<li><a href="http://www.aiview.com/2008/01/gentoo_linux_on_t43_3_the_manual_of_manual.html">Gentoo Linux on T43 (3) 安装指南的指南</a>&nbsp; <br />
	</li>
</ul>
]]></description>
<link>http://www.aiview.com/2008/03/gentoo_linux_on_t43_env_and_conf.html</link>
<guid>http://www.aiview.com/2008/03/gentoo_linux_on_t43_env_and_conf.html</guid>
<category>Linux</category>
<pubDate>Sun, 16 Mar 2008 03:11:08 +0700</pubDate>
</item>
<item>
<title>Google Reader 移动版连续后退中文乱码，Solved</title>
<description><![CDATA[<p>
环境：多普达D700，Windows Mobile 5.0，IE。
</p>
<p>
在
<a href="http://www.google.cn/reader" title="Google Reader">Google Reader</a> 中浏览订阅内容时，经常会用到后退按钮，在连续2次后退之后，页面中的中文变为乱码，需要重新刷新页面才能解决，我一直以来避免连续后退两次这样的操作，今天查看了一下IE Options 中的字符集设置，默认使用简体中文Chinese Simplified (GB2312)，将其更改为Unicode (UTF-8) 问题得到解决。
</p>
<p>
顺便我尝试了<a href="http://www.google.cn/gmm">Google 手机地图中国版(Google China Maps)</a> 1.7.1，通过本地网络接入互联网，速度很快，几分钟的浏览就cache 了1MB的数据，这也说明它会很轻松的突破大多数人使用的GPRS 5MB／10MB 套餐的流量，提醒大家在使用GPRS 连接时要慎重。
</p>
<p>
如果您正在使用PDA ，可以直接下载安装：
<a href="http://www.google.cn/gmm/GoogleMaps.CAB">Windows Mobile 手机用户</a> | <a href="http://www.google.cn/gmm/GoogleMaps.sisx">Symbian S60 第3版 手机用户</a>。
</p>
]]></description>
<link>http://www.aiview.com/2008/03/chinese_problem_in_google_reader_solved.html</link>
<guid>http://www.aiview.com/2008/03/chinese_problem_in_google_reader_solved.html</guid>
<category>Thinkpad and PDA</category>
<pubDate>Sun, 09 Mar 2008 23:54:33 +0700</pubDate>
</item>
<item>
<title>Gentoo Linux on T43 (11) CPU 频率自动控制</title>
<description>TODO
</description>
<link>http://www.aiview.com/2008/01/gentoo_linux_on_t43_11_cpu_frequence.html</link>
<guid>http://www.aiview.com/2008/01/gentoo_linux_on_t43_11_cpu_frequence.html</guid>
<category>Linux</category>
<pubDate>Wed, 30 Jan 2008 18:12:35 +0700</pubDate>
</item>
<item>
<title>Gentoo Linux on T43 (10) Fingerprint Reader 指纹认证</title>
<description><![CDATA[<p>
<a href="http://www.thinkwiki.org/wiki/Integrated_Fingerprint_Reader" title="Integrated Fingerprint Reader">Thinkpad Integrated Fingerprint Reader</a> 可以使用指纹认证代替用户登录过程中的密码认证，减少用户手工输入密码的机会，在Windows 下使用CSS 软件，配合内置加密芯片，更可以实现指纹认证的文件加解密。
</p>
<p>
在Gentoo Linux 下整个配置过程比较容易，<a href="http://www.thinkwiki.org/wiki/How_to_enable_the_fingerprint_reader_with_ThinkFinger">How to enable the fingerprint reader with ThinkFinger - ThinkWiki</a> 提供了非常清晰的描述，请参考文中的Gentoo 部分以及后续步骤。下面仅列出几点Gentoo 用户需要注意的地方。
</p>
<ul>
	<li>文件/etc/pam.d/common-auth 在Gentoo Linux 下无法找到，应该使用 /etc/pam.d/system-auth，以下是我修改后的内容。</li>
</ul>
<p>
/etc/pam.d/system-auth 
</p>
<pre class="code">
#%PAM-1.0
auth&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; required&nbsp;&nbsp;&nbsp;&nbsp; pam_env.so
<span class="hilite"># Added by alex
auth&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sufficient&nbsp;&nbsp; pam_thinkfinger.so
auth&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sufficient&nbsp;&nbsp; pam_unix.so try_first_pass likeauth nullok</span>
auth&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; required&nbsp;&nbsp;&nbsp;&nbsp; pam_deny.so
account&nbsp;&nbsp;&nbsp; required&nbsp;&nbsp;&nbsp;&nbsp; pam_unix.so
# This can be used only if you enabled the cracklib USE flag
password&nbsp;&nbsp; required&nbsp;&nbsp;&nbsp;&nbsp; pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 try_first_pass retry=3
# This can be used only if you enabled the cracklib USE flag
password&nbsp;&nbsp; sufficient&nbsp;&nbsp; pam_unix.so try_first_pass use_authtok nullok md5 shadow
# This can be used only if you enabled the !cracklib USE flag
# password&nbsp;&nbsp; sufficient pam_unix.so try_first_pass nullok md5 shadow
password&nbsp;&nbsp; required&nbsp;&nbsp;&nbsp;&nbsp; pam_deny.so
session&nbsp;&nbsp;&nbsp; required&nbsp;&nbsp;&nbsp;&nbsp; pam_limits.so
session&nbsp;&nbsp;&nbsp; required&nbsp;&nbsp;&nbsp;&nbsp; pam_unix.so
</pre>
<ul>
	<li>将uinput 加入/etc/modules.autoload.d/kernel-2.6<br />
	</li>
</ul>
<pre class="code">
# Modules for fingerprint
uinput
</pre>
<ul>
	<li>将文中的环境变量$USERNAME 替换为$USER 再使用，例如：</li>
</ul>
<pre class="cmd">
# gpasswd -a $USER<del>NAME</del> fingerprint 
</pre>
<ul>
	<li>若使指纹认证在xscreensaver/gnome-screensaver 中工作，必须按照上文<span class="tocnumber">中 </span><a href="http://www.thinkwiki.org/wiki/How_to_enable_the_fingerprint_reader_with_ThinkFinger#xscreensaver.2Fgnome-screensaver"><span class="tocnumber">4</span> <span class="toctext">xscreensaver/gnome-screensaver</span></a> 一节进行额外配置。我在以下环境测试成功。</li>
	<ul>
		<li>
		gnome-screensaver-2.20.0 <br />
		</li>
		<li>pam-0.99.9.0<br />
		<br />
		但需要指出的是，文件/etc/pam.d/gnome-screensaver 并不需要修改，因为其已经通过include 关键字包含文件system-auth。</li>
	</ul>
	<li>关于<a href="http://www.thinkwiki.org/wiki/How_to_enable_the_fingerprint_reader_with_ThinkFinger#GNOME">gksu/gksudo 的workaround</a> ，我未进行测试。</li>
	<ul>
	</ul>
</ul>
<h4>延展阅读</h4>
<ul>
	<li><a href="http://www.thinkwiki.org/wiki/Integrated_Fingerprint_Reader" title="Integrated Fingerprint Reader">Thinkpad Integrated Fingerprint Reader</a> </li>
	<li><a href="http://www.thinkwiki.org/wiki/How_to_enable_the_fingerprint_reader_with_ThinkFinger">How to enable the fingerprint reader with ThinkFinger - ThinkWiki</a></li>
	<li><a href="https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/138957">https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/138957 </a>（有关gnome 应用程序中指纹认证的bug 和相关讨论）<a href="https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/138957"><br />
	</a></li>
</ul>
]]></description>
<link>http://www.aiview.com/2008/01/gentoo_linux_on_t43_10_fingerprint_reader.html</link>
<guid>http://www.aiview.com/2008/01/gentoo_linux_on_t43_10_fingerprint_reader.html</guid>
<category>Linux</category>
<pubDate>Wed, 30 Jan 2008 17:34:50 +0700</pubDate>
</item>
<item>
<title>Gentoo Linux on T43 (9) HDAPS 硬盘动态保护系统</title>
<description><![CDATA[<p>
本文参考<a href="http://www.thinkwiki.org/wiki/How_to_protect_the_harddisk_through_APS" title="How to protect the harddisk through APS">How to protect the harddisk through APS</a> ，以下内容可直接应用于Gentoo Linux。 
</p>
<p>
<a href="http://www.thinkwiki.org/wiki/Active_Protection_System">Thinkpad HDAPS</a>  依靠笔记本内部的2D 加速度传感器检测笔记本位移， 将数据写入sysfs，系统中有一个demon （守护进程）负责监视这个sysfs interface，必要时执行硬盘磁头parking 动作。此外，有一个applet，可以在任务托盘实时反映当前的保护状态，这个不是必须的。
</p>
<p>
在Linux 上完整的HDAPS 包括以下几个部分：
</p>
<ul>
	<li>hdaps 驱动程序，从硬件传感器读取数据（内核内置此驱动，但不要使用，推荐使用tp_smapi 提供的驱动）。<br />
	</li>
	<li>内核 patch，负责向sysfs 写入数据，需要重新编译内核。</li>
	<li>hdapsd，demon 程序</li>
	<li>applet，有多种选择：gnome-hdaps-applet, khdapsmonitor 等，可以不安装，并不影响HDAPS 作用。</li>
</ul>
<p>
下面就以上4个部分分别讨论。
</p>
<h4>内核Patch&nbsp;</h4>
<p>
这一步需要提前来做。 
</p>
<p>
根据自己的内核版本，找到<a href="http://www.thinkwiki.org/wiki/HDAPS#Kernel_patch">相应的patch 下载</a> （<a href="http://www.zen24593.zen.co.uk/hdaps/">另外一个下载地址</a>），我的内核版本是2.6.23： 
</p>
<pre class="cmd">
$ eselect kernel list
</pre>
<pre class="output">
Available kernel symlink targets:
&nbsp; [1]&nbsp;&nbsp; linux-2.6.20-gentoo-r8
<span class="hilite2">&nbsp; [2]&nbsp;&nbsp; linux-2.6.23-gentoo *</span>
&nbsp; [3]&nbsp;&nbsp; linux-2.6.23-gentoo-r1
</pre>
<p>
网络上没有找到版本完全符合的patch，但在<a href="http://waninkoko.info/?q=node/10">2.6.23-kamikaze4</a>  中找到了<a href="http://kamikaze.waninkoko.info/patches/2.6.23/kamikaze4/broken-out/thinkpad-2.6.23-1.patch">thinkpad-2.6.23-1.patch</a> ，它里面包含了我们需要的protection patch，我将其提取出来，做成 <a href="ref/2008/01/hdaps-protect-2.6.23.patch">hdaps-protect-2.6.23.patch</a> ，可以单独使用。
</p>
<p>
用以下命令应用patch，并重新编译内核安装modules 。<br />
</p>
<pre class="cmd">
# cd /usr/src/linux
# patch -p1 &lt; &nbsp;~/hdaps-protect-2.6.23.patch 
# make &amp;&amp; make modules_install
</pre>
<p>
重新启动系统之后，会在sysfs 生成文件 /sys/block/<span class="hilite1">xxx</span>/queue/protect，表明patch 成功。
</p>
<h4>hdaps 驱动程序&nbsp;</h4>
<p>
首先要禁止内核中的驱动程序，确保以下内核选项没有被设置，否则，将在不同的路径生成两个同名的module hdaps，load 过程会出错。 
</p>
<pre class="cmd">
$ zcat /proc/config.gz |grep -i hdaps
</pre>
<pre class="output">
# CONFIG_SENSORS_HDAPS is not set&nbsp;
</pre>
<p>
接下来在/etc/make.conf 的USE flag 中加入hdaps 支持，将会被tp_smapi 用到。
</p>
<p>
/etc/make.conf
</p>
<pre class="code">
USE=&quot;hdaps&quot;
</pre>
<p>
tp_smapi 已经被加入Gentoo package list，可以直接emerge，我目前使用0.31 版本。
</p>
<pre class="cmd">
# emerge -av app-laptop/tp_smapi
</pre>
<p>
载入hdaps 与tp_smapi
</p>
<pre class="cmd">
# modprobe tp_smapi hdaps&nbsp;
</pre>
<p>
并将其加入到/etc/modules.autoload.d/kernel-2.6 
</p>
<pre class="code">
# Modules for Thinkpad HDAPS
tp_smapi
hdaps
</pre>
<h4>hdapsd</h4>
<p>
安装demon，直接emerge 即可，我的版本是20060409-r1 。
</p>
<pre class="cmd">
# emerge -av &nbsp;app-laptop/hdapsd
</pre>
<p>
编辑hdapsd 配置文件，在DISK 中指定需要保护的硬盘设备名称，作为可选，也可以调整保护动作阈值THRESHOLD ，值越小，保护动作越早，但也会更频繁。
</p>
<p>
/etc/conf.d/hdapsd
</p>
<pre class="code">
# The name of the disk device that hdapsd should monitor.
# Usually this is &#39;hda&#39; or &#39;sda&#39; the primary master.
DISK=&quot;<span class="hilite2">sda</span>&quot;
# hdapsd sensitivity 
# The lower the threshold is the earlier 
# the heads are parked when the laptop is shaked
THRESHOLD=&quot;<span class="hilite2">15</span>&quot;
# Set any extra options here, like -a for Adaptive mode
OPTIONS=&quot;-a&quot;
</pre>
<p>
启动hdaspd 服务
</p>
<pre class="cmd">
# /etc/init.d/hdapsd start
</pre>
<p>
将hdapsd 设置为跟随系统自动启动&nbsp;
</p>
<pre class="cmd">
# rc-update add hdapsd boot 
</pre>
<h4>applet<br />
</h4>
<p>
如果希望监视硬盘保护状态，则需要安装applet 。我使用gnome 环境，因此选择了<a href="http://www.zen24593.zen.co.uk/hdaps/gnome-hdaps-applet-20060120.tar.gz">gnome-hdaps-applet</a>  ，但其还未被加入Gentoo 官方package list，需要下载回来自己编译安装。以下是步骤。
</p>
<p>
下载：
</p>
<pre class="cmd">
$ cd
$ wget http://www.zen24593.zen.co.uk/hdaps/gnome-hdaps-applet-20060120.tar.gz
$ mkdir gnome-hdaps-applet
$ tar -zxvf gnome-hdaps-applet-20060120.tar.gz -C gnome-hdaps-applet
$ cd gnome-hdaps-applet
</pre>
<p>
编译：
</p>
<pre class="cmd">
$ gcc $(pkg-config --cflags --libs libpanelapplet-2.0) -o gnome-hdaps-applet gnome-hdaps-applet.c
</pre>
<p>
安装：
</p>
<pre class="cmd">
# cp gnome-hdaps-applet /usr/bin
# mkdir /usr/share/pixmaps/gnome-hdaps-applet/
# cp *.png /usr/share/pixmaps/gnome-hdaps-applet/
# cp GNOME_HDAPS_StatusApplet.server /usr/lib/bonobo/servers
</pre>
<p>
重启Xwindow，在applet 列表中可以找到新的项目，加入到panel 即可。
</p>
<h4>Tips</h4>
<ul>
	<li>我在hdapsd 中设置的设备名为sda，但我的第二块硬盘sdb（在硬盘托架内）并没有受到保护，我尝试更改配置文件为sdb，保护动作正常，但无法对2个设备同时进行保护，hdaps project 邮件列表有一条关于此的讨论，<a href="http://sourceforge.net/mailarchive/message.php?msg_name=fn2r72%242l2%241%40ger.gmane.org">希望未来会支持多个设备</a> 。</li>
</ul>
<ul>
	<li>如果没有安装applet，在那里查看硬盘的保护状态呢？可以用以下命令查看历史状态，也可以使用ctrl + alt + F12 查看实时状态。 </li>
</ul>
<pre class="cmd">
$ dmesg |tail
</pre>
<pre class="output">
...
scsi_protect_queue(): head parked..
... 
</pre>
<ul>
	<li>我曾经在kernel-2.6.20-r8 下设置hdaps，但始终无法成功patch 内核，没有sysfs 数据写入，因此，hdapsd服务也无法启动成功。若有相似问题的用户可以尝试升级内核。 <br />
	</li>
</ul>
<h4>下载</h4>
<ul>
	<li><a href="ref/2008/01/hdaps-protect-2.6.23.patch">hdaps-protect-2.6.23.patch</a> （提取自<a href="http://waninkoko.info/?q=node/10">2.6.23-kamikaze4</a> 的<a href="http://kamikaze.waninkoko.info/patches/2.6.23/kamikaze4/broken-out/thinkpad-2.6.23-1.patch">thinkpad-2.6.23-1.patch</a>）</li>
	<li><a href="http://www.thinkwiki.org/wiki/HDAPS#Kernel_patch">其它内核版本的protection patch</a> （<a href="http://www.zen24593.zen.co.uk/hdaps/">另外一个下载地址</a>）</li>
	<li><a href="http://www.zen24593.zen.co.uk/hdaps/gnome-hdaps-applet-20060120.tar.gz">gnome-hdaps-applet-20060120.tar.gz</a> </li>
</ul>
<h4>延展阅读</h4>
<ul>
	<li><a href="http://www.thinkwiki.org/wiki/How_to_protect_the_harddisk_through_APS" title="How to protect the harddisk through APS">How to protect the harddisk through APS</a></li>
	<li><a href="http://www.thinkwiki.org/wiki/Tp_smapi">Tp smapi</a></li>
	<li><a href="http://www.thinkwiki.org/wiki/HDAPS"><span class="mw-headline"> HDAPS - IBM Active Protection System Linux Driver</span>&nbsp;</a></li>
	<li><a href="http://www.zen24593.zen.co.uk/hdaps/">部分版本内核Patch 与gnome-hdaps-applet 下载</a> <br />
	</li>
	<li><a href="http://www.thinkwiki.org/wiki/Active_Protection_System">Active Protection System</a></li>
	<li><a href="http://sourceforge.net/mailarchive/message.php?msg_name=fn2r72%242l2%241%40ger.gmane.org">hdapsd with multiple drives?</a></li>
</ul>
（未完）
]]></description>
<link>http://www.aiview.com/2008/01/gentoo_linux_on_t43_9_hdaps.html</link>
<guid>http://www.aiview.com/2008/01/gentoo_linux_on_t43_9_hdaps.html</guid>
<category>Linux</category>
<pubDate>Wed, 30 Jan 2008 15:45:26 +0700</pubDate>
</item>
<item>
<title>Gentoo Linux on T43 (8) X300 显卡的驱动以及3D 加速</title>
<description><![CDATA[<p>
T43 包括两种显卡方案，一种是915GM 主板集成<a href="http://www.thinkwiki.org/wiki/Intel_Graphics_Media_Accelerator_900">Intel 显卡</a> ，另一种是<a href="http://www.thinkwiki.org/wiki/ATI_Mobility_Radeon_X300">ATI X300 独立显卡</a> ，我的显卡是X300 ，这里所有的讨论都是与X300 相关。
</p>
<p>
ATI X300 有2种驱动方案，一种是开源驱动radeon，通过开源R300 项目已经可以支持X300 显卡的3D
加速；另一种是ATI 官方的闭源驱动fglrx 。
</p>
<p>
下面针对这2种方案，分别给出我的配置，涉及到：内核配置、make.conf 、安装软件包、X11 配置、装载module以及OpenGL 设置。
</p>
<h4>内核配置</h4>
<p>
请参照 <a href="http://www.aiview.com/2008/01/gentoo_linux_on_t43_5_kernel_configuration.html">Gentoo Linux on T43 (5) 配置内核(kernel)</a> 显卡一节。
</p>
<h4>make.conf</h4>
<p>
在开时编译一些软件包之前，需要在/etc/make.conf&nbsp; 中设置变量：USE 与VIDEO_CARDS 。
</p>
<p>
开源驱动与官方驱动都需要设定如下USE flag，将其添加到原有USE flag 列表
</p>
<pre class="code">
USE=&quot;dri opengl&quot;&nbsp;
</pre>
<p>
VIDEO_CARDS 中的设定值会被软件包x11-server、x11-drm 等软件包使用，对于开源驱动设定：
</p>
<pre class="code">
VIDEO_CARDS=&quot;radeon vesa&quot;
</pre>
<p>
对于官方驱动设定：&nbsp;
</p>
<pre class="code">
VIDEO_CARDS=&quot;fglrx vesa&quot; 
</pre>
<p>
加入vesa 用来对启动过程中的字符界面提供支持。
</p>
<h4>安装软件包</h4>
<p>
如果使用开源驱动，emerge：
</p>
<pre class="cmd">
# emerge -av xorg-x11 xf86-video-ati&nbsp;
</pre>
<p>
下面的软件包会作为依赖被自动安装 
</p>
<p>
x11-base/xorg-server<br />
x11-drivers/xf86-video-vesa<br />
media-libs/mesa
</p>
<p>
前面内核配置，如果没有选择内核中的drm，那么此处应该把drm 也安装上：<br />
</p>
<pre class="cmd">
# emerge -av x11-base/x11-drm 
</pre>
<p>
如果使用官方驱动，emerge：
</p>
<pre class="cmd">
# emerge -av ati-drivers&nbsp;
</pre>
<h4>X11 配置</h4>
<p>
X11 的配置文件位于/etc/X11/xorg.conf ，这里不介绍如何生成一个默认的xorg.conf 文件（相关内容请参考Gentoo 手册），仅给出我的配置，将其合并入你的配置文件即可，以下是针对T43 1400x1050 高分屏以及X300显卡，并开启3D 加速的配置。
</p>
<h5>开源驱动<br />
</h5>
<pre class="code">
Section &quot;Module&quot;
&nbsp;&nbsp;&nbsp; Load	&quot;dbe&quot;
&nbsp;&nbsp;&nbsp; SubSection	&quot;extmod&quot;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Option	&quot;omit xfree86-dga&quot;
&nbsp;&nbsp;&nbsp; EndSubSection
&nbsp;&nbsp;&nbsp; Load 	&quot;glx&quot;
&nbsp;&nbsp;&nbsp; Load 	&quot;dri&quot;
&nbsp;&nbsp;&nbsp; ...
EndSection
Section &quot;Extensions&quot;
&nbsp;&nbsp;&nbsp; <span class="hilite1">Option&nbsp; &quot;Composite&quot; &quot;1&quot;</span>
EndSection
Section &quot;ServerFlags&quot;
&nbsp;&nbsp;&nbsp; <span class="hilite1">Option      &quot;AIGLX&quot;         &quot;on&quot;</span>
EndSection
Section &quot;Monitor&quot;
&nbsp;&nbsp;&nbsp; Identifier	&quot;Thinkpad LCD Monitor&quot;
&nbsp;&nbsp;&nbsp; Option	&quot;dpms&quot;
&nbsp;&nbsp;&nbsp; DisplaySize	      370	277
EndSection
Section &quot;Device&quot;
&nbsp;&nbsp;&nbsp; Identifier	&quot;ATI Graphics Mobile X300&quot;
&nbsp;&nbsp;&nbsp; <span class="hilite1">Driver	&quot;radeon&quot;</span>
&nbsp;&nbsp;&nbsp; BusID	&quot;PCI:1:0:0&quot;
EndSection
Section &quot;Screen&quot;
&nbsp;&nbsp;&nbsp; Identifier &quot;High Screen&quot;
&nbsp;&nbsp;&nbsp; Device     &quot;ATI Graphics Mobile X300&quot;
&nbsp;&nbsp;&nbsp; Monitor    &quot;Thinkpad LCD Monitor&quot;
&nbsp;&nbsp;&nbsp; DefaultDepth     24
&nbsp;&nbsp;&nbsp; SubSection &quot;Display&quot;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Viewport   0 0
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Depth      24
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Modes      &quot;1400x1050&quot; &quot;1280x1024&quot; &quot;1024x768&quot; &quot;800x600&quot;
&nbsp;&nbsp;&nbsp; EndSubSection
EndSection
Section &quot;ServerLayout&quot;
&nbsp;&nbsp;&nbsp; Identifier	&quot;Main Layout&quot;
&nbsp;&nbsp;&nbsp; Screen	&quot;High Screen&quot;
&nbsp;&nbsp;&nbsp; ...
EndSection
Section &quot;dri&quot;
&nbsp;&nbsp;&nbsp; Mode         0666
EndSection 
</pre>
<h5>官方驱动&nbsp;</h5>
<p>
将上面的配置进行如下修改即可
</p>
<pre class="code">
...
Section &quot;Extensions&quot;
&nbsp;&nbsp;&nbsp; <span class="hilite1">Option&nbsp; &quot;Composite&quot; &quot;0&quot;</span>
EndSection
Section &quot;ServerFlags&quot;
&nbsp;&nbsp;&nbsp; <span class="hilite1">Option      &quot;AIGLX&quot;         &quot;off&quot;</span>
EndSection
...
Section &quot;Device&quot;
&nbsp;&nbsp;&nbsp; Identifier	&quot;ATI Graphics Mobile X300&quot;
&nbsp;&nbsp;&nbsp; <span class="hilite1">Driver	&quot;fglrx&quot;</span>
&nbsp;&nbsp;&nbsp; BusID	&quot;PCI:1:0:0&quot;
EndSection
...
</pre>
<h4>装载module&nbsp;</h4>
<p>
在/etc/modules.autoload.d/kernel-2.6 文件中加入在启动时需要装载的module 名称。
</p>
<h5>
开源驱动&nbsp;
</h5>
<pre class="code">
# Modules for video card &amp; 3D
drm
radeon
</pre>
<h5>
官方驱动&nbsp;
</h5>
<pre class="code">
# Modules for video card &amp; 3D
drm
fglrx
</pre>
<p>
可以使用以下命令确认module 是否装载成功，以及查看引用关系（以开源驱动为例） 
</p>
<pre class="cmd">
$ lsmod |grep radeon
</pre>
<pre class="output">
radeon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 121376&nbsp; 2 
drm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 63380&nbsp; 3 radeon
</pre>
<h4>OpenGL 配置</h4>
<p>
为系统选择OpenGL 程序。
</p>
<h5>
开源驱动&nbsp;
</h5>
<pre class="cmd">
# eselect opengl set xorg-x11
</pre>
<h5>
官方驱动&nbsp;
</h5>
<pre class="cmd">
# eselect opengl set ati
</pre>
<h4>延展阅读</h4>
<ul>
	<li><a href="http://www.thinkwiki.org/wiki/ATI_Mobility_Radeon_X300">ATI Mobility Radeon X300</a></li>
	<li><a href="http://www.gentoo.org/doc/zh_cn/xorg-config.xml">Gentoo 手册：X服务器配置指南</a> </li>
	<li><a href="http://www.gentoo.org/doc/en/dri-howto.xml">Hardware 3D Acceleration Guide</a></li>
	<li><a href="http://zh.gentoo-wiki.com/HOWTO_ATI_Open-Source_Drivers">HOWTO ATI Open-Source Drivers - Gentoo Linux Wiki</a> （中文）<br />
	</li>
	<li><a href="http://gentoo-wiki.com/HOWTO_DRI_with_ATi_Open-Source_Drivers">HOWTO DRI with ATi Open-Source Drivers</a> </li>
	<li><a href="http://odin.prohosting.com/wedge01/gentoo-radeon-faq.html#info">Gentoo ATI Radeon FAQ</a></li>
	<li><a href="http://forum.ubuntu.org.cn/viewtopic.php?t=26188&amp;start=0&amp;postdays=0&amp;postorder=asc&amp;highlight=&amp;sid=d5fceeb875adee9367dbf8e8a11c99db" class="maintitle">ati官方驱动（非开源）的安装配置（08/01/19）</a></li>
	<li><a href="http://www.thinkwiki.org/wiki/Installing_Ubuntu_6.10_on_a_ThinkPad_T43">Installing Ubuntu 6.10 on a ThinkPad T43</a></li>
</ul>
（未完）<br />
]]></description>
<link>http://www.aiview.com/2008/01/gentoo_linux_on_t43_8_x300_3d_driver.html</link>
<guid>http://www.aiview.com/2008/01/gentoo_linux_on_t43_8_x300_3d_driver.html</guid>
<category>Linux</category>
<pubDate>Tue, 29 Jan 2008 18:17:47 +0700</pubDate>
</item>
<item>
<title>Gentoo Linux on T43 (7) 中文字体</title>
<description><![CDATA[<p>
Linux 下字体的配置可以很简单，也可以很复杂，这取决于个人需求的复杂程度，以及对相关知识的了解和技术掌控程度，其差别会导致悬殊的时间成本。在我本人开始这项工作之前，对相关内容了解很少，因此不得不花费时间来了解一些基础性内容。
</p>
<p>
在这个过程中，一本在线书籍<a href="http://anakin.ncst.ernet.in/~aparna/consolidated/index.html">Free/Open Source Software Localization</a>  为我提供了有益的帮助，其整个第七章都是有关字体的内容，介绍了<a href="http://anakin.ncst.ernet.in/%7Eaparna/consolidated/c1006.html#AEN1008">基本的字体概念</a>，<a href="http://anakin.ncst.ernet.in/%7Eaparna/consolidated/x1057.html">字体的分类</a>，以及<a href="http://anakin.ncst.ernet.in/%7Eaparna/consolidated/x1092.html">Linux 如何处理字体</a> 等。
</p>
<p>
对于中文字体的详细配置，参考了quanliking 的2 篇文章： <span class="navbar"><a href="http://www.linuxsir.org/bbs/showthread.php?t=266659">Linux 字体微调 - windows  效果版</a> 、</span><a href="http://www.google.com/url?sa=t&amp;ct=res&amp;cd=2&amp;url=http%3A%2F%2Fwww.linuxsir.org%2Fbbs%2Fshowthread.php%3Ft%3D269312&amp;ei=cAqbR_yfH5yK6gOSp6GTCA&amp;usg=AFQjCNGVMDz5TQmAmP0kB6UexVAcNfE1HQ&amp;sig2=6axzlQ8z1fitUMYrw78vDg" target="_blank" onmousedown="return rwt(this,'','','res','2','AFQjCNGVMDz5TQmAmP0kB6UexVAcNfE1HQ','&sig2=6axzlQ8z1fitUMYrw78vDg')">Linux 字体微调- Vista 效果版</a><span class="navbar"> 以及kemean 的</span><a href="http://www.freebsdchina.org/forum/viewtopic.php?t=34824&amp;start=0&amp;postdays=0&amp;postorder=asc&amp;highlight=" class="maintitle">字体配置local.conf详解[带Win效果和AA效果]</a><span class="navbar">。</span>
</p>
<p>
下面先描述一下字体的安装方法，然后给出我的字体配置，更多的内容可以参考以上的链接。 
</p>
<h4>安装字体</h4>
<p>
Gentoo Linux有2种主要的字体系统并存：<a href="http://anakin.ncst.ernet.in/~aparna/consolidated/x1092.html#AEN1104">Core X11 font system</a> 与<a href="http://anakin.ncst.ernet.in/~aparna/consolidated/x1092.html#AEN1120">xft font system</a>，分别有不同的安装方法。
</p>
<h5>Core X11 font system</h5>
<p>
对于Core X11，系统与应用程序的字体一般放在/usr/share/fonts 下面的子目录内，建议把用户自己安装的字体放在/usr/local/share/fonts 下的子目录，并且需要将这些路径加入到Xwindow的配置文件 /etc/X11/xorg.conf。举例： 
</p>
<p>
将新的truetype 类型字体放在/usr/local/share/fonts/TTF 目录，然后执行以下命令（注意顺序）：
</p>
<pre class="cmd">
# mkfontscale &nbsp;/usr/local/share/fonts/TTF
# mkfontdir /usr/local/share/fonts/TTF
</pre>
<p>
接着编辑/etc/X11/xorg.conf 来让使用Core X11 font system 的X 应用程序知道有新的字体可以利用，添加以下行到文件的Files 与Module Section（其实这个目录默认已经存在，无须添加）。
</p>
<pre class="code">
Section &quot;Files&quot;
&nbsp;&nbsp;&nbsp; FontPath   &quot;/usr/local/share/fonts/TTF&quot;
&nbsp;&nbsp;&nbsp; ...
EndSection
</pre>
重启Xwindow 即可，新的字体将会被识别。&nbsp;
<h5>xft font system <br />
</h5>
<p>
有些X 应用程序使用xft font system ，Gentoo Linux 默认设置了以下环境变量，使gtk+ 2.0 应用程序的字体使用xft，而不是Core X11 font system。
</p>
<pre class="cmd">
$ cat /etc/env.d/50gtk2
</pre>
<pre class="code">
GDK_USE_XFT=1
</pre>
<p>
xft font system 会自动搜索标准的字体路径并发现新字体，无须多余的步骤。如果希望新字体可以立即使用，那么执行命令fc-chache -fv 来即可刷新字体缓存。
</p>
<p>
对字体的配置可以存放在2个文件当中，其一是系统级别的/etc/fonts/local.conf (没有此文件可以自己建立），其二是用户Home目录下的.fonts.conf，仅影响当前用户。
</p>
<h4>字体配置</h4>
<p>
目前Linux 下的中文字体配置主要分为以下几种。
</p>
<h5>Windows 或Mac 效果&nbsp;</h5>
<p>
使用Windows 平台的宋体(SimSun)、新宋体(NSimSun)与黑体(SimHei) ，或者最新vista 系统中的微软雅黑字体(Microsoft YaHei)。另外还有Mac 平台采用的华文黑体(STHeiti)，其效果与SimHei 类似，但小字体的效果更出色。这几种字体包含的字符集非常齐全，覆盖了汉字简繁以及日韩字体，因此对繁体以及日韩字体显示效果要求不很高的用户，就没必要再去配置细明体(PMingLiU) 等其它字体。
</p>
<p>
使用这些字体的方法很简单，将其从Windows 目录复制到Linux 下简单配置即可，但严格来讲，这里面有版权问题，因此，在大多数Linux 发布之中，我们找不到以上字体。 
</p>
<h5>使用免费的开源字体&nbsp;</h5>
<p>
在这方面做得比较出色的是<a href="http://wqy.sourceforge.net/">文泉驿</a> 字体，目前通过网络协作的方式，已经开发出了点阵宋体、黑体以及等宽三大类字体，并不断升级改善中。
</p>
<p>
可以直接在Gentoo 中安装其中的点阵宋体和正黑字体：
</p>
<pre class="cmd">
# emerge -av  media-fonts/wqy-bitmapfont media-fonts/wqy-zenhei
</pre>
<h5>配置文件&nbsp;</h5>
<p>
为了对比，我尝试了以上的各种字体配置方案，经过调整后，在T43 高分屏1400x1050分辨率下，效果都不错，其差别仅在个人喜好罢了。因此，我将配置文件整理，如果你安装了以上几种字体，那么简单修改几行，重启Xwindow ，即可更换一种字体。 
</p>
<p>
下面是我的<a href="../../ref/2008/01/fonts.conf">.fonts.conf</a>  （整理自quanliking 与kemean 的文章），放在我的HOME 目录，会被/etc/fonts/fonts.conf 自动读取，其优先级低于/etc/fonts/local.conf
</p>
<pre class="code">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;!DOCTYPE fontconfig SYSTEM &quot;fonts.dtd&quot;&gt;
&lt;!-- ~/.font.conf file for user customizations --&gt;
&lt;fontconfig&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; Breaf:
&nbsp;&nbsp;&nbsp; Search keyword &quot;editable&quot; for configuation.
&nbsp;&nbsp;&nbsp; Section:
&nbsp;&nbsp;&nbsp; 1. Fonts family configuration
&nbsp;&nbsp;&nbsp; 2. Fonts substitution
&nbsp;&nbsp;&nbsp; 3. Global configuration
&nbsp;&nbsp;&nbsp; 4. English fonts configuration
&nbsp;&nbsp;&nbsp; 5. CJK fonts configuration
&nbsp;&nbsp;&nbsp; Installed fonts list:
&nbsp;&nbsp;&nbsp; STHeiti
&nbsp;&nbsp;&nbsp; 微软雅黑,Microsoft YaHei
&nbsp;&nbsp;&nbsp; 黑体,SimHei
&nbsp;&nbsp;&nbsp; 宋体-18030,SimSun-18030
&nbsp;&nbsp;&nbsp; 宋体,SimSun
&nbsp;&nbsp;&nbsp; 新宋体-18030,SimSun-18030,NSimSun-18030
&nbsp;&nbsp;&nbsp; 新宋体,NSimSun
&nbsp;&nbsp;&nbsp; WenQuanYi Bitmap Song
&nbsp;&nbsp;&nbsp; 文泉驿正黑,文泉罅正黑,WenQuanYi Zen Hei
&nbsp;&nbsp;&nbsp; Arial
&nbsp;&nbsp;&nbsp; Arial Black
&nbsp;&nbsp;&nbsp; Verdana
&nbsp;&nbsp;&nbsp; Comic Sans MS
&nbsp;&nbsp;&nbsp; Georgia
&nbsp;&nbsp;&nbsp; Times New Roman
&nbsp;&nbsp;&nbsp; Courier New
&nbsp;&nbsp;&nbsp; Andale Mono
&nbsp;&nbsp;&nbsp; Fixed
&nbsp;&nbsp;&nbsp; Impact
&nbsp;&nbsp;&nbsp; Trebuchet MS
&nbsp;&nbsp;&nbsp; Webdings
--&gt;
&lt;!--
*******************************************************************************
&nbsp;&nbsp;&nbsp; 1. Fonts family configuration [Begin]
*******************************************************************************
--&gt;
&nbsp;&nbsp;&nbsp; &lt;alias&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;family&gt;serif&lt;/family&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;prefer&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="hilite2">&lt;!-- @@@ editable --&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;family&gt;SimSun&lt;/family&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/prefer&gt;
&nbsp;&nbsp;&nbsp; &lt;/alias&gt;
&nbsp;&nbsp;&nbsp; &lt;alias&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;family&gt;sans-serif&lt;/family&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;prefer&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="hilite2">&lt;!-- @@@ editable --&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;family&gt;Microsoft YaHei&lt;/family&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/prefer&gt;
&nbsp;&nbsp;&nbsp; &lt;/alias&gt;
&nbsp;&nbsp;&nbsp; &lt;alias&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;family&gt;monospace&lt;/family&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;prefer&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="hilite2">&lt;!-- @@@ editable --&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;family&gt;NSimSun&lt;/family&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/prefer&gt;
&nbsp;&nbsp;&nbsp; &lt;/alias&gt;
&lt;!--
*******************************************************************************
&nbsp;&nbsp;&nbsp; 1. Fonts family configuration [End]
*******************************************************************************
--&gt;
&lt;!--
*******************************************************************************
&nbsp;&nbsp;&nbsp; 2. Fonts substitution [Begin]
*******************************************************************************
--&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; fonts alias substitution
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;宋体&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;SimSun&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;新宋体&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;NSimSun&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;宋体-18030&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;SimSun-18030&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;新宋体-18030&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;NSimSun-18030&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;黑体&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;SimHei&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;微软雅黑&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Microsoft YaHei&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;文泉驿正黑&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;WenQuanYi Zen Hei&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; not installed fonts substitution
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Times&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Times New Roman&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Helvetica&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Verdana&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Courier&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Courier New&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;PMingLiU&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;MingLiU&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;FangSong_GB2312&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;KaiTi_GB2312&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;AR PL KaitiM GB&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;AR PL KaitiM Bit5&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;AR PL SungtiL GB&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;AR PL Mingti2L Bit5&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;AR PL ShanHeiSun Uni&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;AR PL ZenKai Uni&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Bitstream Vera Serif&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Bitstream Vera Sans&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Bitstream Vera Sans Mono&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;DejaVu Sans&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;DejaVu Sans Mono&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;DejaVu Serif&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;ＭＳ 明朝&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;ＭＳ ゴシック&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Kochi Mincho&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Kochi Gothic&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Baekmuk Batang&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Baekmuk Dotum&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Baekmuk Gulim&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Baekmuk Headline&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;san-serif&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; english portion substitution
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;serif&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;prepend&quot; binding=&quot;strong&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="hilite2">&lt;!-- @@@ editable --&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Georgia&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;sans-serif&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;prepend&quot; binding=&quot;strong&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="hilite2">&lt;!-- @@@ editable --&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Verdana&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;monospace&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;family&quot; mode=&quot;prepend&quot; binding=&quot;strong&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="hilite2">&lt;!-- @@@ editable --&gt;</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Courier New&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
*******************************************************************************
&nbsp;&nbsp;&nbsp; 2. Fonts substitution [End]
*******************************************************************************
--&gt;
&lt;!--
*******************************************************************************
&nbsp;&nbsp;&nbsp; 3. Global configuration [Begin]
*******************************************************************************
--&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; target dots per inch, change dpi to 96
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;dpi&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;96&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; enable sub-pixel rendering.
&nbsp;&nbsp;&nbsp; if you are using CRT, set rgb -&gt; none
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;font&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;rgba&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;none&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; default Fonts setting
&nbsp;&nbsp;&nbsp; here autohint = ture / hinting = false is for free fonts in your system
&nbsp;&nbsp;&nbsp; we will use autohint = false / hinting = true for MS core fonts
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;font&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;antialias&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hinting&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;hintfull&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; font size settings:
&nbsp;&nbsp;&nbsp; set the apposite font size,so it is easy to be read
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;pattern&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;pixelsize&quot; compare=&quot;more_eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;8&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;pixelsize&quot; compare=&quot;less_eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;12&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;pixelsize&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;12&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; synthetic emboldening for fonts that do not have bold face available
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;font&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- check to see if the font is just regular --&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;weight&quot; compare=&quot;less_eq&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;int&gt;100&lt;/int&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- check to see if the pattern requests bold --&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test target=&quot;pattern&quot; name=&quot;weight&quot; compare=&quot;more_eq&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;int&gt;180&lt;/int&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- set the embolden flag --&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;embolden&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
*******************************************************************************
&nbsp;&nbsp;&nbsp; 3. Global configuration [End]
*******************************************************************************
--&gt;
&lt;!--
*******************************************************************************
&nbsp;&nbsp;&nbsp; 4. English fonts configuration [Begin]
*******************************************************************************
--&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; default : smoothed and hinted
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;font&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;foundry&quot; qual=&quot;any&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;monotype&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;microsoft&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;antialias&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hinting&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;hintfull&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; for point size less equal than 6 : only smoothed
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;font&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;foundry&quot; qual=&quot;any&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;monotype&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;microsoft&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;size&quot; compare=&quot;less_eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;6&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;antialias&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hinting&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; Arial Regular
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;font&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Arial&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;weight&quot; compare=&quot;eq&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;regular&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;slant&quot; compare=&quot;eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;roman&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;size&quot; compare=&quot;more_eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;7&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;size&quot; compare=&quot;less_eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;13&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;antialias&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hinting&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;hintfull&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; Times New Roman Bold Italic
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;font&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Times New Roman&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;weight&quot; compare=&quot;eq&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;bold&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;slant&quot; compare=&quot;eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;italic&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;size&quot; compare=&quot;more_eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;7&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;size&quot; compare=&quot;less_eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;13&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;antialias&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hinting&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;hintfull&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; Courier New:
&nbsp;&nbsp;&nbsp; both enable autohint and hinting looks very well.
--&gt;
&nbsp;&nbsp; &lt;match target=&quot;font&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Courier New&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;antialias&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hinting&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;hintfull&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; Courier New font size
--&gt;
&nbsp;&nbsp; &lt;match target=&quot;font&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;family&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Courier New&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;pixelsize&quot; compare=&quot;less_eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;14.7&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;pixelsize&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;14.7&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
*******************************************************************************
&nbsp;&nbsp;&nbsp; 4. English fonts configuration [End]
*******************************************************************************
--&gt;
&lt;!--
*******************************************************************************
&nbsp;&nbsp;&nbsp; 5. CJK fonts configuration [Begin]
*******************************************************************************
--&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; the dual-width Asian fonts (spacing=dual) are not rendered correctly,
&nbsp;&nbsp;&nbsp; apparently FreeType forces all widths to match. Trying to disable the
&nbsp;&nbsp;&nbsp; width forcing code by setting globaladvance=false alone doesnot&nbsp; help.
&nbsp;&nbsp;&nbsp; as a brute force workaround, also set spacing=proportional, i.e. handle
&nbsp;&nbsp;&nbsp; them as proportional fonts:
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;font&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test target=&quot;pattern&quot; name=&quot;lang&quot; compare=&quot;contains&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;zh&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;ja&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;ko&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;spacing&quot; compare=&quot;eq&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;dual&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;spacing&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;proportional&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;globaladvance&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; adjusting
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;font&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test qual=&quot;any&quot; name=&quot;family&quot; compare=&quot;eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- installed fonts --&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;STHeiti&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;Microsoft YaHei&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;SimHei&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;SimSun&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;NSimSun&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;SimSun-18030&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;NSimSun-18030&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;WenQuanYi Bitmap Song&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;WenQuanYi Zen Hei&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;rgba&quot; mode=&quot;assign&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;none&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;antialias&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;autohint&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hinting&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;hintstyle&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;const&gt;hintfull&lt;/const&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;embeddedbitmap&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;true&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
&nbsp;&nbsp;&nbsp; enable embedded bitmap fonts
&nbsp;&nbsp;&nbsp; non-bitmap:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STHeiti: sthei.ttf 13563000 bytes
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Microsoft YaHei: msyh.ttf 15043584 bytes
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SimHei: simhei.ttf 10044356 bytes
&nbsp;&nbsp;&nbsp; with bitmap:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SimSun/NSimSun: simsun.ttf 10500792 bytes
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SimSun-18030/NSimSun-18030: simsun-18030.ttf 12642204
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WenQuanYi Zen Hei: wqy-zenhei.ttf 12844372 bytes
&nbsp;&nbsp;&nbsp; checked by Linux tool: fontforge
--&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;font&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test qual=&quot;any&quot; name=&quot;family&quot; compare=&quot;eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;SimSun&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;NSimSun&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;SimSun-18030&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;NSimSun-18030&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;pixelsize&quot; compare=&quot;eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;12&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;13&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;14&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;15&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;16&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;18&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;antialias&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;font&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test qual=&quot;any&quot; name=&quot;family&quot; compare=&quot;eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;WenQuanYi Bitmap Song&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;pixelsize&quot; compare=&quot;more_eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;9&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;pixelsize&quot; compare=&quot;less_eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;12&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;antialias&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&nbsp;&nbsp;&nbsp; &lt;match target=&quot;font&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test qual=&quot;any&quot; name=&quot;family&quot; compare=&quot;eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;string&gt;WenQuanYi Zen Hei&lt;/string&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;test name=&quot;pixelsize&quot; compare=&quot;eq&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;12&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;13&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;15&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;double&gt;16&lt;/double&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/test&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;edit name=&quot;antialias&quot; mode=&quot;assign&quot; &gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;bool&gt;false&lt;/bool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/edit&gt;
&nbsp;&nbsp;&nbsp; &lt;/match&gt;
&lt;!--
*******************************************************************************
&nbsp;&nbsp;&nbsp; 5. CJK fonts configuration [End]
*******************************************************************************
--&gt;
&lt;/fontconfig&gt;
</pre>
<p>
上面的字体配置使用3种虚拟字体：
</p>
<ul>
	<li>衬线字体：Serif<br />
	</li>
	<li>非衬线字体：Sans-serif/Sans serif/Sans </li>
	<li>等宽字体：Monospace/Mono</li>
</ul>
<p>
虚拟字体已经被定义在/etc/fonts/conf.d/ 下面的配置文件中，并拥有了一个字体列表，以上字体配置中的字体会被加在顶部，具有更高的优先级。并且，/etc/fonts/fonts.conf 中也为虚拟字体添加了可能采用的别名，比如mono。有关衬线字体与非衬线字体，请参看：<a href="http://yx.takeback.net/121/serif-font.html">细说字体 Sans Serif 与 Serif</a> 
</p>
<p>
在上面，我定义了：对于衬线字体，中文使用宋体，英文使用Georgia；非衬线的字体，中文使用微软雅黑，英文使用Verdana；等宽字体，中文使用新宋体，英文使用Courier New，共6种字体。其中，除了中文字体需要自己额外安装以外，其它英文字体默认已经存在于/usr/share/fonts/corefonts 目录，它们属于media-fonts/corefonts ，如果你找不到这些字体，可以emerge 这个包。
</p>
<p>
如果想换不同的口味，只需要把上述6处字体名称替换为系统中已经安装的字体即可，为了方便配置，我在每一处增加了<span class="hilite2">&lt;!-- ＠＠＠ editable --&gt;</span> 这样的注释。
</p>
<p>
另外，有人觉得/etc/fonts/conf.d 下面的配置文件没什么用处，还可能干扰自己的配置，可以删除了事。我仔细看过，不提倡删除，如果删除的话，以下2个文件一定要保留，否则fontconfig 就不会读取~/.fonts.conf 与/etc/fonts/local.conf ，它们是这2个配置文件的装载入口。
</p>
<ul>
	<li>50-user.conf</li>
	<li>51-local.conf <br />
	</li>
</ul>
<p>
下面是雅黑的效果截图：
</p>
<p>
<a href="http://www.aiview.com/ref/2008/01/screenshot-msyh.jpg"><img src="http://www.aiview.com/ref/2008/01/screenshot-msyh-thumb.jpg" alt="screenshot-msyh.jpg" width="307" height="239" /></a>
</p>
<h4>字体有关的命令&nbsp;</h4>
<p>
下面介绍几个字体有关的命令，在配置过程中可能会用来进行配置的确认、除错等。
</p>
<h5>fc-list</h5>
<p>
列出系统中所有可用的字体名称（包含中英文别名），以及支持的style。
</p>
<p>
命令后面可加字体名称，但必须是全称，不支持通配符，否则无法匹配。如果是中文字体，要求环境为UTF-8，否则匹配不成功，输出也是乱码。字体名称如果包含空格，使用引号引起。 
</p>
<p>
虚拟字体不会被列出。 
</p>
<h5>fc-match &nbsp;</h5>
<p>
列出字体文件名称、英文名称，不支持中文字体名匹配。同样不支持通配符，但支持虚拟字体，可以列出虚拟字体中优先级最高的字体。可以使用-v 参数输出字体详细信息。&nbsp;
</p>
<p>
对于配置文件中进行过字体替换的字体，fc-match 会输出替换后的字体名称
</p>
<pre class="cmd">
$ fc-match courier
</pre>
<pre class="output">
cour.ttf: &quot;Courier New&quot; &quot;Normal&quot;
</pre>
<h5>fc-cat</h5>
<p>
从cache 文件中读取字体信息，很少用到。
</p>
<p>
以上三个命令来自media-libs/fontconfig，属于xft 的命令。
</p>
<h5>xlsfonts</h5>
<p>
xlsfonts 也用于列出字体，但格式不同，此外，它也可以列出一些未被xft 系统识别并cache 的字体。同时这个命令也支持通配符。
</p>
<pre class="cmd">
$ xlsfonts -fn &quot;*sim*&quot;
</pre>
<pre class="output">
-misc-simhei-medium-r-normal--0-0-0-0-p-0-iso10646-1
-misc-simsun 18030-medium-r-normal--0-0-0-0-m-0-iso10646-1
-misc-simsun 18030-medium-r-normal--0-0-0-0-m-0-iso8859-1
-misc-simsun 18030-medium-r-normal--0-0-0-0-m-0-koi8-r
-misc-simsun-medium-r-normal--0-0-0-0-p-0-iso10646-1
-misc-simsun-medium-r-normal--0-0-0-0-p-0-iso8859-1
-misc-simsun-medium-r-normal--0-0-0-0-p-0-koi8-r
</pre>
<p>
如果系统中找不到这个命令，需要emerge x11-apps/xlsfonts
</p>
<h5>fontforge</h5>
<p>
这是一个GUI 程序，可用于编辑字体文件，同时也可以获得大量的字体信息，比如一个TrueType 字体是否内嵌了点阵字体，size是多少。对于MS的宋体，fontforge 只能识别出部分size 的点阵字体：12、14、16，13、15、18 则识别不出来，开时我认为是字体文件的版本问题，后来看了quanliking 的回帖才知道是fontforge 的问题。
</p>
<p>
如果系统中找不到这个命令，需要emerge&nbsp; media-gfx/fontforge
</p>
<h4>Tips</h4>
<p>
如果字体没有变化，仅仅修改了字体配置文件，如果使用fc-match 这样的命令，不需要重启Xwindow。对于其它应用程序，比如gedit，仅仅重新运行这个程序即可应用新的配置，但有些应用程序则需要重启动Xwindow 才可以应用新的配置，比如gnome-terminal 。了解这些可以在测试字体配置的时候节省一些时间。
</p>
<h4>下载</h4>
<ul>
	<li>fontconfig 配置文件：<a href="../../ref/2008/01/fonts.conf">.fonts.conf</a>（如果直接使用这个文件，请重命名为 .fonts.conf，下载的文件名中没有点）</li>
	<li>因为版权问题，不提供一些字体的下载，在Windows 系统以及本文链接的文章中可以找到。<br />
	</li>
</ul>
<h4>延展阅读</h4>
<ul>
	<li><a href="http://anakin.ncst.ernet.in/~aparna/consolidated/index.html">Free/Open Source Software Localization</a></li>
	<li><a href="http://www.linuxsir.org/bbs/showthread.php?t=266659">Linux 字体微调 - windows  效果版</a> <br />
	</li>
	<li><span class="navbar"></span><a href="http://www.google.com/url?sa=t&amp;ct=res&amp;cd=2&amp;url=http%3A%2F%2Fwww.linuxsir.org%2Fbbs%2Fshowthread.php%3Ft%3D269312&amp;ei=cAqbR_yfH5yK6gOSp6GTCA&amp;usg=AFQjCNGVMDz5TQmAmP0kB6UexVAcNfE1HQ&amp;sig2=6axzlQ8z1fitUMYrw78vDg" target="_blank" onmousedown="return rwt(this,'','','res','2','AFQjCNGVMDz5TQmAmP0kB6UexVAcNfE1HQ','&sig2=6axzlQ8z1fitUMYrw78vDg')">Linux 字体微调- Vista 效果版</a><span class="navbar"> <br />
	</span></li>
	<li><span class="navbar"></span><a href="http://www.freebsdchina.org/forum/viewtopic.php?t=34824&amp;start=0&amp;postdays=0&amp;postorder=asc&amp;highlight=" class="maintitle">字体配置local.conf详解[带Win效果和AA效果]</a><span class="navbar"></span></li>
	<li><a href="http://yx.takeback.net/121/serif-font.html">细说字体 Sans Serif 与 Serif</a></li>
	<li><a href="http://www.xfree86.org/current/fonts.html">关于字体和字体微调（Hinting ）的知识</a></li>
	<li><a href="http://wqy.sourceforge.net/cgi-bin/index.cgi?FAQ#_1_1">&ldquo;文泉驿&rdquo;用户常见问题解答</a>（可以了解不少基础知识） </li>
	<li><a href="http://edt1023.sayya.org/fontconfig/fontconfig-user.html" title="AEN1">Fonts in XFree86</a></li>
	<li><a href="http://edt1023.sayya.org/fontconfig/fontconfig-user.html">fonts-conf</a>（fontconfg 配置文件参考，想自己动手的必看，翻译版）<a href="http://edt1023.sayya.org/fontconfig/fontconfig-user.html" title="AEN1">
	</a> </li>
	<li><a href="http://www.prismo.ch/comparisons/notebook.php">Notebook LCD Display Comparison</a>（计算LCD DPI）</li>
	<li><a rel="bookmark" href="http://my.donews.com/alangs/2006/08/31/mac_apple_stheiti_ttf_download/" title="Permanent Link: 苹果的华文黑体效果非常棒_mac_STHeiti_ttf">苹果的华文黑体效果非常棒_mac_STHeiti_ttf</a></li>
	<li><a href="http://bluesprite.itpub.net/post/157/161415">我的字体美化方案(Dapper+WQY+MSfont)</a></li>
	<li><a href="http://www.linuxsir.org/bbs/showthread.php?t=289738">字体设置小结(一种简单易行的方案)</a></li>
</ul>
（未完）
]]></description>
<link>http://www.aiview.com/2008/01/gentoo_linuxon_t43_7_chinese_fonts.html</link>
<guid>http://www.aiview.com/2008/01/gentoo_linuxon_t43_7_chinese_fonts.html</guid>
<category>Linux</category>
<pubDate>Sat, 26 Jan 2008 23:35:47 +0700</pubDate>
</item>
<item>
<title>Gentoo Linux on T43 (6) 中文环境</title>
<description><![CDATA[<p>
如果是初次安装Gentoo 系统与配置中文环境，在读接下来内容之前，建议首先阅读<a href="http://www.gentoo.org/doc/en/guide-localization.xml">Gentoo Linux Localization Guide</a>。
</p>
<h4>Locale</h4>
<p>
<a href="http://www.answers.com/main/ntquery?s=locale&amp;gwp=13#Wikipedia">
locale</a>  名称是一个具有命名约定、带有格式的字符串，其实质是其背后对应的字符集（codeset）。这里有一篇文章 <a href="http://bbs.linuxsir.org/showthread.php?t=245474">关于locale的设定 Simple HOWTO</a> 可以帮助理解locale ，虽然我并不完全同意文中的所有 观点。 
</p>
<p>
使用不带任何参数的locale命令可以查看当前系统中与locale 有关的变量，以及它们所采用的locale 名称。
</p>
<pre class="cmd">
$ locale
</pre>
<pre class="output">
LANG=en_US
LC_CTYPE=zh_CN
LC_NUMERIC=&quot;en_US&quot;
LC_TIME=&quot;en_US&quot;
LC_COLLATE=&quot;en_US&quot;
LC_MONETARY=&quot;en_US&quot;
LC_MESSAGES=&quot;en_US&quot;
LC_PAPER=&quot;en_US&quot;
LC_NAME=&quot;en_US&quot;
LC_ADDRESS=&quot;en_US&quot;
LC_TELEPHONE=&quot;en_US&quot;
LC_MEASUREMENT=&quot;en_US&quot;
LC_IDENTIFICATION=&quot;en_US&quot;
LC_ALL= &nbsp;
</pre>
<p>
在Gentoo 手册 <a href="http://www.gentoo.org/doc/zh_cn/handbook/handbook-x86.xml?part=1&amp;chap=6">6. 安装Gentoo基本系统</a> 最后一节，作为可选，简单的介绍了如何生成locale。Gentoo 提供了<span class="path">/etc/locale.gen 文件，用于指定为glibc 生成哪些locale，籍此来控制生成的locale 数量，减小系统体积。查看当前系统中已经生成并可用的locale 有哪些，使用以下命令：</span>
</p>
<pre class="cmd">
$ locale -a
</pre>
<pre class="output">
C
en_US
en_US.utf8
POSIX
zh_CN
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8
</pre>
<p>
<span class="path">所有生成的locale 会被放在 </span><span class="path">/usr/lib/locale/ 下面的子目录，并且与locale 名称同名（除字符集部分的大小写）。（由于历史原因，C 与POSIX 是2个很特殊的locale）</span>
</p>
<pre class="cmd">
$ ls -1 /usr/lib/locale/
</pre>
<pre class="output">
en_US
en_US.utf8
zh_CN
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8
</pre>
<p>
locale.gen 文件内容具有如下格式，空格之前是locale 名称，locale 名称中可以不包含字符集的部分，空格之后是所对应的字符集。
</p>
<pre class="code">
en_US ISO-8859-1
en_US.UTF-8 UTF-8 
</pre>
<p>
作为中文用户，为了系统可以正确的识别、显示并处理中文字符，必须生成与中文字符集有关的的额外locale。字符集可以采用以下之一：
</p>
<ul>
	<li>
	GB18030</li>
	<li>GBK</li>
	<li>GB2312</li>
	<li>UTF－8</li>
</ul>
<p>
其中除UTF-8&nbsp; 是Unicode 解决方案以外，其它三个是父子集关系，其中GBK18030 最为完整，但仍然建议按以下格式，添加GBK 与GB2312 字符集相关的locale 到locale.gen 文件：
</p>
<pre class="code">
en_US ISO-8859-1
en_US.UTF-8 UTF-8
zh_CN GB18030
<span class="hilite">zh_CN.GBK GBK
zh_CN.GB2312 GB2312</span>
zh_CN.UTF-8 UTF-8 
</pre>
<p>
为什么不单独使用最完整的GB18030 字符集？理由是为了向下与一些较早的应用程序保持兼容，这个方法来自于 <a href="http://forums.gentoo.org/viewtopic-t-269039-start-0-postdays-0-postorder-asc-highlight-.html?sid=c86cdcdaad7c33b0e0d6c59b80ed4db2" class="maintitle">最精简有效的 glibc locales 设定</a><span class="maintitle">。</span>
</p>
<p>
如果见到有些文章介绍使用/etc/locale.build 文件和不同的格式做类似的事情，不要奇怪，请用以下命令查看你的glibc 版本，如果大于等于glibc-2.3.6-r4 ，那么请用本文的文件名与格式，否则升级glibc 或者按他说的做。
</p>
<pre class="cmd">
$ emerge -s %^glibc$
</pre>
<pre class="output">
*  sys-libs/glibc
Latest version available: 2.6.1
Latest version installed: 2.6.1
</pre>
<h4>
设置locale 有关的环境变量</h4>
<p>
对于中文用户，一般可以分为2种
</p>
<ol>
	<li>一般性中文要求，仅要求系统具有中文的处理能力。<br />
	要求操作系统以及应用程序能够正确显示并处理中文字符，包括文件名、文本文件内容等，并且可以输入中文。</li>
	<li>全面性中文要求，要求中文界面。<br />
	在一般性要求之外，还要求操作系统以及应用程序的菜单、选项、以及消息等均尽可能以中文进行显示。 <br />
	</li>
</ol>
<p>
以上2种情况，分别对应了2种典型的locale 环境变量设置。
</p>
<h5>一般性中文要求 <br />
</h5>
<p>
很多软件开发者，或者在国外的中文用户，会采用这种方案，好处是：
</p>
<ul>
	<li>有助于测试软件</li>
	<li>避免术语翻译不当或者语言习惯所带来的困扰</li>
	<li>在不影响中文处理能力的前提下，最大化英文的使用范围</li>
</ul>
<p>
推荐的环境变量配置：
</p>
<pre class="code">
export LANG=en_US
export LC_CTYPE=zh_CN
</pre>
<h5>全面性中文要求</h5>
<p>
大部分普通用户会采用这种方案，对应的环境变量配置：
</p>
<pre class="code">
export LANG=zh_CN
export LC_ALL=zh_CN
</pre>
<p>
<a href="http://www.gentoo.org/doc/en/guide-localization.xml">这份指南中</a>说明了所有LC_* 和LANG 变量的作用与关系，额外设置LANG，也是为了对个别不支持LC_ALL 的应用程序保持兼容性。
</p>
<p>
建议将上述变量设置在日常用户的profile 当中，比如：/home/user/.bash_profile，不建议设置在系统级别，对于Gentoo 这个文件是：/etc/env.d/02locale
</p>
<h4>G_BROKEN_FILENAMES</h4>
<p>
G_BROKEN_FILENAMES 是一个与Glib 有关的环境变量，把它作为小标题是因为它十分关键，曾因为它带来了很多困扰。 
</p>
<p>
我们周围几乎所有的Windows 系统都设定为使用GB 编码中文文件名，而不是Unicode，任何Unicode 的编码的中文文件名在这些Windows下都会显示为乱码。因此我们与这样的Windows 系统交换包含中文文件名的文件，最好的方案就是也同样使用GB 编码文件名，这样就不会带来显而易见的麻烦。
</p>
<p>
通过以上的locale 设定，已经可以看出，我们的确在设定一个GB 编码的中文Gentoo ，而不是Unicode Gentoo，<span class="emphasis">但总有一些事情出乎我们的意料</span>。Gnome 以及几乎所有应用程序（已知除Gnome Terminal 以外）会无视以上的locale 设定，仍然使用UTF-8 编码中文文件名，以Nautilus 为代表，虽然他们可以同时正确的显示与处理GB 与UTF-8 编码的文件名，但另外的一些应用程序会说不，比如Gnome Terminal, Krusader 等等，其他Windows 用户或者FTP 用户也会抱怨。
</p>
<p>
要解决这个问题，就需要设置：
</p>
<pre class="code">
export G_BROKEN_FILENAMES=1 
</pre>
<p>
&nbsp;或者
</p>
<pre class="code">
export G_BROKEN_FILENAMES=yes 
</pre>
<p>
设置这个变量后，需要重新启动系统才能生效，或者至少logout 之后重新启动X Window，比如kill 掉X 后回到命令提示符，logout 之后重新login，再执行一个startx。
</p>
<p>
有关这个变量作用的更多信息，请参考<span class="entrytitle"><a href="http://blogs.sun.com/yydzero/entry/display_name_of_filename_in">Display Name of Filename in Glib</a> 。</span>
</p>
<h4>中文输入法 Scim</h4>
<p>
Linux 下的中文输入法有很多，Xsim, Scim, Chinput, Xcin, Fcitx等等，我现在使用<a href="http://www.scim-im.org/wiki/documentation/installation_and_configuration/gentoo">Scim</a> ，其功能类似Windows下的紫光输入法，可以整句输入，也会动态加入新的词组并调整词频，但其智能性与现今Windows 平台的搜狗或者Google 输入法还有差距。
</p>
<p>
<a href="http://www.scim-im.org/wiki/documentation/installation_and_configuration/gentoo">Scim for Gentoo</a> 安装过程比较简单，我使用gnome 环境，没有安装kde，但安装了几个特别需要的kde 应用程序，因此，我的系统上也有qt3，qt4 以及kde 应用所必需的包。
</p>
<h5>For gnome&nbsp;</h5>
<p>
首先，要让Scim 在gnome 环境工作，需要以下步骤：
</p>
<ul>
	<li>在make.conf 的USE 变量中加入 nls cjk unicode，如果它们还不在的话。</li>
	<li>为了安全起见，执行以下命令来检查是否有软件包会被这些新的USE 变量影响，如果有的话，那么就继续执行，否则退出即可。</li>
</ul>
<pre class="cmd">
# emerge -av --newuse world
</pre>
<ul>
	<li>执行以下命令安装Scim</li>
</ul>
<pre class="cmd">
# emerge -av scim scim-pinyin
</pre>
<ul>
	<li>设置以下环境变量（对于gnome 环境未设置也没有发现问题）：</li>
</ul>
<pre class="code">
export XMODIFIERS=@im=SCIM    #case matters for this variable!
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim
</pre>
<p>
重启系统，即可以在gnome 应用中使用ctrl+space 调出Scim 使用。
</p>
<h5>For kde&nbsp;</h5>
<p>
为了能在kde 应用程序中调用Scim，需要继续完成以下步骤，如果不打算使用kde 应用程序，也可以跳过。
</p>
<ul>
	<li>在make.conf 的USE 变量中加入immqt-bc <br />
	</li>
	<li>执行以下命令，确保qt3 使用immqt-bc USE flag 编译，否则，接下来的步骤会出错。</li>
</ul>
<pre class="cmd">
# emerge -av =qt-3*
</pre>
<pre class="output">
[ebuild   R   ] x11-libs/qt-3.3.8-r4  USE=&quot;cups gif <span class="hilite2">immqt-bc*</span> mysql opengl xinerama -debug -doc -examples -firebird -immqt -ipv6 -nas -nis -odbc -postgres -sqlite&quot; 135 kB 
</pre>
<ul>
	<li>接下来安装qt 环境中用于支持im-module 的软件包(gnome 的gtk 内建im-module 支持) 以及skim：</li>
</ul>
<pre class="cmd">
# emerge -av scim-qtimm skim
</pre>
<p>
安装完成后，就可以在kde 应用程序中使用scim 了。
</p>
<p>
在gnome 与kde 中scim 有2套不同的配置界面与输入条，具体使用哪一个，可以在选项中的General Scim 的Other 标签页中设置，当然，也可以不去关心它。
</p>
<p>
在kde 中配置Scim，花费了我不少时间，以下几篇是我参考的Scim 官方资源：<a href="http://www.scim-im.org/wiki/documentation/installation_and_configuration/gentoo/system_configuration">安装简介for Gentoo</a>，更详细的<a href="http://www.scim-im.org/wiki/documentation/installation_and_configuration/gentoo/system_configuration">安装指南for Gentoo</a>，针对一般Linux 发布的<a href="http://www.scim-im.org/wiki/documentation/installation_and_configuration/all/system_configuration">安装指南</a>，但也有一定的参考价值。 
</p>
<h5>非必须步骤&nbsp;</h5>
<p>
以下步骤在安装指南 中有所提及，但经试验并非必须。
</p>
<ul>
	<li>安装scim-tables：&nbsp;</li>
</ul>
<pre class="cmd">
$ emerge app-i18n/scim-tables
</pre>
<h4>访问其它非Linux 分区</h4>
<p>
通常，移动硬盘、U盘、存储卡、MP3、Thinkpad 的第二块硬盘等移动设备，以及双启动的系统中会包含非Linux 分区，一般来说，它们会采用与Windows 兼容的FAT 分区，个别也可能是NTFS 分区。为了能在这些设备上正确显示和处理中文文件名，需要在mount 选项中指定字符集。 
</p>
<p>
mount 是Linux 中一个基本的命令，可以将包括本地文件系统在内的多种文件系统映射为一个本地路径， 由于不同文件系统的特性差别，mount 针对不同的文件系统均支持一组不同的选项，这里需要用到iocharset。
</p>
<p>
对于FAT 或者NTFS 类型的分区，我们需要在mount 选项中包含：
</p>
<pre class="code">
iocharset=gb2312&nbsp;
</pre>
<p>
迄今为止，我们还不能在这里指定其它更完整的GB字符集：gbk 与gb18030 。对于NTFS 分区，新增一个选项nls，与原有iocharset 意义相同，仅仅是为了替换它，旧的选项也保留着。nls 在其它分区类型却没有提供，因此如果喜欢使用新的选项nls 那么需要注意其仅仅针对NTFS 分区有效。
</p>
<p>
针对不同的设备，我的fstab 如下：
</p>
<pre class="code">
# 双启动Windows分区
/dev/sda3               /mnt/w          vfat            noauto,noatime,user,ro,codepage=936,iocharset=gb2312    0 0
# 第二块硬盘 
#/dev/sdb2              /mnt/m          ntfs            noauto,noatime,user,iocharset=gb2312    0 0                                                                        
# usb 设备
/dev/sdc1               /mnt/u1         auto            noauto,noatime,user,iocharset=gb2312    0 0
/dev/sdc2               /mnt/u2         auto            noauto,noatime,user,iocharset=gb2312    0 0
/dev/sdc3               /mnt/u3         auto            noauto,noatime,user,iocharset=gb2312    0 0
/dev/sdc4               /mnt/u4         auto            noauto,noatime,user,iocharset=gb2312    0 0
/dev/sdc5               /mnt/u5         auto            noauto,noatime,user,iocharset=gb2312    0 0
# 光驱
/dev/sr0                /mnt/dvd        auto            noauto,noatime,user,ro,iocharset=gb2312    0 0
</pre>
<p>
说明：
</p>
<ol>
	<li>针对vfat 分区，为了安全起见，额外指定了codepage 选项，依据文档，似乎与8.3 短文件名转换有关，但我还不知道其具体会在什么情况下起作用。</li>
	<li>对于usb 设备，分区类型指定auto，而不限制在vfat，以增加灵活性。</li>
	<li>同样，光驱设备也没有限制为iso9660，指定了auto，原因同上。</li>
</ol>
<p>
如果不打算定义在fstab 中，只在命令行临时mount，或者为了测试，使用以下格式：
</p>
<pre class="cmd">
# mount -t vfat -o codepage=936,iocharset=gb2312 /dev/sda3 /mnt/w
# mount -t auto -o iocharset=gb2312 /dev/sdc1 /mnt/u1 
</pre>
<h4>延展阅读</h4>
<ul>
	<li><a href="http://www.gentoo.org/doc/en/guide-localization.xml">Gentoo Linux Localization Guide</a></li>
	<li><a href="http://www.answers.com/main/ntquery?s=locale&amp;gwp=13#Wikipedia">
	locale at wikipedia</a> <br />
	</li>
	<li><a href="http://bbs.linuxsir.org/showthread.php?t=245474">关于locale的设定 Simple HOWTO</a></li>
	<li><a href="http://forums.gentoo.org/viewtopic-t-269039-start-0-postdays-0-postorder-asc-highlight-.html?sid=c86cdcdaad7c33b0e0d6c59b80ed4db2" class="maintitle">最精简有效的 glibc locales 设定</a><span class="maintitle"></span></li>
	<li><a href="http://blogs.sun.com/yydzero/entry/display_name_of_filename_in">Display Name of Filename in Glib</a></li>
	<li><a href="http://www.gtk.org/api/2.6/glib/glib-running.html" class="refentrytitle">Running GLib Applications</a> </li>
	<li><a href="http://hektor.umcs.lublin.pl/~mikosmul/computing/articles/linux-unicode.html">Introduction to Unicode &mdash; Using Unicode in Linux</a></li>
	<li><a href="http://www.linux-ren.org/modules/news/article.php?storyid=242" class="itemTitle">将 locale 从 zh_CN.GB2312 转到 zh_CN.UTF-8 的一些问题和解决方法</a></li>
	<li><a href="http://www.scim-im.org/wiki/documentation/installation_and_configuration/gentoo/system_configuration">Scim 安装简介for Gentoo</a></li>
	<li><a href="http://www.scim-im.org/wiki/documentation/installation_and_configuration/gentoo/system_configuration">更详细的Scim 安装指南for Gentoo</a></li>
	<li><a href="http://www.scim-im.org/wiki/documentation/installation_and_configuration/all/system_configuration">针对一般Linux 发布的Scim 安装指南</a></li>
</ul>
<p>
（ 未完）
</p>
]]></description>
<link>http://www.aiview.com/2008/01/gentoo_linux_on_t43_6_chinese_environment.html</link>
<guid>http://www.aiview.com/2008/01/gentoo_linux_on_t43_6_chinese_environment.html</guid>
<category>Linux</category>
<pubDate>Fri, 18 Jan 2008 03:05:23 +0700</pubDate>
</item>
<item>
<title>Gentoo Linux on T43 (5) 配置内核(kernel)</title>
<description><![CDATA[<p dir="ltr">
以下的内容，适合于正在按照Gentoo手册安装Gentoo Linux 系统，并且已经进行到：第7部分 <a href="http://www.gentoo.org/doc/zh_cn/handbook/handbook-x86.xml?part=1&amp;chap=7">配置内核</a> 的人。此外，也适合那些已经安装了Gentoo 系统，打算调整内核配置或者需要升级内核的人。
</p>
<p dir="ltr">
<span class="emphasis">
内核版本：gentoo-sources-2.6.23</span>&nbsp;
</p>
<h4>不同的内核</h4>
<p>
在网络上，我们经常会看到很多命名不同的Linux kernel  以及它们所对应的patchs，比如: git-sources, mm-sources 等等，它们分别代表了不同的含义，vanilla-sources 是<a href="http://www.kernel.org/">官方</a> 的定期发布版本，未经过任何修改与patch，而git-sources 则每天更新，是vanilla-sources 的开发快照。其它的，诸如mm-sources 是一个增加了补丁集合的版本，由Andrew Morton 进行维护。
</p>
<p>
这些kernel 也包含在Gentoo 的官方Package 列表里面，可以使用emerge 命令进行安装（虽然Gentoo 并不推荐），Gentoo 也为它们提供了一个<a href="http://www.gentoo.org/doc/en/gentoo-kernel.xml">概要的描述</a> 。
</p>
<p>
在Gentoo手册中要求安装的gentoo-sources 也与它们类似，属于Gentoo Team 维护的一个经过patch 的版本。我们接下来的讨论都是基于此内核。
</p>
<h4>T43 有关的内核配置</h4>
<p>
这一节讨论与硬件有关的内核配置选项，以下的内容源于我在网上查找的资料以及自己的经验，有出处的的方我尽量附上链接。对于内核中配置的选择，我尽量摒除无用的选项，以减小内核文件的体积和生成的Modules 规模，但由于我的知识所限，以及个人喜好，仍然会有很多有争议的的方，如果您认为是一个错误，欢迎指正。
</p>
<p>
T43 不同型号的配置可能会有差别，
以下每一项设备后面，都标出了可能配备的硬件型号，这些硬件信息来源于<a href="http://www.thinkwiki.org/">ThinkWiki</a> ，在开始之前，多花些时间，<a href="http://www.thinkwiki.org/wiki/Category:T43">了解您的Thinkpad 含有哪些硬件</a>，是值得的。
</p>
<h5>CPU</h5>
<p>
<a href="http://www.thinkwiki.org/wiki/Intel_Pentium_M_%28Dothan%29" title="Intel Pentium M (Dothan)">Intel Pentium M (Dothan)</a> 1.6, 1.73, 1.86, 2.0, 2.13 or 2.26 GHz CPU 
</p>
<pre class="code">
CONFIG_X86_PC=y
CONFIG_MPENTIUMM=y
CONFIG_X86_GENERIC=y
</pre>
<h5>主板南桥&nbsp;</h5>
<p>
<a href="http://www.thinkwiki.org/wiki/Intel_82801FBM" title="Intel 82801FBM">Intel 82801FBM</a> ICH6-M southbridge
</p>
<pre class="code">
CONFIG_I2C_I801=m&nbsp;
</pre>
<h5>电源管理</h5>
<pre class="code">
CONFIG_PM=y
CONFIG_PM_SLEEP=y
CONFIG_SUSPEND_UP_POSSIBLE=y
CONFIG_SUSPEND=y
CONFIG_HIBERNATION_UP_POSSIBLE=y
CONFIG_ACPI=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_FAN=m
CONFIG_ACPI_DOCK=m
CONFIG_ACPI_BAY=m
CONFIG_ACPI_PROCESSOR=m
CONFIG_ACPI_THERMAL=m
CONFIG_ACPI_BLACKLIST_YEAR=0
CONFIG_ACPI_DEBUG=y
CONFIG_ACPI_DEBUG_FUNC_TRACE=y
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_SYSTEM=y
CONFIG_X86_PM_TIMER=y
</pre>
<h5>CPU 频率调节</h5>
<pre class="code">
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_X86_ACPI_CPUFREQ=m
</pre>
<h5>Fn + Keys</h5>
<pre class="code">
CONFIG_THINKPAD_ACPI=m
CONFIG_THINKPAD_ACPI_BAY=y
</pre>
<h5>硬盘/光驱</h5>
<ul>
	<li> 40, 60 or 80GB PATA HDD<sup><a href="http://www.thinkwiki.org/wiki/Category:T43#footnotes">1</a></sup> <br />
	</li>
	<li> <a href="http://www.thinkwiki.org/wiki/UltraBay" title="UltraBay">UltraBay Slim</a> with one of the following:</li>
	<ul>
		<li>DVD-ROM</li>
		<li>DVD-ROM/CD-RW Combo</li>
		<li>DVD&plusmn;RW</li>
	</ul>
</ul>
<p>
<a href="http://zhidao.baidu.com/question/5290976.html?fr=qrl3">有关PATA</a> ，其实就是传统的、使用扁线缆的ATA 硬盘，是对应新的SATA 硬盘而提出的名称。T43 使用PATA 硬盘，但控制器是SATA 的。
</p>
<p>
前面文章中，提到了<a href="http://www.aiview.com/2007/12/gentoo_linux_on_t43_2_before_starting.html#1">硬盘／光驱设备名称的问题</a> ，以下的设置会决定设备使用哪一种驱动程序，也决定了设备名使用sd* ，还是hd*。
</p>
<p>
如果打开CONFIG_IDE 选项，那么设备将会识别为hd* ，即使同时打开了scsi 的有关选项。因此，应该关闭CONFIG_IDE 及其以下的所有选项，无论它看起来多么正确，或者你仅仅为了保持兼容性，它都会强制使用落后的驱动程序，硬盘传输速度将遭受明显损失，CPU 占用率也明显提高。方案来源：<a href="http://forums.gentoo.org/viewtopic-t-579971-start-25-postdays-0-postorder-asc-highlight-.html" class="maintitle">Desktop Lags under Heavy IO</a> 
</p>
<pre class="code">
# CONFIG_IDE is not set
#
# SCSI device support
#
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
CONFIG_SCSI_NETLINK=y
CONFIG_SCSI_PROC_FS=y
#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_DEV_SR=y
CONFIG_CHR_DEV_SG=y
#
# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
#
CONFIG_SCSI_WAIT_SCAN=m
#
# SCSI Transports
#
CONFIG_SCSI_SPI_ATTRS=y
CONFIG_SCSI_FC_ATTRS=m
CONFIG_ATA=y
CONFIG_ATA_ACPI=y
CONFIG_ATA_PIIX=y
CONFIG_PATA_MPIIX=m
CONFIG_MD=y
CONFIG_BLK_DEV_DM=y
CONFIG_DM_CRYPT=y
</pre>
<h5>显卡<br />
</h5>
<ul>
	<li> <a href="http://www.thinkwiki.org/wiki/Intel_915GM" title="Intel 915GM">Intel 915GM</a> northbridge with integrated <a href="http://www.thinkwiki.org/wiki/Intel_Graphics_Media_Accelerator_900" title="Intel Graphics Media Accelerator 900">Intel Graphics Media Accelerator 900</a> <a rel="nofollow" href="http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&amp;lndocid=MIGR-58317#vid" title="http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&amp;lndocid=MIGR-58317#vid" class="external text">(no dvi docking support)</a> using shared system RAM （未测试）
	</li>
	<li> <a href="http://www.thinkwiki.org/wiki/Intel_915PM" title="Intel 915PM">Intel 915PM</a> northbridge and an <a href="http://www.thinkwiki.org/wiki/ATI_Mobility_Radeon_X300" title="ATI Mobility Radeon X300">ATI Mobility Radeon X300</a> with 64MB on-chip dedicated RAM
	</li>
</ul>
<p>
ATI X300 有2种驱动方案，一种是开源驱动，一种是ATI 官方的闭源驱动（已经加入Gentoo Package 列表），闭源驱动对3D 加速支持的更好一些，不过最近开源社区的R300 项目已经可以支持X300 显卡的3D 加速功能了。对于内核配置之外的内容，将来讨论。
</p>
<p>
以下内核选项对显卡系统起到支持作用，确保已经配置（来源于Gentoo ATI Radeon FAQ: <font face="Verdana" size="2"><a href="http://odin.prohosting.com/wedge01/gentoo-radeon-faq.html#2_kernelopts">2.1 - Which kernel options are important for the ATI drivers?</a>）</font> 
</p>
<pre class="code">
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_KMOD=y
CONFIG_PCI=y
CONFIG_MTRR=y
CONFIG_TMPFS=y
</pre>
<p>
下面讨论与显卡直接相关的内核选项。 
</p>
<p>
使用开源驱动程序，仅仅需要配置以下2项即可。 
</p>
<pre class="code">
CONFIG_DRM=m
CONFIG_DRM_RADEON=m
</pre>
<p>
CONFIG_DRM 与CONFIG_DRM_RADEON 编译为module 会分别对应为drm 与radeon 。
</p>
<p>
如果使用官方驱动，仅配置以下选项即可 
</p>
<pre class="code">
CONFIG_DRM=m
</pre>
<p>
另外一种选择，可以在内核disable CONFIG_DRM 选项，然后在外面emerge x11-base/x11-drm 软件包。 
</p>
<p>
有很多人在论坛上问，X300 是否需要配置CONFIG_AGP（对应agpgart module），X300是 PCIe 接口，经过测试，不需要配置CONFIG_AGP ，无论是内建，还是Module，虽然加入AGP 支持可能不会产生错误，但也不会带来任何性能提升。以下FAQ 也可以作为参考: <font face="Verdana" size="2"><a href="http://odin.prohosting.com/wedge01/gentoo-radeon-faq.html#2_kernelopts">2.1 - Which kernel options are important for the ATI drivers?</a></font>&nbsp;
</p>
<blockquote>
	<p>
	<font face="Verdana" size="2"><strong>NOTE 2:</strong> if you have a PCIe card,
	the AGP settings should be irrelevant. If you encounter problems, make
	sure you&#39;re using a recent kernel and the latest driver version. Some
	people have also reported that they had to enable AGP for their PCIe
	cards to work.<br />
	</font><font face="Verdana" size="2">
	<br />
	</font>...<font face="Verdana" size="2"><br />
	If you&#39;re using a PCIe card, then as
	noted above, it shouldn&#39;t be necessary to enable AGP, but it may be
	worth trying if you have problems.&nbsp; </font>
	</p>
	<font face="Verdana" size="2"></font>
</blockquote>
<h5>网卡</h5>
<p>
<a href="http://www.thinkwiki.org/wiki/Ethernet_Controllers" title="Ethernet Controllers">Broadcom 10/100/1000 Ethernet</a>
</p>
<pre class="code">
CONFIG_TIGON3=m&nbsp; 
</pre>
<h5>无线网卡 <br />
</h5>
<ul>
	<li> <a href="http://www.thinkwiki.org/wiki/IBM_11a/b/g_Wireless_LAN_Mini_PCI_Adapter_II" title="IBM 11a/b/g Wireless LAN Mini PCI Adapter II">IBM 11a/b/g Wireless LAN Mini PCI Adapter II</a>（使用第三方驱动）
	</li>
	<li> <a href="http://www.thinkwiki.org/wiki/Intel_PRO/Wireless_2200BG_Mini-PCI_Adapter" title="Intel PRO/Wireless 2200