*********************************************** * CNPRINT.HELP For CNPRINT Versions 2.60/2.61 * *********************************************** Copyright YIDAO CAI (~{2LR@5@~}), 1992-1995 All Rights Reserved. Free for non-commercial and personal use only. Disclaimer: Posting CNPRINT on any FTP site does not imply the author's endorsement of the beliefs of the organization who owns the FTP site. Last revised on January 25, 1994 ----------------------------------------------------------------------------- PLEASE *** READ parts 0 (What's New), II (what do you need), IV (First thing to do) and VI (Font) before compile, EVEN if you have used CNPRINT before. *** Users of previous versions: make sure the new version works before deleting the old version. *** Test with a small file the first time, or view the PS file on screen first, if possible. *** If you encounter problem using CNPRINT, read part VII (known problems) *** If you forgot the usage, type "cnprint -h" for quick on-line help. *** You do NOT need to get the HBF files and bitmap font files again if you already have them. *** The ftp site "ifcss.org" is now named as "ftp.ifcss.org" ----------------------------------------------------------------------------- CONTENT ----------------------------------------- 0. What Is CNPRINT and What's New I. Functions and Features II. What Do You Need to Use CNPRINT III. Where to Get CNPRINT IV. First Thing to Do V. Usage VI. Font Files VII. Known Problems VIII. Author IX. Acknowledgements Appendix A, B ----------------------------------------- 0. What Is CNPRINT and What's New CNPRINT, a utility to print Chinese/Japanese/Korean text (or convert to PostScript) under DOS, VMS and UNIX systems. It works just as a print command on your system. Currently GB, Hz, zW, BIG5, JIS, EUC, Shift-JIS, KSC, UTF8 and UTF7 formats are supported. These versions are updated from V2.40/V2.41. New/improved features are indicated by *. Thanks to users for your valuable support and suggestions. Main changes: 1. Six positions for page number 2. Allow pipeline-input for unix and DOS (-i option) 3. Support Korean KSC-5601 4. Support more Japanese formats: JIS (old-, new-, nec-), shift-JIS, EUC 5. Auto-detect input codes (either Chinese or Japanese, not both) 6. Vertical option for Japanese 7. -f hbfname --> -f=hbfname; -n 0 --> -n=0 8. Repair functions for GB/Big5/JIS 9. Added control to make the text (e.g. titles) appear at the center of a line (@[CB], @[CE]) 10. Support European characters generated by NJstar (those characters are mapped to 128-160) 11. Now do not break English (ascii) words and numbers like 123.4 12. Draw a line under text (@[UB], @[UE]) 13. Specify char size on command line: -size=15.4 14. Support unicode (utf8, utf7) 13. Fixed some bugs. Next release: add True Type Font support ? Version 2.60 is for UNIX and VMS, Version 2.61 is for DOS. I. Functions and Features * 1. Print GB/Hz/zW/Big5/JIS/EUC/KSC/UTF7/UTF8 format CJK documents (or pure English documents), or convert them to PostScript. (a, b) 2. Hz <-> GB conversions. (c). 3. Small disk space requirement; PS file < 400K per issue of HXWZ. 4. Support HBF, work with almost all bitmap font files with any sizes. 5. Change font (character size) for a whole document, set font (character size) for a group of characters. 6. Multi-column for a page or part of a page. 7. "Intelligent" treatment of punctuation marks. 8. Set gray level for a whole document or a group of characters. 9. Page numbering, change of margins. 10. Set paper orientation: Portrait or Landscape. 11. Vertical printing mode. 12. Change line space and character space and width of English chars. 13. Change English font. 14. Multiple copies of print-out. 15. User defined default values for margins, character size, etc. 16. Start a new page at any point (@[P#]). 17. Generate and import EPS files (picture/graph/text). (see V.10, V.17) 18. Page header, i.e. put something on a specific place on every page. (see V.17) 19. Character or word statistics (enhanced version only, see V.18) * 20. Support European characters 21. Friendly designed so that even if you make a mistake the program would take care for you in most cases. (a). SPEED of printing depends on printer and the number of characters in a page (from 3-4 pages per minute to 1.5 minutes per page). The fastest reported so far is 135 seconds for one issue of HXWZ. (b). If one page, the PS file conforms to the Encapsulated PostScript file format EPSF 3.0 and can be included in other documents (such as a Microsoft Word document). See part V for details. (c). Simple Hz<->GB conversion for standard Hz/GB file. For files that might contain bugs, F. F. Lee's hz2gb is suggested. The use of zW is discouraged, as proposed by Mr. Ya-Gui Wei, co-inventor of zW, in ZWDOS help file. II. What Do You Need to Use CNPRINT A machine runing UNIX or VMS (V2.60), or an (IBM compatible) PC running DOS (V2.61) A PostScript printer (CAUTION: NOT ordinary laser printer) CNPRINT V?.?? One or more Chinese (HBF) font file(s) (see part VI) III. Where to Get CNPRINT site: ftp.ifcss.org directory: /pub/software/unix/print (cnprint260.readme, cnprint260.tar.gz) /pub/software/vms/print (cnprint260.readme, cnprint260.zip) /pub/software/dos/print (cnprint.doc, cnprint.zip) Note: 1. The /software directory at ftp.ifcss.org is mirrored at cnd.org (132.249.229.100, directory /pub/software) and nctuccca.edu.tw (140.111.3.21). As an alternative to ftp.ifcss.org, you may also use these two mirror sites for fast access. 2. The ftp site at neurophys.wisc.edu also carries the above files (except fonts and HBF files). The directory is [public.cn]. This site also contains the latest yet not formally released versions and some "bug-fix" for unusual systems. It is a VMS ftp site, please use "cd [public.cn]" to change to the directory and transfer all files in ASCII mode. The files there are NOT zipped. You may want to read the file "00readme.0", if you have any questions. 3. Other sites may also carry CNPRINT, but the author will only update ftp.ifcss.org and neurophys.wisc.edu with each release. 4. After gunzip or unzip the file "cnprint260.tar.gz" (or cnprint260.zip, cnprint.zip), you will get the first 3(4) files depending on your system. You need to get font files and HBF files seperately (or you can use font and HBF files from other softwares). Please read part VI before you get any font or HBF file). UNIX: cnprint.help, cnprint.c, cnprint.cmd, cnprint.1, fonts, HBF files VMS: cnprint.help, cnprint.exe, cnprint.cmd, fonts, HBF files DOS: cnprint.hlp, cnprint.exe, cnprint.cmd, fonts, HBF files IV. First Thing to Do 1. Edit file "cnprint.cmd" to add/change some default settings. (Users of previous versions: The data in "cnprint.cmd" of this version is updated, so you NEED to update) (CNPRINT can work without "cnprint.cmd", but some functions will be lost) In "cnprint.cmd", you need to a. Specify the PS print command (device port) on your system. (DOS only: the device port for printing PostScript files is most likely to be one of LPT1, LPT2, LPT3, COM2, COM1. Put "LPT2:" if it is LPT2. Ask a local expert for help) WARNING: The print command (port) MUST be the command for printing PostScript documents. If you are NOT sure, please DO ask your system manager, otherwise it could cause BIG problems. If you do not specify the print command (port), CNPRINT would still generate PostScript file(s) but would not print it, you can then print it by sending it to a PS printer. b. Specify the default Big5/JIS/KSC/unicode font (HBF) file name if you are going to print Big5/JIS/KSC/unicode(Japanese, Korean or unicode) documents. c. (Users outside US) Change the paper size if needed. The default is A (8.5x11 inch). (see Appendix A for paper sizes). d. (NOT required, advanced users only) Specify the path/name of the temporal file and device resolution. 2. (Beginners only) Put all files in one directory and run CNPRINT under that directory. 3. (NOT required, recommended for advanced users only) Specify the full path (directory) for the font files (HBF files and bitmap files) and the file "cnprint.cmd". DOS: add a line in the "autoexec.bat" file: set HBFPATH=C:\FONT (if font is kept under dircetory C:\FONT) UNIX: set an environment variable HBFPATH (put it in your .cshrc file) setenv HBFPATH "your_subdir_for_fonts" VMS: follow steps in 5. Note: HBFPATH may point to several paths, you may seperate the paths by ; in DOS, : in unix, and , in VMS: DOS: set HBFPATH=path1;path2;path3 unix: setenv HBFPATH "path1:path2:path3" VMS: $HBFPATH :=="path1,path2,path3" (in login.com) 4. (UNIX and VMS only) Compile the source program (there is no need to re-compile after making changes in "cnprint.cmd"). UNIX: cc cnprint.c -o cnprint if you see a lot of error messages, you may try "gcc", "acc", or ask a local expert or system manager for help. VMS: get "cnprint.exe" directly. If that did not work, you can get cnprint.c in the unix package and compile: cc cnprint link cnprint del cnprint.obj;* If this did not work, ask your system manager for help on how to compile a C program. CNPRINT may not work on old versions of VMS. If you are using old versions of VMS, ask your system manager to update it. 5. (VMS only) You need to create a login file under your main directory (or modify it if already exists). The file name is "login.com". Put two lines similar to the following in it: $cnprint :=="$mvsd:[cai.gb]cnprint.exe" $HBFPATH :=="mvsd:[cai.gb.font]" here "mvsd" is my disk name; "[cai.gb]" and "[cai.gb.font]" are my directories containing "cnprint.exe" and fonts respectively. You should change them accordingly. If this did not work, ask your system manager for help on how to setup these things. 6. (DOS only, recommended for advanced users only) If you want to run CNPRINT under any directory, you can a. put the directory containing cnprint.exe in the PATH in autoexec.bat (but it may make PATH too long); b. create a file "cnprint.bat" containing a line similar to the following only, "c:\your_subdirectory\cnprint %1 %2 %3 %4 %5 %6 %7 %8 %9" put this file under a directory which is included in the PATH (but it doesn't like those options with '=', so you should use '/' instead, e.g. -f=j24 --> -f/j24). 7. Follow the instructions in part VI to get HBF files and bitmap font files at the ftp site listed there. 8. Test with pure English text or a short GB/BIG5/JIS/KSC file (one or two lines). If there is any problem, go to part VII. V. USAGE For normal usage: cnprint filename For help: cnprint [-h] For extended usage: * cnprint [-h] ... [-gble] [-f=font] [file1 [file2]...] ... [-o=Outfile] * -h: Three-paged help messages * -i: Use standard input (pipeline) (21) -5(-55)(big5): Input is Big5 file (12) -z(-zz)(-zzz): Hz to GB conversion only (4) -w: Convert GB/Hz to PS without printing (4) -x2: Set character width/height 1.2 (2) -y3: Set character height/width 1.3 (2) -p4: Print/convert 4 pages at a time (8) -c3(-c320): Divide one page into 3 columns (-c320, optionally specify the space between columns as 20 points, 1 point = 1/72 inch) -f=font: Select font (2) -l(-l3): Set paper orientation Landscape (5) -j: At the end of document, the printout does NOT go to the bottom of a page if multicolumn * -v(-vv): Vertical printing mode (13) -s: Suppress the effects of the functional sequences @[**] (6) -t(-tt): Do not print time and CNPRINT logo on lower-left corner (-tt: print time and input file name) -m3(-m): Print 3 copies of the document (do NOT display menu if -m) (-m3m or -mm3 for both) -g: Generate PS file of the format used in V2.30/2.31 -hz(zw)(gb): Input is a Hz (zW) (GB) file (7) * -jis(jis8)(euc): Input is a JIS (Japanese) file (7, 12) * -ksc: Input is a KSC (Korean) file (7, 12) -a: Print double letters and numbers as English ones (7) -e56(-e): Set the width of English char 0.56 of that of Chinese char (Output is an EPS file if -e) (-e56e or -ee56 for both) (10) -d: Do -e5 and suppress the special treatment of punctuation marks (11) -b3(e21): begin printing at page 3, and (optional) end printing at page 21 (14) -r=450: Print/display device resolution 450 dpi (default 300) -o(-oo): print only odd-numbered or (-oo) even-numbered pages (14) -o=PS/GBname: Specify output file name (4) -q=laserps (DOS, -q=lpt2:): specify the PS print command as "laserps", or in DOS, specify the PS print port name as "lpt2:" (15) * -tab: TAB mode CLK<->ASCII (default: 4 CJK chars or 8 ASCIIs if -aa) * -r#: repair functions (#: 1-7), see on-line help for more. * -size=15.4: Char size 15.4 points. * -utf8(utf7): Input is 8-bit (7-bit) unicode file. Note: a. Most of the options can be combined. b. The order is not important. * c. Allow several input files at one time (same format, i.e. GB, Hz, Big5, JIS, KSC). * d. In unix and DOS, pipeline input is supported (for irregular files, don't use pipeline). e.g. cnprint -w -x2be10 filename cnprint -x2b5e10 filename -o=PSname -hz cnprint -x2be10 filename -c2 -o=PSname -q=laserps cnprint -x2be10 file1 file2 file3 -w -o=PSname 1. To set margins, line space, character space and character size for the WHOLE document, run CNPRINT and follow the menu instructions. You can also set your preferred values in cnprint.cmd. 2. To select font and character width-height ratio for the WHOLE document, use -f, -x -y options above. The use of -f option is -f k24 or -f=cnk24.hbf for 24x24 Kaishu font -f f16 or -f=cnf16.hbf for 16x16 Fanti font (see Part VI for meaning of k24, f16, etc) ***Important*** It is recommended to set the font, line space, char space and char width/height used for the WHOLE document or majority of the document by -f, -x, -y or menu. This would make the program much more efficient. 3. Functional sequences (@[**]). Insert them anywhere in your document to control certain features of printout. They will not appear in the printout. @[f*] or @[F*] select Chinese font, 16, 24, 48. * is the font style code, see d). @[v*] or @[V*] select Chinese font, 40, 56, 64 (d) @[h1] or @[H2] select English font, normal (upright) @[q3] or @[Q4] select English font, italic/oblique (Xieti) capital H/Q: Bold; number 0-9 for different font, see menu at run time for a list. @[18] Set character size in points. 1 point=0.355mm @[E7] Set width of English character 0.7 of that of Chinese char * @[X2] or @[Y3] Set character width/height Cx 1.2 or height/width Cy 1.3. In both cases, the line space, Ci, is set as Ci = Cy + (Cx-1)/2 - 1; if @[X0] (@[Y0]), Ci is set to the default value displyed in menu. @[X#] and @[Y#] are locked, change one will automatically reset the other @[G2] Set gray level 0.2, 1=white, 9=black, 0=default (1.0, black). @[C2] Column formatting, i.e. divide the text into 2 columns begining at this point. * @[Ix] Set line space, x must be 0-9, a-f. 1-9 set the line space 0.1-0.9 of the standard value and a-f set it 1-6 times of the standard value (standard value = 50% of char size). If x is 0, default value is used (as displayed in menu) * @[Ax] Set character space, x must be 0-9, a-f. 1-f set the char space 1-15 times of the standard value (standard value = 8% of char size). If x is 0, default value is used. @[EP] Include EPS file, enter EPS filename when asked by program. @[P2] Start a new page if the current position is within 2 lines of the page end. If @[P0], start a new page immediately. If used with multicolumn option, this command may produce effects some people don't like (while others may like). @[AS] or @[AR] (In envelope mode) Mark the beginning of the Address of Sender or Receiver. If AR, CNPRINT will move the left margin 3.25 inch to the right so that the address of receiver will be printed at the desired position. If the input file contains more than one receiver's address, add @[P0]@[AS] at the beginning of each subsequent sender's addresses and select manualfeed option. @[MVxxxyyy] Move current point to (xxx, yyy), allow you put text anywhere on the page. xxx, yyy are in points (1inch = 72pts) and are relative to the upper-left corner of the text. If (3, 25), put @[MV003025] instead of @[MV325] or @[MV 3 25]. If xxx (or yyy) equals 001, then do NOT change x (y) position. This is not designed to work with multicolumn at this stage so it may affect the column formatting. * @[CB] or @[CE] Begin/End central adjust. Make text line(s) (e.g. titles) in between appear at line center, leaving equal spaces on both sides of the text. The text line(s) must not be part of a long line (i.e. they must be seperated by end of line characters at both ends by pressing return or enter key. Spaces before the text will not be counted in determining the position of the text, BUT space after the text will. Extra spaces may make the line too long to be fit into one printed line and thus cause failure. If @[Cb] is used instead of @[CB], non-ASCII spaces befor the text will be counted in determining the position of the text. * @[UB] or @[UE] Begin/end underline. Draw a line under the text. If @[uB]/@[uE], broken line (on:off ratio 10:7). [the sequence UB/UE/uB/uE may be changed in the next version] a. All the above letters, except otherwise stated, must be in upper case; 0 or 00 would select the default value in most cases. b. Each of the above sequence would take effect immediately and stop only after a selection of the same/similar nature is chosen again, except noted otherwise. For example, if you select a character size 12 by @[12], it would remain 12 points until you select another size, say 15 by @[15]. c. Column marker @[C*] must begin at the beginning of a paragraph and must end at the end of a paragraph right after the hard return (i.e. the beginning of next line, even if it is a blank line). d. To select font, you must specify font style by j, f, n, k, h, ... or J, F, N, K, H, ... in the place of * in f* or F*. The meaning of j, f... is j/J for Jianti, f/F for Fanti, etc (this is actually set by yourself, see the FONT part). The font size are small (16x16), middle (24x24) and large (48x48). To specify small size font, both f* must be in lower case; to specify middle size font, one and only one of f* or F* should be in lower case, the other in upper case. For example, @[fH] or @[Fh] both select 24x24 Heiti font, and @[ff] select 16x16 Fanti font. Similar rules apply to 40x40, 56x56 and 64x64 fonts (use v*, V* to select). *** The metric information about English font is obtained from HP printers and may NOT apply to other printers. Besides, only printable characters are included. e. The program will use whatever character size, width/height ratio right before the column maker @[C#] setting the parameters for the columns, so it is best to select the character size and width/height ratio for most of the multicolumn portion right before the column marker @[C#]. 4. If -w is selected, CNPRINT would generate a PS file but would not send it to the printer. If a PS file name is given, the PS file would be kept. The optional PS/GB name is taken as PS file name unless -z(z)(z) or -r# is selected. -zz: GB -> Hz only; -zzz: GB/[...] -> GB[...]: filter out the functional sequences @[**]. 5. If you use -l to change paper orientation to Landscape, the page will be divided into 2 columns (to make it one column, use -lc1 or -c1l). -l1, -l2, -l3, -l4: select one of the sepecial landscape modes, the settings in "cnprint.cmd" will be suppressed. These modes are designed for printing HXWZ (l1, l2) or LYTX (l3, l4). 6. Option -s would suppress the effect of the functional sequence @[**] and would not print it. But if you want it to be printed, use -s# (# is any single digit number and # > 2). 7. If you use -hz/zw to tell CNPRINT that the input is a Hz/zW file, CNPRINT would not ask for conformation. But this is only optional. -a: Print GB-ASCII alpha-numericals to English ones. Also convert non-ASCII spaces between GB-ASCIIs to ASCII space. [GB only] -aa: Input is a pure English text (some settings to make it look nice). -jis(euc, jis8)(ksc): Necessary when you print JIS(euc, shift-jis)/KSC (Japanese/Korean) files unless you defined the default encoding as JIS/KSC in CNPRINT.CMD. -gb: Necessary when printing GB files if the default encoding is not GB. 8. If you do not have enough disk space (this is less likely to happen because the PS file generated by CNPRINT is quite small), try -p# option. 9. You MAY not need to wait until the print job finishes to press RETURN. In most machines, you can hit return after the print job is STARTed (not just put on the queue). You can test this with a small file. 10. Default is -e5, i.e., the width of English char half of that of a Chinese char. But since CNPRINT still adjust the punctuations in this case, the print out may not be the same as you expected. Try -d (see 11) if you need the text to line up. If -e, the PS file conforms to EPSF-3.0 standard and can be included in other document such as Microsoft Word on PC (which I tested, may not work on others). You can NOT preview it properly, but the final print-out is OK(*). Use -we option to generate the PS file and name the PS file as *.eps. Be sure to transfer the PS file as a TEXT file but open it as an "eps" file. Also see (17) for more important infomation about EPS file. * You must select a PostScript printer as the default printer, otherwise it would not work. You can "add" a PS printer even if it is not present. -e can also used to specify the page number to end printing, see (14). 11. In this case, the output would be the SAME as what you see on the screen when you edit the text IF you adjusted the number of characters in a line properly. Also, you should select Courier (the default) for English font if you want the text to line up. CNPRINT would not adjust the punctuation marks in this case. For example, a comma (,) may appear at the left end of a line. Note, some popular Chinese editors treat TABs differently, but I believe the way CNPRINT does is the correct way. Some editors store TAB as spaces, this would cause the text not line-up properly if you change the size of chars. 12. For KSC documents, adjustment of punctuation marks is disabled. If you did not specify the default Big5/JIS/KSC HBF file in "cnprint.cmd", you need to specify font with -f option. If -5 is selected twice (by -55 or -5 -5), some horizontal punctuations would be printed as their vertical counterparts in vertical mode and vice versa. Although CNPRINT can detect Big5 files automatically, it may fail in some extreme cases, so it is best to supply -5 (or define the default encoding to BIG5 in CNPRINT.CMD). Note -e5 (-e55) is NOT interpreted as -e and -5 (-55), use -5e (-55e) in this case. 13. In vertical mode, adjustment of punctuation mark is disabled. If document is GB/Hz/ZW, selected symbol characters are rotated to make them appear better, and some ASCII punctuations would be printed as their Chinese counterparts. For GB/HZ/ZW, if -v is selected twice, some punctuations are replaced with better looking ones (for BIG5, -v is enough). For JIS/KSC, -v is enough, but this function needs improvement. 14. These page numbers are the actual numbers that appear on the print-out, please make sure they do not conflict with the starting page number. -b3e or -b3: page 3 to end -b3e8: page 3 to page 8 -be21: beginning to page 21 -b3e20o: odd-numbered pages between 3 to 20 Note any -e option immeadiately following the -b option is considered to specify end-printing page number. If the -e option is before the -b option or there are other options after -b but before -e, the -e option is considered to be those defined in (10) above. 15. This would disable the PS print command (DOS: port name) in "cnprint.cmd". Another way to enter the PS print command (port name) is to select -w option on command line, then select P and answer YES in the menu. 16. The multi-input function can be used to merge several text files, e.g. cnprint -wn99 file1 file2 file3 -o=file.all 17. Generate/Import EPS file and Page Header. Use -e to generate and @[EP] to import EPS file. For page header, enter the name of EPS file in the menu option. a. For ALL EPS files, either generated by CNPRINT or to be imported to CNPRINT, you NEED to adjust the BoundingBox at line 4 in the EPS file, otherwise it may be placed outside the print/display range by CNPRINT or other programs. In BoundingBox, llx and lly are the x and y coordinates of the lower left corner, urx and ury are the x and y coordinates of the upper right corner (relative to lower left corner of the paper). The unit is point (1 inch = 72 points) and the numbers must be integers. You must actually print the EPS out and measure to get the number if you are not good at guessing. b. To import an EPS file, you also need to leave enough space for the imported image. CNPRINT will use the position of the @[EP] marker as the lower left corner of the imported image. 18. Character/Word Frequency Statistics (UNIX user, please contact author to get this function). To activate, use -ttt or -tttt options (-ttt excludes symbols), then you will be asked to do either character or word statistics. To do word statistics, you need to prepare a GB (or BIG5, JIS, KSC) file, called Keyword File, containing the key words you want to know the frequencies in a document. The following guidelines must be followed in preparing the key word file: a. one word per line; b. each line must be terminated by a hard return (i.e., by pressing "return" or "enter" key); c. ASCII space is ignored but non-ASCII space is considered to be part of the key word. You can use -k=filename option to specify the key word file, or enter the filename when asked. The results can be printed, saved in PS file, or saved in a GB/BIG5 /JIS/KSC file. The output for char frequency looks like: 32. ~{:sDGF1P!<:~}3 83 1.44/39.90% | | | | |__ total percentage adding to the CURRENT ones | | | |_______ actual percentage of THE CURRENT ONE(S) | | |___________ total usages adding to the CURRENT ones | |______________ actual useage of THE CURRENT ONE(S) |_________________________ the number of all previous characters - 1 I expect you give proper credit if you publish your results generated with this function. 19. To get the best print quality: a. Provide your printer resolutin (in dpi) in CNPRINT.CMD; b. use larger size bitmap fonts if possible. c. Select character size according to your printer resolution and font size (bitmap size). It should be multiple of Font_Size * 100 / Printer_resolution for example, if font size is 24x24 and printer is 300dpi, 24*100/300 = 8 (points), then 8 16 24 32 40 ... will give the best results; for 48x48 fonts, 16, 32, ... will do. 20. If the output file (either PS or others) is missing, look for CNPRINT.TMP under your current directory (or C: drive in DOS). 21. CNPRINT can NOT write to standard output, it only accepts standard input, and this does not work on VMS. If -i is selected, the menu and conformations to questions will be skipped and the default values will be used. 22. Menu options. Most of the menu options are straight forward and need no explanation. F: If YES, switch left and right margins and page number positions on odd and even pages. It did no actually produce TWO-SIDED copies, but when later two pages are copied to two sides of the paper, it looks nicer. N: When selected, you have the option to specify page position. 23. Unicode support. Only UTF7 and UTF8 are accepted. The input is then converted to 2-byte format (but with 0x4D-->0x4D4D, 0x00-->0x4D21, other bytes unchanged). Standard 2-byte unicode could NOT be handled by string functions and thus by CNPRINT. VI. FONT FILES Please --FINISH-- reading this part before using CNPRINT. Skip it only if you have used CNPRINT V2.20/V2.21 or later versions. You need at least ONE font to run CNPRINT, and CNPRINT can use almost any HBF font. If you do not have enough space, I suggest you get only one of the following fonts. The font-list below is only for the convenience of new users. For full list please see the README file under /software/fonts directory (or its subdirectories). All HBF files for bitmap font files with different style and size (both GB and Big5, JIS/KSC) are stored under that directory. Please read the README file under that directory before you get any bitmap font file or HBF file, and make sure the HBF file and the bitmap font file(s) match. There are more fonts JIS/KSC fonts stored at crl.nmsu.edu [128.123.1.33] under /CLR/multiling/japanese(korean)/fonts, in BDF format. You can convert these BDF fonts to HBF using the programs in the /software/fonts/utils directory at ftp.ifcss.org. FTP site for fonts & HBF files: ftp.ifcss.org:/pub/software/fonts/(gb)(big5)(misc)(unicode)/hbf (misc: for JIS/KSC) (Bitmap font files) (HBF files) GB: cclib.j24 (Jianti) ccs24.hbf cclib.f24 (Fanti) ccs24f.hbf Big5: kcchin24.f00 (Fanti) etkcm24.hbf (or kcm24.hbf) kcchin24.f15 (Jianti) etkcs24j.hbf(or kcs24j.hbf) JIS: jiskan24.bin jiskan24.hbf KSC: hanglm24.bin hanglm24.hbf unicode: unihan24.bin unihan24.hbf NOTE: a). Get all bitmap font files in BINARY mode, HBF files in ASCII mode. If the fonts have extension .gz, use gunzip to unzip it. The program can be found at pub/software/dos(unix)(vms)/utils directory. b). The bitmap font files, HBF files and the file "cnprint.cmd" (Beginners) should be put under the same directory; (Advanced Users) can be put under any directories you want, but those directories must be specified by HBFPATH (Note: "cnprint.cmd" should also be put under a directory specified by HBFPATH). c). An HBF font consists of one or more existing bitmap files and one HBF file (See article about HBF carried on HXWZ #128, CM9309B). You need to get both the bitmap files and the HBF files in order to use CNPRINT. CNPRINT requires (*) the name of the HBF file to be in the following format: cn&##.hbf (GB) cn5&##.hbf (BIG5) cnj&##.hbf (JIS) cnk&##.hbf (KSC) cnu&##.hbf (unicode) where & can be any letter (a-z, if your system is case-sensitive, use lower case only) and ## be the number reflecting the size of the font, e.g. 24 for 24x24. It is suggested that you make the letters meaning- ful, for example, 'k' for Kaishu, 'f' for Fanti. * However, you can select an HBF file with ANY name on command line: cnprint -f=my_own.hbf filename ... d). After you get the HBF file, you NEED to rename them (or make a link or make a copy with the new name). For example: ccs24.hbf --> cnj24.hbf kcm24.hbf --> cn5m24.hbf jiskan24.hbf --> cnjk24.hbf hang24.hbf --> cnkh24.hbf unihan24.hbf --> cnun24.hbf --------------------------- For some non-square bitmap fonts, like kcchin16.f00, the HBF file is named as kcm14.hbf, it is better to rename it as cnm16.hbf (i.e. use numbers 16, 24, 48, 40, 56, 64). If you name it as cnm14.hbf, you can select it on command line with "-f=m14", but you could not select it with @[f*]. Since CNPRINT gets the size information from the HBF file, it is able to use fonts with any size. For example, if you have a 32x32 font and you name the HBF file as cnx56.hbf, it is still OK. You can also write your own HBF file according to the HBF standard at http://ftp.ifcss.org:8001/www/pub/software/info/HBF-1.1/index.html. Note CNPRINT only uses the simple properties. VII. Known Problems No software is without bugs. As CNPRINT is getting bigger, it contains more bugs. A lot of bugs were created when new functions were added. Your help in identifying those bugs is appreciated. 1. Q: The characters look OK but are meaningless, or they are distorted, shifted up/down, left/right. A1: Check HBF file, make sure it matches the bitmap font file. If you write you own HBF file, make sure the offset information is correct. A2: The bitmap font is distorted in transmission. Try to get it again, using BINARY mode and transmit properly. A3: You are printing a Big5 file with GB fonts. 2. Q: CNPRINT failed to print, but I saw the printer was processing the job. A: This happens on some printers. The cause is unknown. Try -n=# option with smaller number (# <= 1000 or 0, default 2048) and contact author. 3. (DOS) Q: The printer stops printing after one or two pages. Some thing like "printer is not ready, abort, ignore or retry?" is displayed on screen. If 'R' is typed, it would continue to print the next page. A1: Add MODE LPT2: RETRY=B in the autoexec.bat file (if the printer is connected to LPT2). (cf. p529, MS-DOS version 5.0 User's Guide and Ref., Microsoft Co 1991. Courtesy of Chang, KSU211@UKCC.uky.EDU) A2: see 4. 4. Q: CNPRINT only printed the first page. A: It may be due to the way your printer is connected to the computer, or the printer setup. You may get around by using -p1 option, i.e. print one page at a time (it helps if you also use -n=200 with -p1 if the document is large). 5. Q: (VMS and UNIX) CNPRINT stops running after displaying "*** Page 1 has been done ***". A: Change line 26 of cnprint.c from "#define TIME 1" to "#define TIME 0". Or delete the lines containing those unsupported functions. Some machines do not support function "remove()", just delete it. 6. Q: (DOS) When I typed "cnprint ...", the computer hung up. (VMS) When I typed "cnprint ...", strange messages were displayed on the screen. A1: The files may not be successfully unzipped, or you forgot to get the zipped file in BINARY mode. A2: (VMS) Did you follow the steps in IV CAREFULLY ? 7. (DOS) Q: The message "Not enough memory" was displayed at some stage. A: Disconnect network and other things and try CNPRINT again. You may want to generate PS file only (use -w option) if your printer is connected via network. 8. (Big5) Q: Some non-frequently used characters are not printed correctly, but the frequently used chars or symbols are OK. A: It is due to different versions of Big5. Try to match the font and the text, or use a conversion program, such as et2hku. In fact, the so-called HKU-Big5 did not exist at all. It was created by some HKU students and has been recalled. It would be best if you stop using it and convert all your text to standard Big5. 9. I am a user of V2.30/2.31. After I upgraded to V2.60/2.61, I can not print/view the PS files properly. A: From V2.60/2.61 a slightly different PS format was adopted. This change will benefit more users than it will bring trouble to. Use -g option to select the format of V2.30/2.31. 10. Q1: When I print Hz files from ACT (or some GB/JIS/KSC files), the line breaks down at unusual places. Q2: (JIS/KSC/HZ/ZW) The lines are joined together (it seems that return characters were "eaten" by CNPRINT). A1: Some softwares omitted a '~' before the hard return in Hz files, so a soft return becomes a hard return for other softwares. Some GB/JIS/KSC file inserted a hard return at each display line. A partial solution is to use -n# option to set characters per line N (equal or slightly less than the number of chars in a Hz line, default value is determined automatically according to the input). A better solution is to use the repair function (-r#, see on-line help). A2: This is just the opposite of the above. Set a larger N with -n#. 11. Q: The English characters are printed but all CJK characters are missing. A: Your system could not read Hex numbers properly. Get HBFHX2D.c at neurophys.wisc.edu and follow the instructions. 12. Q1: (UNIX) The program says it could not find HBF file but it IS there, and I did everything correctly. Q2: (UNIX) I could not find the PS file with the name displayed on screen, but I found CNPRINT.TMP, which is a PS file. Q3: (UNIX) all other problems. A: Problem 1 and 2 should not exist in V2.60. But if they are there, (Q1) move all files into one directory or (Q2) rename CNPRINT.TMP, and report to author. 13. Q: The program complains it could not find file "cnprint.cmd", but it is there. A: Read section VI(b) and question 12 of this section. 14. Q: (UNIX) The pipeline input did not work properly. A: Near the beginning of the source file, there is a line "#define copystdin 1". Uncomment that line. CNPRINT do not support pipeline output. 15. Q1: When I select 7 columns, the program did not work properly. Q2: When I select very small character size, the program did not work properly. A1: This is 'normal'. The maximum number of columns you can select depends on the character size and paper margins. A2: V2.60/2.61 contains a fix to this problem, but somehow it does not work on some machines. 16. Q: (UNIX) I got a lot of error messages when I compile V2.60, but I had no problem with previous version. A: Some features in V2.60 are not supported by your compiler. The exact "bug" has not determined at the time of this release. You may try the second ftp site for any bug-fix and contact author (I need some good people to test it). VIII. AUTHOR cai@neurophys.wisc.edu Yidao CAI (~{2LR@5@~}) Department of Neurophysiology University of Wisconsin Medical School 1300 University Ave Madison, WI 53706 USA 608-263-5719 608-265-3500 FAX Please send suggestions and report bugs to the above address. Check part VII before you ask any question. The answer to your question might already be there. Please include your e-mail address in the mail body as I sometimes could not reach users with distorted e-mail addresses, and I understand those users need help the most because of their not-so-popular machines. Thank you for using CNPRINT. The author will try his best to offer technical support. However, there is no warranty for CNPRINT. CNPRINT is free for non-commercial and personal use ONLY. However, I would highly appreciate the following as a way to show your support: a). a postcard or e-mail, indicating the machine and system you are running; b). donation in any ammount (suggested $5-$20). Those who are not full time students are especially encouraged to donate. Your contribution will be solely used in an educational fund (in memory of my mother) to help and encourage children from rural areas with their primary and high school education. Thank you for your generous support. For ANY OTHER use, please contact author to get permission. The general rule is that if you use it not for profit, and you are not compensated for the work, your request will be granted free of charge (however, donation to the educational fund is more than welcome). If you use CNPRINT for profit, or you are compensated for the work, a small amount of fee will be charged. In any case, the money collected will go to the educational fund. In addition, if you install CNPRINT for group use (shared by more than one user), you must inform author. IX. Acknowledgement Thanks to numerous users of previous versions for valuble suggestions and encouragements, which make the continuous improvement of CNPRINT possible. In particular, I would like to mention Nelson Chin (butta1 @cs.bu.EDU), for both his suggestions and testing of CNPRINT on his systems, and Yigen Zeng (yigen.zeng@mop.luth.se), his valuble suggestions and testing efforts makes many new functions in this release possible. Some of the initial ideas came from the GB2PS Version 1.00 of Dr. Wei Sun at william@anucsd.anu.edu.au. The sub- routines for conversion of Japanese format texts were modified from jconv.c by Ken Lunde. The subrountines for unicode were modified from the unicode package of Ross Paterson and/or Guo Jin. Appendix A ---------- paper sizes A: 8.5 x 11 inch or 215.90 x 279.40 mm A4: 8.27 x 11.69 210.00 x 297.00 B: 11 x 17 279.40 x 431.80 A3: 11.69 x 16.54 297.00 x 420.00 Appendix B ---------- Dr. F. F. LEE's hz2gb can be found at /pub/software/unix/convert For HBF standard, see /pub/software/fonts/HBF jconv.c is at ftp.ora.com:/pub/examples/nutshell/ujip/src. GB/BIG5/JIS/KSC table files can be found at neurophys.wisc.edu:[public.cn] The HBF API used in CNPRINT can be found at neurophys.wisc.edu:[public.cn] A brief history of CNPRINT can be found at neurophys.wisc.edu:[public.cn], file name "cnprint.his" If you want to know more about the technical aspects of CNPRINT, read file "cnprint.technotes" at neurophys.wisc.edu:[public.cn] Note: "Appendix C" is now a seperate file "cnprint.cmd". It should be kept in the same directory where the fonts are kept.