The Japanization of Tk

by Yoshiyuki Nishinaka (nisinaka@sra.co.jp)
   Makoto Ishisone (ishisone@sra.co.jp)
   Motonori Hirano (m-hirano@sra.co.jp) ... 8.0 support.
Software Research Associates, Inc.


1. Introduction
---------------

Here we provide a patch kit for enabling Tk to handle Japanese characters
(kanji).

The patch kit contains:

    + Modifications to the Tk8.0 source code
	- Tk widgets are modified to display, input and cut&paste kanji
	  string.
    + A document describing the incompatibility from the Tk4.xjp.
      (Only Japanese versions is available. sorry for that)

The Japanization is self-contained except XIM support -- to enable XIM
(X Imput Method) support, You should use at least X11R5 (X11R6.3 later
is prefferd. XFree86 3.3.2 is the best). Furthermore, the X11 library
must be "well-configured". If your operating system doesn't have
setlocale(3) that can handle proper locale for kanji (like
"Ja_JP.eucJP", "japanese", etc..), the X11 library must be
configured/compiled with "-DX_LOCALE" cpp flag. Even if you are not
sure about this, don't worry :) see 3. to disable XIM feature.


2. Some selected features
-------------------------

The Japanization includes the following features:

    + Every Tk widget can handle kanji strings which can contain both kanji
      (Shift-JIS, JIS, EUC) and ascii encoded characters.
    + It conforms to the ICCCM for string encoding (COMPOUND_TEXT) on data
      exchange so that it can exchange data with other applications which also
      conform to the ICCCM.
    + Users are allowed to input kanji strings via kinput2 (The popular input
      method which is included in the X11's user contributed
      software). Also as the input methods, user can use XIM protocol. The user
      may choose an input style for each widget from:
		PreeditPosition StatusArea
		PreeditPosition StatusNothing	... AKA "over the spot"
		PreeditArea StatusArea		... AKA "off the spot"
		PreeditNothing StatusNothing	... AKA "root conversion"
      Callback conversion is not supported.
    + Canvas widgets can also generate kanji PostScript(tm) outputs
      (including CID encording fonts support).
    + Additional named fonts creation method to compound the iso8859
      font and the jisx0208 font.

Please refer to the document for details.


3. Compile & Installation
-------------------------

You may need to specify the Tcl directory when you run `configure' script.  I
usually rename a Japanized Tcl source directory as `tcl8.0jp'.  In this case,
you have to run `configure' script as follows:

	% ./configure --with-tcl=../../tcl8.0jp/unix

The 'configure' script have following japanized specific options:

--enable-kanji		enable kanji features('enable' default)
--enable-kinput2	enable kinput2 protocol('enable' default)
--enable-ximImprove	enable better XIM protocol support('enable' default)
--enable-xlfdCheck 	enable invalid XLFD name checking feature('enable' default)
--enable-xlibHack       replace some functions in Xlib for font cache('disable' default)
				... If you are using XFree86 3.3.2 you can use this option.

Some of the library files (usually installed in "/usr/local/lib/tk") are
modified for the Japanization.  Since these modifications do not affect
anything about the behavior of the original Tk, any scripts for the original
version can also work with the libraries of this Japanized Tk.

There is an major incompatibility between tk4.xjp and tk8.0jp. For
more detail, see "Incompat80jp" in this directory.


4. Test
-------

We provide a test suite 'tests/fontjp.test' for the Japanized Tk.


5. Bug report
-------------

Please report comments & bugs via e-mail to:

	tcl-jp-bugs@sra.co.jp

Please don't forget to include a brief description of your environment such as
your machine type, OS version or X library version.
