Linux is an operating system imported from outside China. Because it does not support Chinese characters, many new users are afraid. The following uses Red Hat 7.0 as an example to create a Chinese environment.
Key factors in Chinese Environment
Key Factor 1 -- Glibc can select either Glibc-2.1.X or Glibc-2.2, but the format of zh_CN, zh_CN.gb in the Glibc-2.2 is different from the old version, so you cannot directly use the old version of RPM to install CLE, nor can SRPM be used for Rebuild. You must use the RPM that comes with the Glibc-2.2.
Glibc-2.1.X installation method is as follows:
# Cd/usr/share/i18n # localedef-I locales/zh_CN-f charmaps/GB2312 zh_CN.gb2312Glibc-2.2 installation method is as follows: # cd/usr/share/i18n # cp charmaps/GB2312.gz # gunzip GB2312.gz # localedef-I locales/zh_CN-f GB2312 zh_CN.gb2312 # cd/usr/lib/locale # mv transfer quota
|
Glibc-2.2compress gb2312into gb2312.gz. Therefore, you must decompress the package before executing "localedef ".
Key Factor 2-XFree86
Currently the commonly used version is XFree86-4.0.1, but the XFree86-4.0.1 in Red Hat 7.0 compiled in the suite, there is no need for the "zh_CN.GB2312 XLC_LOCALE" file. You need to manually copy it back. The procedure is as follows:
#rpm -ivh XFree86-4.0.1-1.src.rpm#cd /tmp #bunzip2 /usr/src/redhat/SOURCES/XFree86-4.0.1-20000804.tar.bz2#tar xvf /usr/src/redhat/SOURCES/XFree86-4.0.1-20000804.tar #cd xc/nls/XLC_LOCATE #cp zh_CN.gb2312 /usr/X11R6/lib/X11/locale/zh_CN.gb2312/XLC_LOCALE#cd /usr/X11R6/lib/X11/locale #mv zh_CN.gb2312 zh_CN.GB2312
|
After the preceding operations, modify the file/usr/X11R6/lib/X11/locale. change "Export/XLC_LOCALE release" to "zh_CN.GB2312/XLC_LOCALE zh_CN.gb2312", and change "Export/XLC_LOCALE: Release" to "zh_CN.GB2312/XLC_LOCALE: release ". Modify the/etc/sysconfig/i18n file and change "LANG = 'en _ use'" to "LANG = 'zh _ CN. GB2312 '".
Key Factor 3-Chinese font and input method
Run the following command to install the Chinese font:
rpm -ivh kde-i18n-Chinese-2.1.1-2.noarch.rpm
|
To add additional fonts, you can download them to the http://www.linuxbyte.net.
Restart XFS Server:
/etc/rc.d/init.d/xfs restart
|
Modify GTK settings:
#cd /etc/gtk#ln -sf gtkrc.zh_CN.GB2312 gtkrc.zh_CN.GB2312
|
Modify the/etc/gtk/gtkrc. zh_CN file to change all font definitions:
fontset=“-*-*-medium-r-normal--16-*-*-*-*-*-iso8859-1,\-*-*-medium-r-normal--16-*-*-*-*-*-gb2312.1980-0”
|
Installation input method:
rpm -Uvh --force rxvt-2.7.3-2CLE.i386.rpmrpm -ivh libtabe-0.1.7-1.i386.rpm rpm -ivh xcin-2.5.2pre6-1.i386.rpm
|
Now start XCIN and open the RXVT window, you can enter Chinese characters.
Key Factor 4-Netscape settings
Open a Chinese Web page with Netscape, click view → Character Set in the menu, and select "Simplified Chinese (GB2312)" to browse Chinese. However, to use XCIN to enter Chinese characters, you need to modify "~ /. Xresources Add the following content:
Netscape*useStderrDialog: FalseNetscape*fontList: -*-helvetica-bold-r-*-120-*-iso8859-1;-*-gb2312-0:Netscape*XmLGrid*fontList: \ -*-helvetica-medium-r-*-120-*-iso8859-1;-*-gb2312-0:,\-*-helvetica-bold-r-*-120-*-iso8859-1;-*-gb2312-0:=BOLD,\-*-helvetica-medium-o-*-120-*-iso8859-1;-*-gb2312-0:=ITALIC
|
Then re-enter X-Window or run "xrdb merge ~ /. Xresources ", start Netscape again, and you can use XCIN to input Chinese characters.
Install other related suites
To improve the Chinese environment, you can install related kits as needed.
Installation information file:
rpm -ivh --force zh-trans-0.9-11.noarch.rpm
|
Install the HOWTO file:
rpm -ivh howto-chinese-200009-19.noarch.rpmrpm -ivh howto-chinese-html-200009-19.noarch.rpmrpm -ivh howto-chinese-sgml-200009-19.noarch.rpm
|
Install Console:
rpm -ivh jmce-0.37-1.i386.rpmrpm -ivh cce-0.36-1.i386.rpm
|
Install dictionary:
rpm -ivh pyDict-0.2.5.1-3.noarch.rpm
|
Other kits, such as GNOMEICU, XMMS, and XChat, must be installed as needed.
Install and set TrueType fonts
Run the following command to install the TrueType Font:
rpm -ivh ttf-arphic_bkai-2.11-1.noarch.rpmrpm -ivh ttf-arphic_bming-2.11-1.noarch.rpmrpm -ivh ttf-arphic_gkai-2.11-1.noarch.rpm rpm -ivh ttf-arphic_gming-2.11-1.noarch.rpmrpm -ivh ttfm-0.9-11CLE.i386.rpmrpm -ivh ttfm-0.9-11CLE.src.rpmcd /tmp tar zxvf /usr/src/redhat/SOURCES/ttfm-20000212.tgzcp ttfm/modules/* /usr/share/fonts/install/ ttfm.sh --initm all cd /usr/X11R6/lib/X11/fonts/TrueTypemkfontdir -e /usr/X11R6/lib/X11/fonts/encodings/large
|
Modify the/etc/X11/XF86Config file and comment out "#" before "FontPath"/usr/X11R6/lib/X11/fonts/TrueType.
Modify the file/etc/X11/XF86Config-4 by adding "Load" xtt "" or "Load" freetype "in Section" Module "".
Modify the/etc/X11/fs/config file and add a line to catalogue:
/usr/X11R6/lib/X11/fonts/TrueType
|
Then restart the XFS Server, enter the X-Window, and run "xlsfonts | grep GB2312" to display the "TrueType" font.
Print settings
To print Chinese characters, you must install the following software packages:
rpm --Uvh --force rhs-printfilters-1.63-1CLE.i386.rpmrpm --Uvh --force ghostscript-6.01-3CLE.i386.rpmrpm --Uvh --force ghostscript-fonts-6.0-1.noarch.rpmrpm --Uvh --force enscript-1.6.1-9CLE.i386.rpmrpm --Uvh --force printtool-3.44-1.noarch.rpm
|
After installation, run the printtool command to set the printer. Add the following to the file/etc/X11/. Xresources:
Netscape*documentFonts.GB2312*psname:Arphic-MingB5-ETen-B5-HNetscape*documentFonts.GB2312*pscode:GB2312 Netscape*documentFonts.GB2312*pswidth:1000Netscape*documentFonts.GB2312*psascent:880
|
Then execute "xrdb merge ~ /. Xresources ". Start Netscape, open a Chinese webpage, and select print. We recommend that you print it to the file first and use "gv netscape. ps" to check whether the display is correct. If there is no problem, you can print it directly.
After completing the above work, the Linux system will become very friendly, almost able to meet the needs of daily use of Chinese.
Related Articles]
- Linux Chinese environment (Special topics)
- Solution to Linux Chinese Environment
- How to Set up a Chinese environment in AIX