home *** CD-ROM | disk | FTP | other *** search
- FONT SQUEEZE
-
- by
-
- S. Ostrander
-
-
-
- INTRODUCTION: FS (Font Squeeze) is a program that will compress
- downloadable soft font files for the Hewlett Packard LaserJet III
- printers. FS works best on large non-Italic font files. However it
- will work on any size font file, and FS checks to make sure that the
- compressed characters are not larger than the original. There are two
- advantages to squeezing font files. First, they take less room on your
- hard disk. Second, less time is needed to download them to the printer.
- FS is copyright 1990 by S. Ostrander. FS can be used by anyone but may
- not be sold. If you like FS, please distribute it as far and wide as
- possible. The compr essed font files have been tested on the HP LJ II
- and HP LJ III. They do not work on the II but do work on the III. At
- this time, I don't know if the IIp or IId can handle compressed font
- files. Finally, the user assumes all risks from using this software.
-
- USAGE: FS [/c | /e] [/d] fontname
- /c means to compress fontname
- /e means to expand fontname
- /d means to print debug info while compressing or expanding.
- either /c or /e can be specified but not both. FS defaults to /c.
-
- GENERAL INFORMATION: 1. FS is very picky about what files it will
- process. if you get an unknown command error message, that means that
- the font file probably had some additional printer commands embedded in
- it. (see technical reference). 2. At this time FS can't handle
- continuation blocks. A continuation block is needed whenever a
- character needs more than 32767 bytes to represent it. 3. FS uses a
- temporary file while processing the softfont. When FS is done, it
- deletes the softfont file and rena mes the temporary file so that it has
- the same name as the original softfont file. Therefore if the original
- file is locked, it will not be deleted and FS will complain.
-
- TECHNICAL REFERENCE:
-
- 1. A softfont file contains a series of commands to the LJ III printer.
- These commands include FONT DESCRIPTOR, CHARACTER CODE, DOWNLOAD
- CHARACTER, ASSIGN FONT ID, ...
-
- 2. FS handles only the first three commands and will complain if any
- other commands are present. FONT DESCRIPTOR tells the printer about
- various characteristics of the font. CHARACTER CODE lets the
- printer know what character is going to be processed next. DOWNLOAD
- CHARACTER lets the printer know wether the character is compressed
- or not and how long (in bytes) the character is. The typical format
- of a softfont file is:
-
- FONT DESCRIPTOR
-
- CHARACTER CODE 1
- DOWNLOAD CHARACTER
- character data
- .
- .
- .
- CHARACTER CODE x
- DOWNLOAD CHARACTER
- character data
-
- 3. If any of the character data blocks is longer than 32767 bytes a
- continuation block can be used. However, FS doesn't handle them.
-
-
- 4. Uncompressed characters are a bitmap of the character shape. If the
- character width does not exactly fit into some number of bytes, it is
- padded with extra blanks. For example the ! might be:
-
- ...XXX...
- ...XXX...
- ...XXX...
- ...XXX...
- ...XXX...
- .........
- .........
- ...XXX...
- ...XXX...
- char wdth
- byte boundary^
-
- where . is a white space and X is a dot. It takes up 18 bytes. Two
- bytes per row.
-
- 5. Compressed characters are of the form:
- repeat cnt, #white, #black, #white, ...
- .
- .
- .
- where repeat cnt is one less than the number of times to repeat.
- The above ! when compressed would be 4 3 3 3
- 0 9
- 1 3 3 3
- it takes 10 bytes.
-