Debian Chinese How-To
This is my personal experience with chinese environment setup on my Debian Box, with KDE desktop. Here’s my specs.
- Debian Unstable, kernel 2.6.18-1-686
- xserver-xorg 7.1.0-4
- kde 3.5.5
Setting your system with english locales, so that your desktop, menus and programs’ file menus won’t show english characters in blurry chinese ttf fonts. You will still have the ability to input chinese in almost everything(browsers, konquerer, instant messengers, konsole, xchat and more).
Here’s a step by step instruction.
- Setting UTF-8 Locale system wide
Codes:
dpkg-reconfigure locales
This command will prompt you a screen to select your desired locales. For my case, I’ve selected
- en_US ISO-8859-1
- en_US.UTF-8 UTF-8
- zh_CN GB2312
- zh_CN.GB18030 GB18030
- zh_CN.GB18030 GB18030
- zh_CN.GB18030 GB18030
- zh_TW BIG5
- zh_TW.UTF-8 UTF-8
Set en_US.UTF-8 UTF-8 as default locales. By now, when you output your locales settings with locale command, all the variables with “LC_XXX” shoud be already in “en_US.UTF-8“.
- Displaying Chinese
There are a few packages you need to get in order to get chinese text displayed correctly in your KDE desktop.
These are for KDE Internationalization.- kde-i18n-zhcn (for Simplified Chinese)
- kde-i18n-zhtw (for Big5 Chinese)
You can always add your desired encoding for other languages. I have also kde-i18n-ko for korean, and kde-i18n-ja for Japan.
After installing the internationalized packages, you will have to install TTF(true type fonts). Here’s the list.- ttf-arphic-bkai00mp (”AR PL KaitiM Big5″ Chinese TrueType font)
- ttf-arphic-bsmi00lp (”AR PL Mingti2L Big5″ Chinese TrueType font)
- ttf-arphic-gbsn00lp (”AR PL SungtiL GB” Chinese TrueType font)
- ttf-arphic-gkai00mp (”AR PL KaitiM GB” Chinese TrueType font)
- ttf-arphic-uming (”AR PL ShanHeiSun Uni” Chinese Unicode TrueType font)
- ttf-fireflysung (”AR PL New Sung” Chinese TrueType font)
- ttf-kochi-gothic-naga10 (Kochi Subst Gothic Japanese TrueType font)
My default chinese font is ttf-fireflysung which I’ve forgot where to get. I remember getting it from a Taiwan site, if any of you have the address, please kindly let me know. If you are unable to get firefly, uming is probably your best choice for chinese text.
- Changing font for chinese text display
Sometimes in your KDE desktop, if you have downloaded files with chinese/japanese file names, it will be displayed in square unreadable characters. This means KDE is unable to find appropriate font substitution for unknown characters. You can get qt3-qtconfig to deal with this problem. Inside the program you will get to set font substitution for your default KDE font(mine is Bitstream Vera). Apply several substitution TTFs like AR PL New Sung and AR PL ShanHeiSun Uni, so your text will be displayed correctly.For other programs like Firefox, Xchat, amarok and more. You will get to choose their own default font. For my case, once qt3-qtconfig is set properly, these programs have no problem using the settings.
If above methods still do not work out for you. You can try also install gtk2-engines-gtk-qt. This program will use your Qt settings to draw your GTK applications’ user interface, including the fonts of course. You should also check with
Codes:
update-alternatives –config qtconfig
to see whether which qt config is currently in use. If you have used qt3-qtconfig, you definitely should choose “/usr/bin/qtconfig-qt3″ as your default.
- Chinese Input Method
IMO, scim is always the best choice because it has pinyin support, the only chinese input method I’m familiar with. You will have to get these packages.- scim
- scim-chinese
- scim-gtk2-immodule
- scim-modules-socket
- scim-pinyin
- libscim8c2a
In order to get scim to work in almost everywhere in KDE, some settings need to be done.
First, in your ~/.bashrc file, add in this line.Codes:
export LC_CTYPE=”zh_CN.UTF-8″
This will export your LC_TYPE as zh_CN.UTF-8 since we have already set all these to en_US.UTF-8. This is per user’s local setting, for my case I’ve set my LC_TYPE to zh_CN.UTF-8 system wide, with this command.
Codes:
dpkg-reconfigure localesconf
Use this command to set scim as your default input method for X.
Codes:
update-alternatives –config xinput-all_ALL
Again this is my system wide setting. For user’s local setting, add these lines in your ~/.bashrc
Codes:
export XIM=SCIM
export XIM_PROGRAM=/usr/bin/scim
export XIM_ARGS=”-d”
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim
Restart your X-server, and login to KDE. In any text input field(Gaim, Firefox, Xchat, Open Office, Thunderbird and more), when you hit CTRL+Space, the scim toolbar will pop up and you are able to input chinese text. CTRL+Space again to switch back to English.
Remember not to install the Skim(KDE frontend for scim), as it will somehow freeze your keyboard frequently.
Again, discussions are welcome. I need more feedback on this topic please.
Update #1: I have found a very useful page at unifont.org, you might want to check it out.
Ratings:
Related Post(s)







