Debian下中文粗体的解決

bold  一直以来Linux下中文粗体没有很好的解决方案,有拿黑体顶替的;有拿圆体顶替的;有用firefly补丁的。不过现在这些都可以扔在一边了,因为最新的Freetype2已确认支持中文粗体算法。Debian用户很容易实现:

1. 把下面的源加入/etc/apt/sources.list

deb http://people.debian.org.tw/~koster/debian/sid ./
deb-src http://people.debian.org.tw/~koster/debian/sid ./

2. apt-get update

3. apt-get install libfreetype6 libxft2

  好了,重启X就可以看到效果了。这应该是从最底层的解决方案,所以之前如果对fonts.conf和local.conf做过修改请先恢复到原始状态,否则很可能会得不到想要的效果。

Tips1: 如果你找不到原始的fonts.conf,而粗体也没有正常显示,可以尝试加上下面这段代码:

<match target="font">
     <!-- check to see if the font is just regular -->
     <test name="weight" compare="less_eq">
         <int>100</int>
     </test>
     <!-- check to see if the pattern requests bold -->
     <test target="pattern" name="weight" compare="more_eq">
         <int>200</int>
     </test>
     <!-- set the embolden flag -->
     <edit name="embolden" mode="assign">
         <bool>true</bool>
     </edit>
</match>

Tips2: 有些论坛,比如linuxsir.org的粗体仍然会显示不正常,在fonts.conf里找下面这条,把200换成180。

<test target="pattern" name="weight" compare="more_eq">
     <int>200</int>

Technorati Tags: , ,

7 Responses to “Debian下中文粗体的解決”

Leave a Reply

Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).