分页: 1 / 4

用打了firefly 粗体补丁的libXft 快速实现中文粗体和斜体

发表于 : 2005-06-14 20:20
bluebell
步骤:
1 转到字符界面,关闭X。命令:sudo /etc/init.d/gdm stop
2 备份原来的/usr/lib/libXft.so.2.1.1,用附件里的文件替换。
3 先备份原来的文件,然后修改/etc/fonts/font.conf 或者 /etc/fonts/local.conf (推荐),加入代码里的内容:

提示:
如果你觉得在字符界面下编辑文件很不适应,那么:
先跳到第 4 步
然后跳到这一步,用gedit 等你喜欢的编辑器来修改,
然后注销,重新登陆就可以了。

代码: 全选

<!-- 
 Artificial oblique for fonts without an italic or oblique version
 -->
 
	<match target="font">
		<!-- check to see if the font is roman -->
		<test name="slant">
			<const>roman</const>
		</test>
		<!-- check to see if the pattern requested non-roman -->
		<test target="pattern" name="slant" compare="not_eq">
			<const>roman</const>
		</test>
		<!-- multiply the matrix to slant the font -->
		<edit name="matrix" mode="assign">
			<times>
				<name>matrix</name>
				<matrix><double>1</double><double>0.2</double>
					<double>0</double><double>1</double>
				</matrix>
			</times>
		</edit>
		<!-- pretend the font is oblique now -->
		<edit name="slant" mode="assign">
			<const>oblique</const>
		</edit>
	</match>

<!-- 
 Add by firefly@firefly.idv.tw
 Artificial bold for fonts without a bold version.
 -->
	<match target="font">
		<!-- check to see if the pattern requested > "medium" -->
		<test target="pattern" name="weight" compare="more">
		<const>medium</const>
		</test>
		<!-- pretend the font is bold now -->
		<edit name="weight" mode="assign">
			<const>bold</const>
		</edit>
	</match>
4 重新启动X,命令:sudo /etc/init.d/gdm start。应该会看到粗斜体了。

在hoary上经过测试。但如果有问题,还原备份。 :wink:

发表于 : 2005-06-14 21:24
yongyi
效果如何 ?

发表于 : 2005-06-15 9:56
bluebell
firefox效果

发表于 : 2005-06-16 20:41
GOVO
神啊!!能再详细说明一下吗?是不是换了你的libXft.so.2.1.1然后 firefly字体 就会有粗体了?你的libXft.so.2.1.1有什么神奇啊?

发表于 : 2005-06-17 17:37
bluebell
GOVO 写了:神啊!!能再详细说明一下吗?是不是换了你的libXft.so.2.1.1然后 firefly字体 就会有粗体了?你的libXft.so.2.1.1有什么神奇啊?
这个libXft.so.2.1.1是添加了firefly粗体补丁后编译而成的,这就是神奇之处了。:lol:
但并不是说一定要使用 firefly 字体才可以,使用任何中文字体应该都是可以的。

替换之后,再添加上面提到的配置代码。当然可以显示粗体了!

有没有人试试看呢?

发表于 : 2005-06-17 19:22
GOVO
可是我没有安装firefly哦,哪里有得安装的?

发表于 : 2005-06-17 19:56
yongyi
GOVO 写了:可是我没有安装firefly哦,哪里有得安装的?
按他所说,应该是只安装FIREFLY粗体补丁,就可以使中文字体实现粗体了,不一定需要FIREFLY字体。

发表于 : 2005-06-18 1:08
GOVO
我有那个字体啊,就是没有这个叫firefly的软件。不是先有软件才有补丁的吗?

发表于 : 2005-06-18 10:12
bluebell
GOVO 写了:我有那个字体啊,就是没有这个叫firefly的软件。不是先有软件才有补丁的吗?
晕倒! :lol:
这个补丁对应的软件就是你的 xorg 呀,
这个补丁的作者是firefly,他(或者她)是台湾的一个linux高手,
这个附件是加入了补丁后编译而成的软件库了,是现成的,拿来就可以用的。

ps:看来我也要改个标题了。

发表于 : 2005-06-18 10:20
yongyi
bluebell 写了:
GOVO 写了:我有那个字体啊,就是没有这个叫firefly的软件。不是先有软件才有补丁的吗?
晕倒! :lol:
这个补丁对应的软件就是你的 xorg 呀,
这个补丁的作者是firefly,他(或者她)是台湾的一个linux高手,
这个附件是加入了补丁后编译而成的软件库了,是现成的,拿来就可以用的。

ps:看来我也要改个标题了。
哈哈! :D

发表于 : 2005-06-18 13:36
GOVO
成功了,用了其它字体也能在FF中实现粗体,但是只仅浏览器中,对其它的无效,也好,起码好很多了!

发表于 : 2005-06-18 14:01
yongyi
哦?FF,OO,还有标题都能实现了!好!
但是,GOVO还有哪里要实现粗体不行呢?菜单?

发表于 : 2005-06-18 14:31
GOVO
晕,标题用的是真正的粗宋TTF文件,OO中的粗宋都是用TTF字体来实现的,不能用模拟的,如ar pl new sung这样没有粗体TTF文件的就不行了,明白了吗?如在字体选择中,遇到没有粗体TTF文件的仍然不行。但在FF中,用模拟的粗体好看很多!

发表于 : 2005-06-22 18:58
maniac
效果的确不错

发表于 : 2005-06-22 19:38
yongyi
大点的粗体字呢?比如论坛里的帖子列表处的大号中文字。