Novell Home

HOWTO: Optimise Ubuntu for Chinese desktop

From Developer Community

Contents

Description

For optimum display of Chinese characters installation of some proprietary fonts is recommended. Traditional language packs are usually developed in Taiwan and have the suffix zh-tw, Simplified packs have the suffix zh-cn. Note for Hong Kong and Singapore there are usually additional configurations available for locale specification.

Better details are probably available on the Chinese Ubuntu Wiki 中文支持 page.


Language Packs

If you have installed with only English language support the Chinese language packs need to be added.

$ sudo apt-get install language-pack-zh language-support-zh language-pack-gnome-zh

Probably due to an automated packaging application apt-get informs you of the following packages:

hunspell-dictionary-zh-cn myspell-dictionary-zh-cn openoffice.org-hyphenation-zh-cn
openoffice.org-thesaurus-zh-cn hunspell-dictionary-zh-tw myspell-dictionary-zh-tw
openoffice.org-hyphenation-zh-tw openoffice.org-thesaurus-zh-tw

These packages are not available. Hunspell is the new dictionary engine of OpenOffice, derived from Myspell.


X11 Fonts

The following two packages provide Chinese X11 fonts:

$ sudo apt-get install xfonts-intl-chinese xfonts-intl-chinese-big


True Type Fonts

For web browsing the Microsoft fonts provide the most regular display, Arphic fonts are recommended for general usage. To install the msttcorefonts package the multiverse repository needs to be enabled, edit /etc/apt/sources.list and add the word multiverse to the end of the two dapper lines

## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://hk.archive.ubuntu.com/ubuntu/ dapper universe multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ dapper universe multiverse

Update the package name database and install.

$ sudo apt-get update
$ sudo apt-get install msttcorefonts

Onto the Arphic fonts, not all of these might be available, or already be installed:

$ sudo apt-get install ttf-arphic-uming ttf-arphic-ukai ttf-arphic-gbsn00lp ttf-arphic-gkai00mp \
                       ttf-arphic-bsmi00lp ttf-arphic-bkai00mp


AR PL New Sung

A modified Arphic font that renders on the display without anti-aliased blurring. The font combines AR PL Mingti, AR PL Sungti, and FireFly's bitmap font.

$ cd /tmp
$ wget http://firefly.idv.tw/apt/firefly-font/fireflysung-1.3.0.tar.gz
$ tar zxvf fireflysung-1.3.0.tar.gz
$ sudo cp fireflysung-1.3.0/fireflysung.ttf /usr/share/fonts/truetype/
$ sudo fc-cache -f -v

Now update the display font with the System > Preferences > Font to use AR PL New Sung instead of Sans, you might want to leave the window title font and fixed width font settings for lack of suitable replacements: there is no bold New Sung.

Ubuntu Font Preferences enable you to select a different display fonts to improve legibility of Chinese texts
Enlarge
Ubuntu Font Preferences enable you to select a different display fonts to improve legibility of Chinese texts


Microsoft TrueType CJK

The Ubuntu fonts are unfortunately useless if you need to transfer documents between Windows and Mac users, as they are not installed on those platforms documents will appear differently due to document viewers choosing a similar font but with different sizes. One solution, if you have a Windows O/S license is to transfer the Microsoft CJK fonts to Ubuntu.

$ cd /usr/share/fonts/truetype
$ sudo mkdir msttcjk
$ sudo cp <windows mount>/windows/fonts/{batang.*,gulim.*,mingliu.*,msgothic.*,msmincho.*,simhei.*,simsun.*} msttcjk
$ sudo fc-cache -f -v

The font metrics and display configuration for X11 and Gnome already exists for these fonts. If using OpenOffice you might want to set oo-writers default Asian font to MingLiu, and define a template for oo-calc.


Default Language for Login

Either using the Language Support applet, select on the GDM login screen, or update the /etc/environment file manually. Note that the LDM manager used by LTSP has no options to select a language or locale.

Simplified Chinese

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh:en_CN:en"


Traditional Chinese: Hong Kong

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"
LANG="zh_HK.UTF-8"
LANGUAGE="zh_HK:zh:en_HK:en"


English: Hong Kong

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"
LANG="en_HK.UTF-8"
LANGUAGE="en_HK:en"


Reboot and confirm the new locale is in effect.


Chewing Prediction

Users of Microsoft's Chinese IM might want next phrase prediction in SCIM, this is available via the SCIM configuration applet.


Firefox Setup

Firefox supports language locales, as does the Google search engine. For example.

Language            Home page
English             http://www.google.com/
Cantonese           http://www.google.com.hk/
Mandarin/Mainland   http://www.google.cn/
Mandarin/Taiwan     http://www.google.com.tw/

Google offers a Firefox start page that is now automagically locale aware: http://www.google.com/firefox

If a new window is opened when visiting a search result page on Google you can revert to regular Firefox function by typing about:config in the address box and changing browser.link.open_newwindow.restriction from 1 to 2.


Disabling SCIM for Broken Applications

Some applications are broken with SCIM input, to disable SCIM for those applications I recommend creating a wrapper script in /usr/local/bin, for example for the Rainlendar 2 desktop calendar:

#!/bin/sh
# FIXME: disable IM
XMODIFIERS=
GTK_IM_MODULE=
QT_IM_MODULE=
export XMODIFIERS GTK_IM_MODULE QT_IM_MODULE
cd /usr/local/rainlendar2 && exec ./rainlendar2 $*

Novell® Making IT Work As One

© 2008 Novell, Inc. All Rights Reserved.