LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Guide to Display Chinese in Debain Sarge (https://www.linuxquestions.org/questions/debian-26/guide-to-display-chinese-in-debain-sarge-307463/)

NanoFxJ 03-29-2005 01:40 PM

Guide to Display Chinese in Debain Sarge
 
I spent an evening today on http://wiki.linux.org.hk/index.php/H...ng_Locale_Data
(Thanks for the people who worked on the wiki)to figure out how to display chinese in Debian (sorry haven't try the input part yet). I think I should tell everyone how I get it so whoever has trouble at least gets a little more help. Good luck guys!
Quote:

This article is written for Debian GNU/Linux 3.1 (Sarge) or higher (It will not work for Debian 3.0, Woody) .
First
Code:

dpkg-reconfigure locales
in there, choose
Code:

en_US ISO-8859-1
zh_TW BIG5
zh_TW.UTF-8 UTF-8
zh_CN GB2312
zh_CN.GBK GBK
zh_CN.UTF-8 UTF-8

zh_TW BIG5 and zh_TW.UTF-8 UTF-8 are for traditional chinese
zh_CN GB2312, zh_CN.GBK GBK, and zh_CN.UTF-8 UTF-8 are for simplified chinese
Recommend to Restart Linux
---------------------------------------------------------------------------------------------------
Second
we need to install chinese fonts, so linux can display it.
we need these:
# ttf-arphic-bsmi00lp - Arphic PL Shan Hei Sun Light (AR PL Mingti2L Big5), including about 13,000 traditional chinese characters in Big5.
# ttf-arphic-bkai00mp - Arphic PL Zen Kai Medium (AR PL KaitiM Big5), including about 13,000 traditional chinese characters in Big5.
# ttf-arphic-gbsn00lp - Arphic PL Bousung Light (AR PL SungtiL GB), including more then 7,000 simplified chinese characters in GB2312.
# ttf-arphic-gkai00mp - Arphic PL GB Zen Kai Medium (AR PL KaitiM GB), including more then 7,000 simplified chinese characters in GB2312.
so we use
Code:

apt-get install ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp ttf-arphic-gbsn00lp
---------------------------------------------------------------------------------------------------
Third
Now, we need to configure local.conf file, it is located in /ect/fonts/local.conf
If you open it with any text editor, it should look like this
Code:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <include ignore_missing="yes">/var/lib/defoma/fontconfig.d/fonts.conf</include>
<!-- Uncomment below to enable bitmapped fonts -->
<!--
  <dir>/usr/X11R6/lib/X11/fonts</dir>
-->
  <match target="font">
    <test qual="all" name="rgba">
      <const>unknown</const>
    </test>
    <edit name="rgba" mode="assign"><const>rgb</const></edit>
  </match>
<!-- Uncomment below to enable the freetype autohinter module -->
<!--
  <match target="font">
    <edit name="autohint" mode="assign">
      <bool>true</bool>
    </edit>
  </match>
-->
NEW CODES HERE
</fontconfig>

we add below codes into the local.conf (where NEW CODES HERE is, before </fontconfig>)
Disable anti-alias technology for Chinese fonts 16px or under:
Code:

<!-- Disable font alias for Chinese <= 16px -->
  <match target="font">
    <test qual="any" name="family" compare="eq">
      <string>AR PL Mingti2L Big5</string>
      <string>AR PL SungtiL Big5</string>
      <string>AR PL New Sung</string>
      <string>Ming(ISO10646)</string>
      <string>MingLiu</string>
      <string>PMingLiu</string>
      <string>Kochi Mincho</string>
      <string>Baekmuk Dotum</string>
    </test>
    <test name="pixelsize" compare="less_eq">
      <double>8</double>
    </test>
    <edit name="antialias">
      <bool>false</bool>
    </edit>
    <edit name="hinting">
      <bool>true</bool>
    </edit>
  </match>

Reset display order of serif fonts:
Code:

  <alias>
      <family>serif</family>
      <prefer>
        <family>Bitstream Vera Serif</family>
        <family>Times New Roman</family>
        <family>Times</family>
          <family>AR PL New Sung</family>
          <family>AR PL Mingti2L Big5</family>
          <family>AR PL SungtiL GB</family>
          <family>Ming(ISO10646)</family>
          <family>SimSun</family>
          <family>Kochi Mincho</family>
          <family>Baekmuk Batung</family>
      </prefer>
  </alias>

Reset display order of sans-serif fonts:
Code:

  <alias>
      <family>sans-serif</family>
      <prefer>
        <family>Bitstream Vera Sans</family>
          <family>Arial</family>
          <family>Verdana</family>
          <family>Helvetica</family>
          <family>AR PL New Sung</family>
          <family>Ming(ISO10646)</family>
          <family>AR PL kaitiM Big5</family>
          <family>AR PL kaitiM GB</family>
          <family>Kochi Gothic</family>
          <family>Baekmuk Dotum</family>
      </prefer>
  </alias>

Reset display order of monospace font:
Code:

  <alias>
      <family>monospace</family>
      <prefer>
        <family>Bitstream Vera Sans Mono</family>
          <family>Courier New</family>
          <family>Courier</family>
          <family>AR PL New Sung</family>
          <family>Ming(ISO10646)</family>
          <family>Kochi Mincho</family>
          <family>Baekmuk Batung</family>
      </prefer>
  </alias>

-----------------------------------------------------------------------------------------------
Fourth
Those fonts we installed are great, but it looks weird in Linux, so we can use FireFly patch to fix them.
We need to edit apt's source.list file which is located in /etc/apt/source.list
add a new resource *If you use Synaptic select Settings > Repositories:
Code:

      URI: ftp://ftp.hk.debian.org/unofficial/firefly/binary-i386
      Distribution: ./
      Section(s):

then
Code:

apt-get update
or "Reload" in Synaptic.
Finally, type
Code:

apt-get upgrade
or "Mark All Upgrades" in Synaptic(Choose "Default Upgrade")
it will upgrade these packets: fontconfig, libfontconfig1, and libxft2
----------------------------------------------------------------------------------------------
That's it, if you have any questions, let's discuss it toghether ( I am new to linux too, so...), that's what the forums for :)

NanoFxJ 03-29-2005 02:02 PM

I reinstalled my sarge and just realize that I didn't have a local.conf in /etc/fonts (I don't know why :scratch: ), so I just create a new text file called local.conf and it works for me now:p

damienduff 04-05-2005 12:46 AM

great work.

maybe u shld haf edited /etc/fonts/fonts.conf instead?

your firefly URI did not work for me.

i found a working link at http://www.study-area.org/apt/firefly-font/ but I am not sure where to put the fireflysung.ttf. Put it manually in /usr/share/fonts/truetype? Or use defoma-font register-all? anyway firefly is optional.:)

NanoFxJ 04-05-2005 05:21 PM

sorry, I don't know where to put it, but I'll look it up and tell you, and thanks for another link for firefly!


All times are GMT -5. The time now is 03:15 PM.