伯朗 發表於 2008-9-8 18:47:57

RedHat 6.2中文字体TrueType的使用

<p>以下是使用步聚:<br /><br />建立字体存放目录,如:<br /><br />$ mkdir /usr/X11R6/lib/X11/fonts/TrueType<br /><br />使用 Windows 所带的字体:<br /><br />$ cd &quot;where_is_your_windows&quot;/fonts/<br />$ cp simsun.ttf /usr/X11R6/lib/X11/fonts/TrueType &lt;-- 拷贝简宋体<br /><br />生成 fonts.dir 文件<br /><br />$ cd /usr/X11R6/lib/X11/fonts/TrueType<br />$ ttmkfdir &gt; fonts.dir<br /><br />注:mkfontdir 用于生成点阵字体的 fonts.dir 文件,ttmkfdir 用于生成 TrueType 字体的 fonts.dir 文件。<br /><br />由于 ttmkfdir 不能识某些汉字TTF的编码,需手工修改。<br /><br />生成的 fonts.dir 如下:<br /><br />fonts.dir<br />======<br />1<br />simsun.ttf -misc-SimSun-medium-r-normal--0-0-0-0-p-0-ascii-0<br /><br />改为:<br /><br />simsun.ttf -misc-SimSun-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0<br /><br />生成 fonts.alias 文件<br /><br />$ cat fonts.dir &gt; fonts.alias<br /><br />将 fonts.alias 内容改为:<br /><br />SimSun -misc-SimSun-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0<br /><br />将字体路径加入配置:<br /><br />如果你的字体搜索路径是 FontPath &quot;unix/:-1&quot; 的话,说明你是使用 xfs 作为字体搜索的,这是 RedHat 的默认配置。此配置适用于<a class="UBBWordLink" href="#" target="_blank">网络</a>用户,对于PC用户并无意义。建议在 XFree86 的配置文件中直接指定常用字体搜索路径。以下对这两种<a class="UBBWordLink" href="#" target="_blank">方法</a>的<a class="UBBWordLink" href="#" target="_blank">设置</a>做个简要的说明:<br /><br />1. 使用 xfs (RedHat 的默认配置)<br /><br />勿需修改 /etc/X11/XF86Config 文件。<br /><br />$ su<br /># chkfontpath -add /usr/X11R6/lib/X11/fonts/TrueType<br /><br />如无问题的话,可使用 chkfontpath --list 显示所有的搜索路径。<br /><br />2. 不使用 xfs (推荐)<br /><br />打开 /etc/X11/XF86Config 文件,将原 FontPath 取消:<br /><br /># FontPath &quot;unix/:-1&quot;<br /><br />加入所有的字体路径:<br /><br />FontPath &quot;/usr/X11R6/lib/X11/fonts/misc:unscaled&quot;<br />FontPath &quot;/usr/X11R6/lib/X11/fonts/75dpi:unscaled&quot;<br />FontPath &quot;/usr/X11R6/lib/X11/fonts/misc&quot;<br />FontPath &quot;/usr/X11R6/lib/X11/fonts/Type1&quot;<br />FontPath &quot;/usr/X11R6/lib/X11/fonts/Speedo&quot;<br />FontPath &quot;/usr/X11R6/lib/X11/fonts/75dpi&quot;<br />FontPath &quot;/usr/X11R6/lib/X11/fonts/TrueType&quot;<br /><br />取消 xfs 的后台执行:<br /><br /># setup<br /><br />在 System services 中取消 xfs。<br /><br />启动 X,查看中文TTF字体:<br /><br />$ xfd -fn simsun &amp; &lt;-- 显示字体内容<br /><br />在 Netscape 中使用 TTF 字体。<br /><br />启动 netscape,打开属性<a class="UBBWordLink" href="#" target="_blank">设置</a> Edit-&gt;Preferences... 在 Appearance(外观)中选择 Fonts(字体)。<br /><br />For the Encoding: 选择 Simplified Chinese (gb 2312-80)<br />Variable Width Font(变宽字体): 选择 Simsum (Misc)<br />Allow Scaling (允许缩放)选中<br /><br />再次启动 Netscape 使改动生效。<br />&nbsp;</p>
頁: [1]
查看完整版本: RedHat 6.2中文字体TrueType的使用