Go to the previous, next chapter.
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.
A font descriptor begins with a font descriptor command and is followed immediately by the data for the descriptor. Font descriptors define data global to the font. In general, more recent printers are less strict about these parameters than older printers.
``ESC ) s # W''
In this command, # is the number of bytes in the descriptor. The first element of the descriptor indicates how many of these bytes should be interpreted as the font descriptor (the remaining bytes are commentary only--to the printer, at least). This area is frequently used for copyright information, for example, although some systems insert kerning data into this area.
UI Font descriptor size UB Descriptor format UB Font type UI Reserved (should be 0) UI Baseline distance UI Cell width UI Cell height UB Orientation B Spacing UI Symbol set UI Pitch UI Height UI xHeight SB Width Type UB Style SB Stroke Weight UB Typeface LSB UB Typeface MSB UB Serif Style SB Underline distance UB Underline height UI Text Height UI Text Width UB Pitch Extended UB Height Extended UI Cap Height UI Reserved (0) UI Reserved (0) A16 Font name ?? Copyright, or any other information
UI = unsigned integer, SI = signed integer, UB = unsigned byte, SB = signed byte, B = boolean, and A16 =sixteen bytes of ASCII. After the font name, ?? bytes of extra data may be inserted. These bytes pad the descriptor out to the length specified in the begin font descriptor command.
Note: integers are always in big-endian order (MSB first).
A character descriptor describes the character specific info and the layout of the bitmap. Newer printers can accept compressed character bitmaps.
``ESC * c # E'' The # is the length of the descriptor, in bytes.
UB Format B Continuation UB Descriptor size UB Class UB Orientation SI Left offset SI Top offset UI Character width UI Character height SI Delta X ?? Character (bitmap) data.
Although older printers cannot accept characters that include continuations, newer printers can. If the ``continuation'' field is 1, the character bitmap data begins immediately after that byte and the remaining fields _are not_ present.