CJK - Chinese/Japanese/Korean languages for TeX (LaTeX 2e). Original CJK package by Werner Lemberg. Original pbmtopk by AJCD and Tomas Rokicki. Adapted for Amiga usage by David Fong 23-Dec-94 to 20-Jan-95. What is in this readme file 1. Includes - What does this package have? 2. Contents - What is in each of this package's directories. 3. Purpose, and how to use this package. - Including setting up and finding fonts and how to edit `Chinese' text. 4. Update notes 5. Parting words Appendices (in a separate file, named `appendix') A. Where can I find CJK? B. Where is the Aminet? C. Where can I find Chinese software? D. What Chinese software is available for the Amiga? In particular, text editors and text viewers? E. Where are the Chinese fonts? F. How do I install CJK? 1. Includes - Compiled programs from the CJK package and other necessary binaries... hbf2hbf Modified version of hbf2cjk `Corrected' and modified version of pbmtopk (from netpbm package). all compiled by GNU GCC 2.6.3. I have not included the major portion of the CJK package. CJK can be obtained from CTAN sites (see Appendix A). Oh dear, any programs I compiled with GCC requires the ixemul.library. Unfortunately, anything I compiled with `-noixemul' didn't work. More specifically, my Amiga crashed when `hbf2cjk' was run (having generated quite a few dozen font files, but not all of ones required). Please tell me what could be wrong... 2. Contents - cjk - bin - binaries of `hbf2hbf' and `hbf2cjk' - src - modified sources of the same. netpbm - bin - binary of `pbmtopk' plus other programs from the netpbm package that are required by `hbf2cjk' - src - modified sources of `pbmtopk'. 3. Purpose and usage. a. Purpose As of yet, the Amiga does not have a Chinese language word- processor. However, the TeX package, which is available in at least three different guises for the Amiga (AmigaTeX by Radical Eye Software, PasTeX and also generic TeX), can be extended to handle Chinese. One such package is `CJK', written by Werner Lemberg. It is available at CTAN sites (see Appendix A if you don't know what CTAN is). CJK in turn requires LaTeX 2e (also available at CTAN sites!), which in turn requires a version of TeX to run. Personally, I use PasTeX 1.3 (available at CTAN sites, but also at Aminet sites and Fred Fish CD-ROM), and also the beta 6 version of PasTeX (available on the Aminet). Note that PasTeX 1.3 comes with LaTeX 2.03, which needs to be updated to LaTeX 2e if you want to use CJK. * What is the Aminet? See Appendix B. And what did I need to `correct' with pbmtopk? Well, neither the pbmtopk provided with the netpbm distribution, nor that provided with PasTeX actually work. Recompiling the source provided with netpbm with GCC 2.6.0 didn't work either. For some reason, the pbmtopk provided rejects perfectly valid `opt' file lines. This is a bug with GCC, I think. I replaced.... if (sscanf(here,"%s%n",str,&n) != 1) with... a=sscanf(here,"%s%n",str,&n); if (a != 1) b. Usage - setting up. Sorry, I was unable to compile the programs successfully without resorting to `ixemul.library'. I'm afraid you'll have to obtain a copy of `ixemul.library'. One source is the `dev/ gcc' directory in Aminet archives. I tried to use `libnix', but it failed. Please tell me if I was using libnix incorrectly. I was calling gcc with... gcc -noixemul source.c gnu:lib/libnixmain.a -lm -o object All the programs I compiled required command line arguments. Some of the programs seemed to work, but after running for a while would eventually crash. (In particular, hbf2cjk would successfully create a few pk files, before crashing. `pbmtopk', which is called multiple times by hbf2cjk, may have been responsible?) Setting up PasTeX, or any public domain version of TeX, is a complete story in itself. You might be able to avoid some of the hassle by setting up `AmigaTeX' by Radical Eye Software. Be warned, however, that it costs quite a lot more than most Amiga desktop-publishers, but probably a lot less than a legitimate copy of Chinese WordStar (but all those IBM clone users are worse pirates than Amiga owners...). By the way, PasTeX provides its own copy of `pbmtopk'. Just like the one provided in the netpbm distribution, it doesn't work. PasTeX's copy is in tex:bin. If you have set up PasTeX, tex:bin will be in the standard search path. So it would be better if you delete PasTeX's copy of pbmtopk, to prevent it being called from `hbf2cjk'. b1. Usage - setting up the fonts. Japanese and Korean users are relatively lucky, outline fonts are available for their character sets. I haven't tried to use them, so they might have problems in setting up `CJK' that I don't know about. The big problem for Chinese language users is that outline fonts are not generally available. In any case, CJK provides a set of programs to convert `Hanzi bitmap fonts' to a format usable by CJK and LaTeX 2e. Werner Lemberg was kind enough to provide the C source for those utilities. Anyone with enough perseverance and computer know-how to set up PasTeX could probably compile the C source code by themselves. However, to save those people time (like about 12 hours), I have compiled `hbf2hbf' and `hbf2cjk' with GNU C 2.6.3. hbf2hbf creates an `.hbf' file. Included in this file is a line which defines where the `.bmf' file is to be found. For example... HBF_CODE_RANGE 0x0100-0x20F2 ram:jsfs10.bmf 0 Of course, if you decide to place your `.bmf' file elsewhere, you might want to change this line. For my purposes, I changed `ram:jsfs10.bmf' to `jsfs10.bmf', and ran `hbf2cjk' from the directory where jsfs10.hbf and jsfs10.bmf resided. `hbf2cjk' uses the package `netpbm', which is available on the Aminet. (See Appendix B if you don't know what the Aminet is). Unfortunately, as far as I can tell, `pbmtopk', as provided on `netpbm', does not work. So I had to recompile its source code (the source code is also available on the Aminet!). For convenience, I also included the other netpbm files required by hbf2cjk. b2. Usage - Running the programs. I've changed hbf2cjk to allow different point sizes and independent x and y resolutions. Obviously, the original programmer assumed that everyone has 300x300 dpi or 600x600 dpi laser printers! As a result of my changes, the arguments to hbf2cjk have changed... hbf2cjk HBF_file fontname x-resolution y-resolution size family encoding To create a 100 dpi jsfs font at 14.4 point size (e.g. ShowDVI)... hbf2cjk jsfs10.hbf jsfs10 100 100 14.4 "Jianti FangSong" GB To create a twelve point font at 600x300 dpi (e.g. HP 520)... hbf2cjk jsfs10.hbf jsfs10 600 300 12 "Jianti FangSong" GB b3. Usage - finding the fonts. Of course, you will need to find bitmap fonts to convert to LaTeX format. They range from 16 pixels wide, to at least 56 pixels wide. These will be appropriately scaled by hbf2cjk. If you are lucky enough to have a 600x600 dpi printer, some `ready-made' LaTeX fonts are available on the Internet (reportedly, I haven't actually found them at a CTAN site). See Appendix E. b4. Usage - editing `Chinese' text. The other problem you will have to resolve is a Chinese text editor. CJK will accept `GuoBiao' encoding. It also accepts other encodings such as `Big5' and `KS'. In GuoBiao encoding each Chinese character is encoded as two bytes, using the upper range of the ASCII character set (a range of values above 128). Apparently, there are a number of DOS programs which allow you to write GuoBiao encoded text, such as Z-DOS. And you could use Windows/Mac Chinese editors to create GuoBiao encoded text. But you want to do everything on the Amiga, right? Well, also available at CTAN archives is CHText. This converts Pinyin to GuoBiao (and back again). Source code is provided (as is a 16 pixel Chinese bitmap font), but I met only moderate success in compiling this monster. Curtis Eubanks did a much better job, see Appendix D. What does ChText do exactly. You type in Pinyin ASCII with your favourite text editor (just like a TeX document). For example `Ni3 hao3'. Tone marks are optional, but speed up the conversion process. Some `compound characters' are provided, like `ming2-tian1', to again speed up the conversion process. Whatever needs to be converted to GuoBiao is encapsulated in `\Zw' and `\As', just like a TeX environment is enclosed in something like `\begin{document}' and `\end{document}'. However, the ChTexT will remove `\Zw' and `\As' when the file is processed. If the Pinyin could represent one of several characters (a common occurrence), ChText presents a range of characters to choose from. Of course, the number of characters is reduced if tone marks and recognized compound characters are used. ChTexT can also convert GuoBiao back to Pinyin, but with extra identifiers. These extra identifiers remove the need to `choose' that character again when the file is converted to GuoBiao again. `Ni3' may have been converted to `Ni3xl (I made that up, but that is what it looks like)'. The Pinyin is still entirely recognizable. 4. Update notes I thought I managed to compile this thing successfully with the `-noixemul' option, but alas, it was not meant to be... 8-Jan-95 The original hbf2cjk only allowed a short fontname, to suit those silly MS-DOS/Windows machines, I think. I have extended the file-name length quite a lot, allowing one to specify a destination directory as well e.g. `ram:jsfs10' 16-Jan-95 I have changed the source of `hbf2cjk', so that the arguments are now different... Previously, `hbf2cjk' assumed all created characters were ten points in size, and so `#define DSIZE 10'. Inter-character spacing was calculated accordingly. That's just not acceptable! And so I introduced new code so that the resolution and point size are separately defined... hbf2cjk HBF_file fontname resolution size family encoding To do... I've had to return the 24-pin 360x360 Fujitsu printer I borrowed from some-one else. Now I have my 240x216 MPS 1000 (Epson OX). If I buy a new printer, it wil probably be a 600x300 HP 540. But neither `hbf2cjk' or `pbmtopk' currently support fonts which have different `x' and `y' resolutions. This will obviously be my next target...but if there is source code to a `pbmtopk' which supports different `x' and `y' resolutions out there, please send it to me (or tell me where it is on the Internet)! 20-Jan-95 OK, on this windy afternoon after work I've re-written and successfully re-compiled pbmtopk and hbf2cjk to accept separate x and y resolutions. However, I haven't tested these programs yet, I'm procrastinating over whether I'll buy that Hewlett Packard 540 or not. I'll probably hook up my MPS 1000 over the next few days... Now the arguments required are... hbf2cjk HBF_file fontname x-resolution y-resolution size family encoding 26-Jan-95 The separate x and y resolutions arguments do work! Unfortunately, CJK has moved to version 2.4, the newest version doesn't even have the program `hbf2cjk'. It does have the program `hbf2gf', which does not require the netpbm library, but does require the programs `gftopk (provided with PasTeX)' and `pltotf (not provided with PasTeX, but is available as Pascal (WEB) source)'. Unfortunately, I don't have a Pascal compiler ready-to-run on my system, so it looks as if I have some work to do. The good news is that hbf2gf is supposed to be ten or so times faster than hbf2cjk... 5. Finally I only got the whole thing working yesterday. It took a lot of sweat and tears, particularly for someone who doesn't actually know much Chinese (I learnt it as a foreign language during my high school). Please excuse me if the bugs are appalling, or some of the information is incorrect or vague. My full-time job is not programming! Nevertheless, I more than welcome bug reports and correspondence. Although I didn't write anything, perhaps there is (yet another) compiler option I should have switched on... I have released this package in the hope that anyone else who intends to use Chinese on their Amiga will find it easier to do so. However, I am well aware that people who can use TeX, and who can then also use strange programs from Unix world are a special and unusual breed! Zai4 jian4! 7-Jan-95. David Fong vkelim@ariel.unimelb.edu.au (as of 1994) firehand@ariel.unimelb.edu.au (brother's account) 13 Silverdale Road, Ivanhoe, 3079. Australia.