Hi everyone,
 
Thanks for the help of Kenichi handa and Werner Lamberg, now I can
successfully display full unicode chinese characters in emacs cvs unicode 2
branch, the following is my way:

=============================================================================
1. First, you must have the corresponding fonts which include full chinese
characters encoding in Unicode. In my case, I use the font sun-etxa.ttf and
sun-extb.ttf, which can be obtained from:
http://okuc.net/software/UniFonts.exe
After you get the UniFonts.exe, you must install it in Microsoft windows, or 
you can use the wine, so that you can get the Sun-ExtA.ttf and Sun-ExtB.ttf. 
For convenience, I change the two fonts name into sunetxa.ttf and sunetxb.ttf 
respectively, but it doesn't matter at all.
2. Now, you can make a dir named, say, haifeng, and put the sunexta.ttf and
sunextb.ttf into that dir, as follows:
******************************************
   sudo mkdir -p /usr/share/fonts/haifeng 
   sudo cp /path/to/{sunexta.ttf,sunextb.ttf} /usr/share/fonts/haifeng/
*****************************************
3. Now we generate the fonts.cache, fonts.dir, fonts.scale for the above
fonts:
    *****************************
    cd /usr/share/fonts/haifeng
    sudo mkfontscale
    sudo mkfontdir
    sudo fc-cache -fv
    **************************
   In order to support the GBK encoding scheme, you must do the following
step, open the fonts.dir and fonts.scale and append the following line into
them:

  **********************
sunexta.ttf -misc-sun exta-medium-r-normal--0-0-0-0-p-0-gbk-0
  *********************** 
   
4. Then, revise your /etc/X11/xorg.conf (if you use the XFree86, revise
XF86Config-4 correspondingly), make sure the file including the lines as
follows:

****************************
Section "Module"
[...]
Load "freetype"
[...]
EndSection
[...]
Section "Files"
[...]
FontPath        "/usr/share/fonts/haifeng"
[...]
EndSection
******************************

5. Restart your X-window to make the above settings take effect.

6. Compile and install the latest CVS emacs-unicode-2 version:

**********************************
cvs -z3 -d:pserver:[EMAIL PROTECTED]:/cvsroot/emacs co -r \
emacs-unicode-2 emacs

cd emacs

./configure --prefix=/usr --with-x=yes --with-xim --with-x-toolkit=gtk \
--with-toolkit-scroll-bars \
--enable-font-backend --with-xft \
--with-freetype --with-jpeg --with-png --with-tiff --with-xpm  --with-gif \
--x-includes=/usr/include/X11 --x-libraries=/usr/lib/X11 \
--enable-asserts --with-sound \
--with-pop --with-kerberos --with-kerberos5 --with-hesiod
(BTW, this configure just my sample, you can revise it to meet your case,
but the arguments:
-enable-font-backend --with-xft
 must be included in it!)
make bootstrap 
sudo make install
*************************************

7. If all the things above have been done successfully, you can do the
following things:
*******************
a. Put the following lisp code into your .emacs file which locates in your
HOME dir:
~~~~~~~~~~~~~~~~~~~~~
;;; Display the CJK EXT B chinese charaters:-)
(set-fontset-font
 (frame-parameter nil 'font)
 '(#x20000 . #x2fa1d)
 '("*-Sun-ExtB" . "unicode-sip"))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
b. Put the following into your .Xresources file which locates in your HOME
dir:

~~~~~~~~~~~~~~~~~~~~~~~~~
Emacs.Fontset-0: -*-fixed-medium-r-normal-*-15-140-*-*-*-*-fontset-14,\
chinese-gb2312:-misc-sun exta-medium-r-normal--14-*-*-*-*-*-gb2312*-*,\
chinese-big5:-*-*-medium-r-normal-*-14-*-big5*-*,\
chinese-gbk:-misc-sun exta-medium-r-normal--14-*-*-*-*-*-gbk-0,\
chinese-gb18030:-misc-sun
exta-medium-r-normal-*-14-120-0-0-c-0-gb18030.2000-0,\
mule-unicode-0100-24ff:
-misc-fixed-medium-r-normal--14-*-*-*-*-*-iso10646-1,\
korean-ksc5601:-*-medium-r-normal-*-14-*-ksc5601.1987-0,\
chinese-cns11643-5:-misc-sun exta-medium-r-normal-*-14-120-0-0-c-0-gbk-0,\
chinese-cns11643-6:-misc-sun exta-medium-r-normal-*-14-120-0-0-c-0-gbk-0,\
chinese-cns11643-7:-misc-sun exta-medium-r-normal-*-14-120-0-0-c-0-gbk-0,\
sjis:-*-medium-r-normal--14-*-jisx0212.1990-0

Emacs.Font: fontset-14
~~~~~~~~~~~~~~~~~~~~~~~~~~
BTW, on the safe side, you should creat a symlink of the .Xresources file to 
.Xdefaults:

~~~~~~~~~~~~~~~~~
ln -sf $HOME/.Xresources $HOME/.Xdefaults
~~~~~~~~~~~~~~~~~

*******************
8. The last thing, you should make a shortcut to run the emacs easily, just
do id as follows:

Make a file with the name Emacs23.desktop, then put the following into this 
file: 
*************************
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Emacs
GenericName=GNU Emacs 23.0.0.x
Comment=GNU Emacs 23.0.0.x (emacs-unicode-2)
Exec=/usr/bin/emacs --enable-font-backend
Icon=/usr/share/emacs/23.0.0/etc/gnu.xpm
StartupNotify=false
Terminal=false
Type=Application
Categories=Application;Development;
GenericName[zh_CN]=GNU Emacs 23.0.0.x
*****************************
Then, copy this file into /usr/share/applications/.
=======================================================================================

OK, that's all, have fun!

Thanks to Werner Lamberg and Kenichi handa again!
Thanks to Lay Buddhist Haifeng for his unifonts!
  
 Cheers,
 Hongsheng.
  

__________________________________________________
¸Ï¿ì×¢²áÑÅ»¢³¬´óÈÝÁ¿Ãâ·ÑÓÊÏä?
http://cn.mail.yahoo.com


_______________________________________________
Cjk maillist  -  [email protected]
http://lists.ffii.org/mailman/listinfo/cjk

Reply via email to