CONTENTS

This package contains some utilities related to HZ, a data format for
exchanging files of arbitrarily mixed Chinese and ASCII characters.

directory hanzi:
ReadMe:   the file you are reading

directory hanzi/doc:
HZ.spec:  the technical specification of HZ (version 1989.09.04)

directory hanzi/src:
hz2ps.c:  the PostScript driver which inputs HZ files
hzfont.c: the Chinese bitmap font loader and server
hzview.c: the HZ tty previewer
hz2sgb.c: the HZ to MAC/DOS SGB code decoder
sgb2hz.c: the MAC/DOS SGB code to HZ encoder
zw2hz.c:  the zW format to HZ translator
Makefile: the usual Makefile

*SGB stands for Shifted GuoBiao. Macintosh and CCDOS have their own SGB
codes for mixed Chinese (GB) and ASCII characters.

directory hanzi/lib:
It contains various sample spec files for hz2ps and hzview.
The default spec file for hz2ps is hz2ps.spec.
The default spec file for hzview is hzview.spec.
The file hz2ps.prep is the Postscript header file for hz2ps.

directory hanzi/font:
It contains the Chinese bitmap font files.
Only hzfont.c needs to understand the bitmap format.
Currently, the actual Taipei (FanTiZi) bitmaps are missing due to
copyright reasons.  


directory hanzi/sample:
It contains some sample HZ files.

directory hanzi/bin:
This is a good place to put your executable code compiled from the
source files in hanzi/src.


INSTALLATION

1. cd hanzi/src.
2. setenv HZDIR path-name-of-the-hanzi-directory
3.
   If you are a Macintosh user:
	make mac
   If you are a CCDOS user:
	make dos
   If you want everything:
	make all


USAGE

Since these converters run on UNIX, we assume that the Macintosh/CCDOS
SGB files (*.mac/*.hz) are to be uploaded before encoding, and to be
downloaded after decoding. The convention .mac used here refers to the
.data fork of a Macintosh file, which contains the pure text (SGB and
ASCII codes).

Ideally, the encoders and decoders should be ported to Macintosh/CCDOS,
and only (7-bit) .hz files are used for uploading/downloading in
addition to file transfer. 

hz2ps:
	hz2ps foo.hz | lpr
OR	hz2ps -s myspec.s foo.hz | lpr

hzview:
	hzview foo.hz
OR	hzview -s myspec.v foo.hz

(Note that .s and .v are just convenient but not mandatory conventions.)

hz2mac: recommended option:
	hz2mac -n < foo.hz > foo.mac
(-n turns UNIX's LF to MAC's CR)

mac2hz: recommended option:
	mac2hz -n -t < foo.mac > foo.hz
(-n turns MAC's CR to UNIX's LF; -t selects "terminal" style of HZ.)

hz2dos: recommended option:
	hz2dos < foo.hz > foo.dos

dos2hz: recommended option:
	dos2hz -t < foo.dos > foo.hz
(-t selects "terminal" style of HZ.)

zw2hz:  recommended option:
	zw2hz -c -a < foo.zw > foo.hz
(-c includes "comment" lines not beginning in 'zW'; -a selects single
byte ASCII instead of double byte "GB-ASCII".
If you want a more compact hz file, do
	zw2hz -c -a < foo.zw | hz2dos | dos2hz > foo.hz
OR	zw2hz -c -a < foo.zw | hz2mac | mac2hz > foo.hz 
**Unless you have zW files, don't worry about 'zw2hz'.
)


BUG REPORT

Bug reports are to be sent to Fung F. Lee at lee@umunhum.stanford.edu.