November 6th, 2006 at 4:50 am
ttf-fireflysung (”AR PL New Sung” Chinese TrueType font)
is available from
http://www.study-area.org/apt/firefly-font/
(as well mentionning http://www.unifont.org/fontguide/ as a reference)
November 6th, 2006 at 10:05 am
Thanks dude, glad to have someone reading this.
December 27th, 2006 at 5:00 am
Thank you for the hint, that skim freezes the input. I just stumbled upon that problem…
December 27th, 2006 at 5:18 am
[…] Scim und skim habe ich heute hinbekommen, nachdem ich beide Pakete neu installiert habe und zusätzlich noch im-switch installiert habe. Dann einfach im-switch -c aufrufen und scim auswählen. Und dann X neu starten. Nach der ersten Freude habe ich mich geärgert, dass alle Programme mit Qt - insbesondere Opera - nach einer gewissen, sehr kurzen, Zeit keine Eingaben mehr angenommen haben. Durch einen Hinweis habe ich skim ganz rausgeschmissen und nun scheint es erstmal zu funktionieren. Endlich kann ich ein 你好 eingeben […]
January 4th, 2007 at 11:36 pm
You’re welcome.
April 21st, 2007 at 1:39 pm
i think that editng .bashrc file don’t have effect to KDE-program,because .bashrc file only run only when you open terminal-window,
if i don’t open any terminal-window,then .bashrc file will not run,so envirmont-viriant will not change as you expect.
maybe you should think again What to set and How to set in order to efect KDE-program
April 21st, 2007 at 1:47 pm
Hi! Big Sea. Do you mean that your ~/.bashrc does not load when loading up a User Account? Please provide more details, thanks. P/S: I can read Chinese(PRC) too.
April 21st, 2007 at 3:35 pm
严宾,你好,你一定是中国人了吧。看名字像是。
我的意思是:.bashrc这个文件只有在你启动一个’终端窗口“的时候,才会执行,例如说:你主动的启动了konsole这个“终端模拟窗口”程序,.bashrc才会执行。
从电脑加电启动,一直到出现kde桌面这个过程当中,.bashrc这个“可执行脚本”并不会自动执行,自然环境变量也就无法被正确的设置了。
如果电脑启动之后,直接进入到“ 字符模始“,(不启动KDE),那么.bashrc也会执行。
bash是一个“字符命令解释程序”,而
.bashrc这个文件是它的“初始化文件“,只有bash至少运行一次, .bashrc才会有机会执行。
如果电脑直接进入到kde桌面,那么bash程序根本不会启动,.bashrc也自然不会执行。
我刚才上网查了一些资料,受到了启发。改了改 /etc/X11/xinit/xinput.d这个目录下的几个文件,重新登录KDE,果真有效果,可以“切换”输入法了。“智能拼音”终于出来了。这几个文件是 scim,scim-immodule,zh_CN。
为什么改这个目录下的文件就有效果呢?我认为是这样的:KDE启动的时候,必然要调用X server,因此修改X server的“初始化”文件,肯定会有效果。那它的”初始化“文件在那里呢?
看看 /etc/X11/ 目录下的 xinit 这个名字,应该是 x initial 的简写吧。也就是“ X 初始化“。xinput.d 这个目录,顾名思意,跟输入法有关系。我发现上诉三个文件当中的 GTK_IM_MODULE 和 QT_IM_MODULE 这两个变量初始值都被设置成了xim,我把他们的取值改成了scim,注销用户,再登录,输入法终于正常了。
我前几天,刚刚下了Debain 4.0,刻盘安装,又加装了好多个名字中包含有scim的deb包,但始终无法切换到中文输入法。连续搜寻了几天,一无所获。今天,偶然一个机会,看了一篇英文帖子,受到启发,尝试着改了改我上面提到的三个文件,终于看到红色的”智”字出现在了输入法指示区。
看来,修改哪个配置文件是很重要的,没找准合适的文件,费了劲,也没有效果。
再此过程当中,我也看了你的这篇文章,也采用了你的一些方法,深表感谢。难得你还“翻译”成英文。
April 21st, 2007 at 5:47 pm
Big Sea, 大海。
我明白了。
其实这个指令 “update-alternatives –config xinput-all_ALL” 和修改 /etc/X11/xinit/xinput.d 是一样的。 .bashrc 的修改就是为了能在Konsole里输入。
不鼓励使用stable, 软件好旧。 Unstable也很好用。
我中文名是延斌。 马来西亚华裔。有没有MSN啊?
July 26th, 2007 at 1:21 am
Hey, i’m using gnome, do i follow the same steps or something else?help please. Thanks
July 26th, 2007 at 1:32 am
Hi Bill, can your Web Browser display chinese text now?
May 3rd, 2008 at 6:00 pm
poker texana on line…
Where casino tropez gratuites card credit debt disabled relief…
May 7th, 2008 at 10:33 am
poker gratuites bruel…
They no fax faxless cash advance payday loan www casino gratis…