On Wednesday, June 5, 2002, at 05:00 PM, Yu Guanghui wrote:

Hi
If anyone can do that, I will be glad to put it to FAQ packages and the website. ;-)

Ask and you shall receive. ;) I'm too lazy to format this in HTML, so somebody else can do that.


Debian Chinese FAQ Version 1.5

Original:  Yu Guanghui ([EMAIL PROTECTED])
English translation:  Steven Huang ([EMAIL PROTECTED])


This document presents some frequently asked questions from users of Chinese software in Debian. Most of the contents of this FAQ list were collected from the two Debian Chinese project mailing lists [EMAIL PROTECTED] debian.org and [EMAIL PROTECTED] For more details on using Debian, consult "The Debian Linux User's Guide".

You can also send problems you've encountered and their solutions to
[EMAIL PROTECTED], preferably in the format below:

  \Question{This is a sample question}
    \contributor{Yu Guanghui}{ygh}{debian.org}{2000/11/19}
    \contributor{foo}{foo}{foo.com}{2000/11/19}
    Please use this format when submitting

The newest version of the FAQ is available at http://www.debian.org/intl/zh/
faq.


1 Chinese Language Environment and Software in Debian

1.1  Summary of Chinese Support in Debian

Chinese language processing under Debian takes advantage of standard internationalization
(i18n) and localization (l10n) efforts, rather than adding external Chinese platforms.
This results in applications that have more integrated Chinese support. The
i18n framework allows Debian to support multiple languages just by changing some
environment variables and localized program messages.


1.2  Debian Software with Chinese Support

Chinese Environment Control Panel
  - zhcon
  - CCE
  - YH
  - Chdrv
  - Kon2
Fonts
  - Arphic Truetype fonts
  - xfonts-intl-chinese, xfonts-cjk
  - unifont
Terminal Emulators
  - rxvt-ml
  - cxterm
  - jfbterm
Chinese Input Platforms
  - xcin
  - xcingb, xa+cv
  - chinput
Word Processor
  - cjk-latex
Documentation Translation
  - debian-guide-zh-t, debian-guide-zh-s
  - doc-linux-zh, doc-linux-zh-s
  - zh-trans (obsolete)
Internal Code Converter
  - zh-autoconvert
Dictionaries
  - cedict
  - stardic
  - pydict

1.3  Internationalized Debian Software

GNOME
KDE2
Mozilla
Netscape

2  Setting Up a Chinese Environment

2.1 I am installing Debian, and would like to use Chinese. What do I need to do?

It's not very different from a normal installation of Debian. Just select
task-chinese-s for simplified Chinese support, or task-chinese-t for traditional
Chinese support during installation. Note that Debian Potato does not correctly
install all selected packages, so you may have to manually execute dselect and
directly choose the Install option from the menu.


2.2  I am already running Debian.  How do I add Chinese support?

Ensure that your /etc/apt/sources.list is correct, and run:

  apt-get install task-chinese-s

for simplified Chinese support, or:

  apt-get install task-chinese-t

for traditional Chinese support.

2.3  How do I generate locale files for libc6 2.2?

Starting from libc6 2.2, locale files are no longer automatically generated.
Edit
/etc/locale.gen to remove locales that you do not need, and run the locale-gen
program as root.


2.4  I installed Chinese support.  What else do I need to do?

Set up your environment variables. For bash users, the following sets up a
simplified Chinese environment:


  # $(HOME)/.bashrc
  alias ls=``ls -show-control-chars''
  export LC_ALL=zh_CN.GB23122
  export LC_CTYPE=zh_CN.GB2312
  export LANG=zh_CN.GB2312
  export [EMAIL PROTECTED]''3
  stty cs8 -istrip
  stty pass8

  # $(HOME)/.inputrc
  set meta-flag on
  set convert-meta off
  set output-meta on

2.5  Why doesn't the Debian Chinese Panel accept any input?

The panel currently only supports the vt100 terminal. Execute the following:

  export TERM=vt100

before running it, or include the setting in $(HOME)/.bashrc.

2.6  How do I use TrueType fonts in XFree86 3.3.6?

Make sure that you have installed the xfs-xtt font server package, and then add
the following:


  FontPath "unix/localhost:7100"

into your /etc/X11/XF86Config file under the "Files" section.

2.7  How do I use TrueType fonts in XFree86 4.0?

XFree86 4.0.2 uses the xtt module to support TrueType fonts in the GB or Big5
encodings, and does not require xfs-xtt. Just add:


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

to the "Files" section of your /etc/X11/XF86Config-4 file, and replace:

  Load "freetype"

with:

  Load "xtt"

You can probably also remove the line:

  FontPath "unix/:7100"

If you are running Woody or Sid, and your x-ttcidfont-conf is version 3.5 or above,
please add the following:


  FontPath "/usr/lib/X11/fonts/defoma/TrueType/"
  FontPath "/usr/lib/X11/fonts/defoma/CID/"

to the "Files" section of your /etc/X11/XF86Config-4.

If you are running version 8 or above of x-ttcidfont-conf, add the following lines
instead:


  FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType/"
  FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID/"

to the "Files" section of your /etc/X11/XF86Config-4.

It's a good idea to upgrade to version 7 or above of x-ttcidfont-conf, which fixes the
problem of only having bold and italic fonts available when using the xtt font server.


2.8  Why did X become so slow after using xfs-xtt's scalable fonts?

If you did not use the option "-deferglyphs 16" when starting X, xfs-xtt will attempt to
load all characters into memory. You can use the following:


  startx -- -deferglyphs 16

to start X, or if you are using xdm, add "-deferglyphs 16" to the /etc/X11/
xdm/Xserver
file.

2.9  How do I use xcin to enter Chinese characters?

Xcin uses the XIM protocol, so only applications that support XIM will accept xcin
input. Before running the application, you should start xcin, and set:


  export XMODIFIERS="@im=xcin-zh_CN.GB2312"

at the command line or in your $(HOME)/.bashrc to select simplified Chinese support.
After starting the application, you can use ctrl-space to toggle input methods.


To use traditional Chinese, set XMODIFIERS to "@im=xcin".  Adding "-zh_TW.
Big5"
will not work.

An easier method is to upgrade to xcin 2.5.2 in Debian 2.2r2, or xcin 2.5.
2.2 in
unstable. You can then select "XCINterm (Big5)" or "XCINterm (GB2312)" from the
"XShell" menu, or run xcinterm-big5 or xcinterm-gb from a shell. The system will
automatically start the xcin server and a terminal emulator.


2.10  How do I use chinput to enter Chinese characters?

Chinput has not been formally accepted into Debian, because it uses the UNICON
input method, which has not yet been fully tested. You can download experimental
debs for chinput and unicon from:


  http://master.debian.org/~ygh/unicon-im_3.0-1_i386.deb
  http://master.debian.org/~ygh/chinput_3.0.1-1_i386.deb

Chinput also uses the XIM protocol, so only applications that support XIM will
accept input from Chinput. Just set the XMODIFIERS environment variable to
"@im=Chinput" in the shell or in $(HOME)/.bashrc, and use ctrl-space to toggle
input methods. Note that the default chinput package uses TrueType fonts.


Addendum: chinput and unicon-im have made it into Debian unstable, so if you
use unstable you can just issue:


   apt-get install chinput unicon-im

Note that chinput only supports 16-pixel fonts.

2.11  Why does icewm's window title bar become very large after installing
      Chinese?

You need to manually configure icewm to reset the size of the font.  First,
copy /etc/X11/icewm/preferences to $(HOME)/.icewm/preferences.  Look for the
line:

  #TitleFontName="-adobe-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*

and change it to one of the following:

  TitleFontName="-default-song-bold-r-
normal--16-160-72-72-c-160-gb2312.1980-0"
  TitleFontName="-default-ming-bold-r-normal--16-160-72-72-c-160-big5-0"

2.12  cce, crxvt

[blank]

3  Word Processing in Chinese

3.1  CJK

[blank]

3.2  How do I use latex2html to generate Chinese HTML pages?

Latex2html already supports CJK languages.  Just add:

  charset='gb2312';

to $(HOME)/.latex2html-init, and run:

  latex2html -iso CN foo

to generate the HTML file.

3.3  Why does vim only delete half a Chinese character each time?

First, set up your environment variables according to FAQ 2.4. Next, add the
following:


  set fe=prc

to $(HOME)/.vimrc.  This is no longer necessary in vim 6.0.

3.4  How can I display Chinese in xpdf?

The correct fonts are only available in Woody (testing) and Sid (unstable)

回复