[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

测试 XFree86-4.0.2 之 "freetype" 模组成功……



众所周知,本来是 patch 的 xfsft 和 x-tt 皆正式进入了 XFree86-4.x 里,
分别名为 "freetype" 和 "xtt" 模组。目前 Debian 中文计划仍沿用日本的 xtt,
而在 /etc/X11/XF86Config-4 也要把 Section "Module" 内的 Load "freetype"
改作 Load "xtt"。

其实 xfsft 和 x-tt 两者在幕后所用的 TrueType 字型描绘器的都是 FreeType 1,
而听说 xfsft 也支援多种不同编码的字型,但我自己始终没有试过 "freetype"
module 的中文支援。前天,我终于决定一试,竟然成功了!  :-)
如果你也想玩玩,不妨试试。(但如果你不熟 X11,或不懂如何恢复原来设定,
请不要乱试。)测试方法如下:

  1. 把 /etc/X11/XF86Config-4 内的 Load "xtt" 改为 Load "freetype"。

  2. # cd /usr/lib/X11/fonts/TrueType
  3. 备份原来的 /usr/lib/X11/fonts/TrueType/fonts.scale 档:
	# cp -av fonts.scale fonts.scale.xtt

  3. 修改 fonts.scale。xfonts-arphic-* 套件里面的 fonts.scale 是给
     xtt 用的;freetype 用的格式不同;可惜两者不能共存。我自己暂时
     测试的 /usr/lib/X11/fonts/TrueType/fonts.scale 是:

12
bkai00mp.ttf -Arphic-AR PL KaitiM Big5-medium-r-normal--0-0-0-0-c-0-big5-0
bkai00mp.ttf -Arphic-AR PL KaitiM Big5-medium-r-normal--0-0-0-0-c-0-iso8859-1
bkai00mp.ttf -Arphic-AR PL KaitiM Big5-medium-r-normal--0-0-0-0-c-0-iso10646-1
bsmi00lp.ttf -Arphic-AR PL Mingti2L Big5-medium-r-normal--0-0-0-0-c-0-big5-0
bsmi00lp.ttf -Arphic-AR PL Mingti2L Big5-medium-r-normal--0-0-0-0-c-0-iso8859-1
bsmi00lp.ttf -Arphic-AR PL Mingti2L Big5-medium-r-normal--0-0-0-0-c-0-iso10646-1
gkai00mp.ttf -Arphic-AR PL KaitiM GB-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
gkai00mp.ttf -Arphic-AR PL KaitiM GB-medium-r-normal--0-0-0-0-c-0-iso8859-1
gkai00mp.ttf -Arphic-AR PL KaitiM GB-medium-r-normal--0-0-0-0-c-0-iso10646-1
gbsn00lp.ttf -Arphic-AR PL SungtiL GB-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
gbsn00lp.ttf -Arphic-AR PL SungtiL GB-medium-r-normal--0-0-0-0-c-0-iso8859-1
gbsn00lp.ttf -Arphic-AR PL SungtiL GB-medium-r-normal--0-0-0-0-c-0-iso10646-1

  4. 执行(全一行):
	# mkfontdir -e /usr/lib/X11/fonts/encodings -e /usr/lib/X11/fonts/encodings/large
     也不妨顺便看看 /usr/lib/X11/fonts/encodings 目录里的东西。 :-)

  5. 重新启动 X 视窗系统。

  6. 在 X 底下,试试:
	$ xlsfonts -fn '-arphic-*'
	$ xlsfonts -fn '-default-*'     # CLE 和 Debian 皆设了一大堆
					# "default" 的 font aliases.
	$ xfd -fn '-arphic-ar pl mingti2l big5-medium-r-normal--24-0-0-0-c-0-big5-0' -start 41216
	$ xfd -fn '-arphic-ar pl kaitim big5-medium-r-normal--24-0-0-0-c-0-big5-0' -start 41216
	$ xfd -fn '-arphic-ar pl kaitim gb-medium-r-normal--24-0-0-0-c-0-gb2312.1980-0' -start 8448
	$ xfd -fn '-arphic-ar pl sungtil gb-medium-r-normal--24-0-0-0-c-0-gb2312.1980-0' -start 8448

  7. 斜体?用 XFLD 的 linear transformation 吧!
	$ xfd -fn '-arphic-ar pl sungtil gb-medium-r-normal--[24 0 3 24]-0-0-0-c-0-gb2312.1980-0' -start 8448
     如此类推。

XFree86 4.x 里 xtt 与 freetype module 的比较:

  1. 似乎 freetype 比 xtt 稍快一点?这个我可没有做过正式测试,只是似乎
     是快一点,但也可能是心理作用。

  2. freetype module 似乎不支援 poor-man's bold,也就是不能够自动显示
     「穷人的粗体」字型。 CLE, Debian 上的文鼎字型本来不是粗体字型,
     要用粗体时,xtt 会把每个字重覆显示两次,左右分开了一点儿,
     看起来就像是粗体了。freetype module 似乎没有这个。

  3. 两者皆可支援斜体,但如果要用 freetype module 显示斜体,大概要用
     "default" 的 aliases 了,例如在 fonts.alias 里:

	-default-kai-medium-i-normal--24-240-72-72-c-240-big5-0 "-Arphic-AR PL KaitiM Big5-medium-r-normal--[24 0 3 24]--0-0-c-0-big5-0"

     直接用 -Arphic-AR PL KaitiM Big5-medium-i-normal--24-240-0-0-c-0-big5-0
     出不了斜体。

  4. 目前的 xtt 转码表有 bug?  (还有 bug 吗?) 只有 xtt 自己用。
     在 /usr/X11R6/lib/modules/codeconv/ 底下。
     freetype 用的转码表,似乎不只 freetype 用,而 Type1、CID 字型等也用
     相同的转码表。在 /usr/lib/X11/fonts/encodings 底下。

  5. fonts.scale, 即 fonts.dir 的格式不同。暂时两者也不相容。
     我本来想 xfonts-arphic-* 这四个 Debian 套件同时支援 xtt 和 freetype
     的 fonts.scale 模式,但似乎比预料中的困难。将来再算把。

哈,我这封信就是在 XFree86 4.0.2 利用 Load "freetype" 在一个使用了文鼎
楷书字型的 crxvt 里面打的了。似乎也相当不错啊!  :-)  不过因为以上提及
粗体字的问题,所以都是暂时用 xtt module 好了。不知道将来这两个 modules
的发展如何,因为究竟大家做的事都是相同的,差不多可以互相取替了。
将来会合而为一吗?难说,难说!  :-)

					东东

-- 
Anthony Fok Tung-Ling                Civil and Environmental Engineering
foka@ualberta.ca, foka@debian.org    University of Alberta, Canada
   Debian GNU/Linux Chinese Project -- http://www.debian.org/intl/zh/
Come visit Our Lady of Victory Camp -- http://www.olvc.ab.ca/

-- 
| This message was re-posted from debian-chinese-big5@lists.debian.org
| and converted from big5 to gb2312 by an automatic gateway.



Reply to: