# Gentoo下中文字体加粗成功！

## wangxiaohu

不想说太详细，我懒：

0. 退出X。。。不退出X直接进行下列操作后果自负。

1. 新的freetype-2.1.10已经 ~x86 stable了，先装了再说。

2. 下载最新的 libXft，并prefix到/usr去:    http://xlibs.freedesktop.org/release/

3. 修改 /etc/fonts/local.conf ：

```
<?xml version="1.0"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<!-- /etc/fonts/local.conf file for local customizations -->

<fontconfig>

   <dir>/opt/Ximian-OpenOffice/share/fonts/truetype</dir>

   <dir>/opt/Acrobat7/Resource/Font</dir>

     <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>180</int>

         </test>

         <!-- set the embolden flag -->

         <edit name="embolden" mode="assign">

             <bool>true</bool>

         </edit>

     </match> 

<match target="font"> 

                <test target="pattern" name="lang" compare="contains"> 

                        <string>zh-tw</string> 

                        <string>zh-cn</string> 

                        <string>ja</string> 

                        <string>ko</string> 

                </test> 

                <edit name="spacing"> 

                        <const>proportional</const> 

                </edit> 

                <edit name="globaladvance"> 

                <bool>false</bool> 

                </edit> 

</match>

<match target="font" >

                <test compare="contains" name="lang" >

                        <string>zh-cn</string>

                        <string>zh-tw</string>

                        <string>ja</string>

                        <string>ko</string>

                </test>

                <test compare="more_eq" name="pixelsize" qual="any" >

                        <double>8</double>

                </test>

                <test compare="less_eq" name="pixelsize" qual="any" >

                        <double>16</double>

                </test>

                <edit mode="assign" name="antialias" >

                        <bool>false</bool>

                </edit>

</match>

</fontconfig>
```

然后自己摸索一下吧。。。。。。。X起动不了是你自己的错，谁叫你尝鲜呢。。。

MD，这儿也没法贴图。。自己YY吧。。。

----------

## wangxiaohu

刚发现一个缺点，就是xterm之类的老X程序一运行X就Crash了。。。嘿嘿。。爽。。。

----------

## Fleta

So which package provides the bold effect?  libXft? Did you uninstall your old libXft?

----------

## r0bertz

thanks to firefly, always has bold here,  :Smile: , if you feel not bold enough, just disable antialiasing for some pixel size for asian fonts, 

I've heard of that new freetype and libXft can render bold chinese character without firefly's path

However, haven't tried yetLast edited by r0bertz on Thu Jul 14, 2005 6:10 am; edited 2 times in total

----------

## bookstack

没有Xterm, 没有AA

代价太大了吧？

----------

## wangxiaohu

 *bookstack wrote:*   

> 没有Xterm, 没有AA
> 
> 代价太大了吧？

 

中文字要什么AA啊。。只有英文才AA的。。。

----------

## liuspider

just installed latest libxft 2.1.7, and now firefox can display bold chinese  :Wink: 

Comments to the thread starter:

1. all these packages can be installed under X

2. xterm does not crash here at all  :Wink: 

but in kde apps, still no bold face of chinese fonts...

----------

## r0bertz

 *liuspider wrote:*   

> just installed latest libxft 2.1.7, and now firefox can display bold chinese 
> 
> Comments to the thread starter:
> 
> 1. all these packages can be installed under X
> ...

 

but kde apps can display bold chinese, if u use firefly's patch

to achieve this, do not specify chinese fonts for your apps, specify western fonts. Then you can choose bold. Then bold chinese can appear where it should appear

----------

## r0bertz

 *wangxiaohu wrote:*   

>  *bookstack wrote:*   没有Xterm, 没有AA
> 
> 代价太大了吧？ 
> 
> 中文字要什么AA啊。。只有英文才AA的。。。

 

Absolutely!

However, I still enable AA for larger size of asian fonts

```

<match target="font" >

  <test compare="eq" name="family" >

   <string>SimSun</string>

   <string>NSimSun</string>

   <string>AR PL New Sung</string>

   <string>MingLiU</string>

   <string>PMingLiU</string>

   <string>AR PL ZenKai Uni</string>

   <string>AR PL ZenKai Uni MBE</string>

   <string>AR PL ShanHeiSun Uni</string>

   <string>AR PL ShanHeiSun Uni MBE</string>

   <string>Ming(ISO10646)</string>

   <string>AR PL Mingti2L Big5</string>

   <string>AR PL SungtiL Big5</string>

   <string>Kochi Mincho</string>

   <string>Baekmuk Dotum</string>

  </test>

  <test compare="more" target="pattern" name="weight" >

   <const>medium</const>

  </test>

  <test compare="less_eq" name="pixelsize" >

   <double>20</double>

  </test>

  <edit name="hinting" >

   <bool>true</bool>

  </edit>

  <edit name="antialias" >

   <bool>false</bool>

  </edit>

  <edit name="autohint" >

   <bool>false</bool>

  </edit>

 </match>

```

----------

## liuspider

[quote="zhllg"] *liuspider wrote:*   

> 
> 
> but kde apps can display bold chinese, if u use firefly's patch
> 
> to achieve this, do not specify chinese fonts for your apps, specify western fonts. Then you can choose bold. Then bold chinese can appear where it should appear

 

it would be better to use the "official" approach

at least, now firefox works fine

----------

## liuspider

under konqueror, it seems that in some website, such as linuxsir, bold faces are fine; but here, no bold faces at all

----------

## wokick

Now these packeges are included in portage, though masked. 

I emerged them, and modified my .fonts.conf under my home directory, and then restart xserver.

However, NO bold! 

How come?  oh, I am using simsun font for chinese.

But with the new libXft, the chinese font does look better then ever.

BTW: AA still works. Xterm does not crash.

----------

