Go to the previous, next chapter.

TrueType to HP LaserJet bitmap softfonts (HACK!)

If you have the tools, the following suggestion does work, but it isn't easy and it hasn't been automated. To be honest, I haven't really tested it.

If you are using Windows 3.1, get a LaserJet printer driver (you don't need the printer, just the driver). Using the LaserJet driver, direct output to a file and print a simple file containing all the letters you want in the softfont in the font that you are converting. When the print job has completed, the output file will contain, among other things, a LaserJet softfont of the TrueType font you selected. If you know the LaserJet format, you can grab it out of there.

I didn't say it was easy ;-)

This method will not work with ATM [ed: as of 7/92] because ATM does not construct a softfont; it downloads the whole page as graphics.

Here is an overview of the LaserJet bitmap softfont format. It should help you get started. If you have any questions, ask norm. If anyone wants to write better instructions... ;-)

Many details are omitted from this description. They are thoroughly discussed in the HP Technical Reference for each model of laser printer. I recommend purchasing the Tech Ref. If you have additional questions and do not plan to purchase the Tech Ref (or do not wish to wait for its arrival), you can ask norm.

An HP LaserJet softfont can occur almost anywhere in the output stream destined for the printer. In particular, it does _not_ have to be wholly contiguous within the output file. In fact, fonts can be ``intermixed" at will. The following "pieces'' make up a font:

A begin font descriptor command (followed by the descriptor) and a series of begin character descriptor commands (followed by their associated data). When a new character descriptor is encountered, it is added to the current font (which may change between descriptors).

In the discussion that follows, the following notational conventions are followed:

Key elements are surrounded by quotation marks. The quotation marks are not part of the element. Spaces within the element are for clarity only, they are not part of the element. All characters (except ESC and #, described below, are literal and must be entered in the precise case shown).

ESC means the escape character, ASCII character number 27 decimal.

# means any decimal number. The meaning of the number is described in the commentary for that element.

Please report your experiences using this method to norm (both to satisfy his own curiosity and to help improve the FAQ).


Excerpted from The comp.fonts FAQ, Copyright © 1992-96 by Norman Walsh