[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to write in Japanese under GTK ?



On Thu, 12 Nov 1998, Fabien Ninoles wrote:

> On Thu, Nov 12, 1998 at 08:22:30PM +0100, Martin Schulze wrote:
> > Ionutz Borcoman wrote:
> > > Can someone please give me some hints (in English) on how to code some
> > > labels under X Windows in order to obtain some hiragana ? I change the
> > > font and I display different things in Japanese, but I have no control
> > > on what I display. How do I control what I display ?
>
> (......)
> 
> It's www.debian.or.jp (take notes that they're no g in or).  Look also for
> the linux-nohongo document somewhere on the site of the Tokyo LUG site IIRC.
> I remember to see a --gnome-xim option that I think it's related too.

--gnome-xim option enables gtk widget to support XIM(X Input Method)
protocol, which is essential to input multibyte characters. It's like MS
Windows IME. As you know, Korean, Japanese and Chinese characters can't be
input with normal keyboard. (I don't mean that it is a hardware.)
Therefore, we, who live in CJK area, *MUST* input our native characters
with X Input Method Server, such as kinput2, cim  and htt under Solaris,
too.

You can compile gtk with --gnome-xim option, then use kinput2 as XIM,
anyway.

 Hmm. As you know, it is difficult for people using 1-byte charsets,
iso-8859-x, to understand 2 or multibytes charsets. (It doesn't mean that
implemetation is very complex for you because you don't live in CJK now.)

1byte charsets, such as iso-8859-1 are different from multibyte charsets.

X toolkit, Motif, and gtk widgets enable you to display multibytes
characters on your screen under X window system. I think, if you have some
interests in i18n, read ORA X series volume 4. Probably, you can find some
examples about internationalization(i18n) under X.

Simple Example (It's not my source. ONLY example.)

1) Append it to your X resources file, such as ~/.Xdefaults:

*international: true
*fontSet: -*-*-*-*-*-*-16-*-*-*-*-*-*

2) Run 'xrdb -merge ~/.Xdefaults'

3) Source 'xgoodbye.c'

#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xaw/Command.h>
 
void Quit(w, client_data, call_data)
Widget w;
XtPointer client_data, call_data;
{
  fprintf(stderr, "It was nice knowing you.\n");
  exit(0);
}
#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xaw/Command.h>
 
void Quit(w, client_data, call_data)
Widget w;
XtPointer client_data, call_data;
{
  fprintf(stderr, "It was nice knowing you.\n");
  exit(0);
}
#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xaw/Command.h>
 
void Quit(w, client_data, call_data)
Widget w;
XtPointer client_data, call_data;
{
  fprintf(stderr, "It was nice knowing you.\n");
  exit(0);
}

4) X resources of 'xgoodbye', named 'XGoodbye'.

*goodbye.international: true
*goodbye.fontSet: -*-*-*-*-*-*-16-*-*-*-*-*-*
*goodbye.label: 안녕히가세요.

5) run 'xrdb -merge XGoodbye'

6) Compile it.

7) *goodbye.label includes characters to display on your screen. It's
Korean, Hangul characters. That is, once you set your locale to 'ko', you
can see Hangul. If you want to see Hiragana, you can modify it.

If you change your locales, you can see various charsets.
Test it. (eg., export LANG=C, export LANG=ja and so on.)

I wish you considered it as the one of the most important issues on Debian
internationalization. :-)

Chu-yeon
--
Chu-yeon Park <kokids@doit.ajou.ac.kr> : We are KOrean KIDS, kokids!
              <kokids@debian.org>      : I love Debian!
PGP Key fingerprint = C3 8A B9 E4 E0 A6 74 30  45 00 E4 76 2E 29 D1 13
----------------------------------------------------------------------------
Internetworking Team, DoiT! in Ajou Univ., Information & Computer Eng. Dept.


Reply to: