README.16bit The Tk patch for multibyte (16bit) character and 16bit font, Version 0.2 (alpha), Apr.11.1993. by Kazuro Furukawa National Laboratory for High Energy Physics furukawa@kek.jp 0. Background ------------- As we work with particle accelerator operators who use Japanese language, we need 16bit character handling in Tk toolkit. Recently Dr. John Ousterhout stated that he would support compound texts in future. We hope to use it. In the meantime we need some simple treatment for 16bit characters. Thus I made this patch. 1. Introduction --------------- This patch kit enables Tk toolkit to handle 2 byte characters with almost all widgets. As I tried not to modify Tk data structures, its implementation is not so well organized. It works to some level. This patch does not enable compound texts, but only sequence of 2 byte characters. Some features of compound texts can be achieved with the text widget (see 'widget' in jdemos directory). This patch only enables alphanumeric 2 byte character input from keyboard. I want to interface to kinput procedure, but not yet. This feature is enabled only if these codes are compiled with FONT16 macro defined and a 16bit font is specified as an option for the widget (like -font k14). Please build the font16-patched wish and try widget demo under jdemos directory. The following things are present in this directory and its subdirectories: 1. Patch file, patch.16bit 2. New source file tkXText16.c 2. A collection of demonstration scripts to illustrate the use of 16bit features of Tk under library/jdemos directory. The enclosed code is known to run on most DEC, Sun, HP and Sony workstations running recent OS releases in combination with the X11R4 window servers from MIT. I tested DEC-Ultrix4.2c, SunOS-4.1.1, HP-UX 9.01 and News-OS 4.1.2c. 2. What's New Or Different In This Patch ------------------------------------------ You can specify 16bit fonts for -font option for almost all widgets, and you can display and manipulate 16bit strings on the widgets. Here is a short summary of what is included: (a) Patches for tkButton.c, tkCanvas.c, tkCanvText.c, tkEntry.c, tkFont.c, tkListbox.c, tkMenubutton.c, tkText.c, tkTextDisp.c, tkTextTag.c, tkConfig.h, tkInt.h, tkText.h (b) New file tkXText16.c (c) Makefile to build wish. (d) A collection of demonstration scripts to illustrate the use of font16 features of Tk, under library/jdemos directory. (e) 16bit font can be specified with -font option for button, canvas, checkbutton, entry, label, listbox, menu, menubutton, message, radiobutton, and text widgets. 3. Documentation ---------------- No separate documentaion now. Only this. 4. Compiling patched Tk ----------------------- Get tk3.2.tar.Z from tk/tcl distribution server such as sprite.berkeley.edu and get patch-16bit.0.2.tar.Z from olive.kek.jp under directory pub/tcl/. Extract files and apply patch. % zcat tk3.2.tar.Z | tar xf - % cd tk3.2 % zcat ../patch-16bit.tar.Z | tar xvf - % patch < patch-16bit Configure tcl % cd tcl % config Modify Makefile at INSTALL_DIR and others. % cd .. Modify Makefile at INSTALL_DIR, CFLAGS and others. (If you prefer Shift-JIS-kanji over EUC-kanji or DEC-kanji code, add -DSHIFTJIS to CFLAGS. I don't know if it will run on your system. See Bugs bellow.) Make... % make See original README. Do not remove -DFONT16 option in Makefile. 5. Installing ------------- Install into specified directory (INSTALL_DIR). % make install See original README. 6. Test Suite ------------- See original README. 7. Getting Started ------------------ If you don't have k14 font, please get and install it. Then move to library/jdemos directory and start widget demo. % cd library/jdemos % ../../wish -f widget You will see Japanese Tk demo. Menus with underline will show other Japanese windows. (If you specified -DSHIFTJIS at compile time, you may have to convert files in jdemos into Shift-JIS coding.) 8. Newsgroup ------------ See original README. 9. Feedback Wanted ------------------ I'm very interested in getting feedback from you both about bugs and about overall design issues. Send your comments to "furukawa@kek.jp". I'll do my best to fix show-stopping bugs quickly, but most other things may not get fast turnaround, since I already have a zillion high-priority jobs. 10. The Future ------------- Dr. John Ousterhout stated that he would support compound texts in his official Tk. I hope this patch will disappear soon. 11. Bugs -------- No handling for \n, \t, etc. in tkFont.c. Selection must have at least one character. Some strange selection display when insertion to Entry widget. Right scroll button of Entry widget does not work. Menu traversal does not work. Kinput should be integrated with insert action. Only EUC or DEC kanji code supported, conversion of other codings should be in tkXText16.c. Trial to support Shift-JIS is included. But I don't know if your character classification library is 8bit compliant. Maybe I must use Locale functions explicitly. EUC code does not need Locale treatment. Language support from C language and Unix should be integrated. Canvas postscript won't work for Japanese texts. etc, etc. 12. Changes ----------- 0.1 K.Furukawa, Apr.11.1993. first patch file. 0.1 -> 0.1.1 K.Furukawa, Apr.12.1993. add ctype.h to tkXText16.c 0.1.1 -> 0.2 K.Furukawa, Apr.13.1993. modifications in comments and README.16bit support Shift-JIS kanji coding as well as EUC (or DEC or ATT) coding. It is not complete. Sorry. announce to comp.lang.tcl.