从smth转来一个字体安装笔记,有待研究

* qingquan (NeverMind)*

any comments?

hope this can help to start a recompilation of how-to tutorial of installing chinese fonts under freebsd.

0. here i will skip the environment setup in .cshrc. personally i am using zh_CN.eucCN

1. download simsun.ttc, mingliu.ttc

   mkdir /usr/X11R6/lib/X11/fonts/TrueType

2. cp simsun.ttc /usr/X11R6/lib/X11/fonts/TrueType

   cp mingliu.ttc /usr/X11R6/lib/X11/fonts/TrueType

3. cd /usr/X11R6/lib/X11/fonts/TrueType

   ttmkfdir -o fonts.dir

   cp fonts.dir fonts.scale

4. fc-cache -f -v

5. edit /etc/X11/xorg.conf

   make sure that the /usr/X11R6/lib/X11/fonts/TrueType is in section files as:

   FontPath "/usr/X11R6/lib/X11/fonts/TrueType"

6. make sure either

      Load "freetype"

   or

      Load "xtt"

   appear in the section module, but they should not both appear at the same time.

7. edit /usr/X11R6/etc/fonts/local.conf, add the following sections into this xml file

        

                

                        MingLiU

                

                false

        

        

                

                        MingLiU

                

                0

        

        

                

                        simsun

                

                true

                true

                false

        

        

                

                        simsun

                

                

                        13

                

                false

                true

        

   these are used to correct the size of western characters in big5 codings, and disable antialias

of simsun when the font size is less than 13 pt. (the above is searched from google, i modified

the name of the fonts in the original text).

8. run xlsfonts, as you should see simsun and mingliu fonts now.

9. set the fonts for desktop all to simsun, 10pt. set the fonts for simplified chinese in firefox to simsun and for traditional chinese to mingliu.

10. the above should work for you now.

question: when i use xtt, the simsun seems always being antialiased in firefox, as apposed to what i have set in the fontconfig file. i am wondering why. any suggestions?

p.s. freetype works well though.

* intron (内含子)*

 有些关键性的步骤,没有提到.

1./etc/make.conf里面要加上WITH_CJK=yes再安装libXft2,fontconfig,pango.

  这样,就会使用来自firefly.idv.tw的中日韩补丁.

  不打firefly的补丁, libXft2里就根本没有伪粗体的支持.

  另外firefly也使得可以对fontconfig设置字体微调的程度.

2.对于非libXft使用字体的方式,即传统的X服务器使用字体的方式,fonts.dir

  里还要加上对于伪粗体,伪斜体的配置.这也可以通过zh-ttfm完成.

 不仅要对simsun族禁用磨边处理,要对几乎所有小于一定尺寸的字体都禁用磨边处理。

serif,sans-serif,monospace等,也要禁用。这样,就不应当按字体族名指定禁用了。

serif等实际上表示了一个个有优先顺序的真实字体族序列,汉字也在其中。

 firefox-gtk2-xft2中显示的汉字粗体,就是伪粗体。

假如没有firefly的补丁,firefox-gtk2-xft2中就不会有汉字粗体显示。

附图1是Mozilla-gtk1显示的伪粗体,由xtt模块生成。

我喜欢用xtt,它还在由日本人继续维护,没有freetype模块的汉字尺寸处理的错误。

目前xtt模块和freetype模块都有了读取.ttc文件中小尺寸位图的功能。