Fun with fonts. (Column)
by Mark Minasi
Last time, we got started with the basics of using the Hewlett-Packard Printer Control Language (HPPCL.) We created a couple of useful batch files to force the printer to do a page eject and to reset the printer.
This month, we'll see how to shift the printer from the usual 12-point Courier to the smaller Linprinter typeface, allowing us to print wide spreadsheets or files.
To do that, we'll have to understand how to choose laser fonts--that's our goal for this month. First, we'll get some terminology out of the way, take a look at the relevant PCL commands, and then build a batch file.
Courier Isn't a Font
My friend Jane Mitchell, the Laser Jet expert, says "You can always tell a Laser Jet novice. She calls Courier a font." Courier isn't a font. (Jane is a printer snob.) It's a typeface, at least in HP terminology. Suppose you've printed a document using the Courier, err, typeface--that's all just one font, right? Wrong. You change the font if you use boldface, italics, different sizes, or go to landscape mode, to name just a few possibilities.
Fonts are described by eight attributes: orientation (portrait or landscape), symbol set (don't worry about this one just yet), spacing (fixed or proportional), pitch (width or characters), points (height of characters,) style (upright vs italic), stroke weight (light, normal, boldface), and typeface (Courier, Times Roman, and so on).
Orientation just refers to whether the text prints across the width of the
page (as with the text that you're reading now), called portrait mode, or up
the length of the page, called landscape mode. Orientation is selected with
the Symbol set dictates how particular computer (ASCII) codes relate to particular
letters. For example, the ASCII code for A is 65. But what if the printe
were to print Greek or Japanese? Then being able to print an A would be of no
value, so 65 would correspond to some other character. That's what symbol
sets describe. In most cases, you'll choose the IBM-US symbol set, also known
as PC-8. This symbol set includes the IBM box-drawing characters.
A symbol set is selected in software with the sequence Spacing allows you to specify either fixed spacing, as in a typewriter's
printing, or proportional spacing, as in this text where smaller characters
take up less space than larger characters. In fixed spacing, all characters
take up the same amount of space, which must be the amount required by the
largest character in the character set. The escape sequence is Pitch is the width of a character. Note that pitch is only used for
fixed-spaced fonts--you'd never specify pitch when selecting a proportionally
spaced font. Pitch is measured in characters per inch. Courier typefaces are
typically 10 or 12 pitch, line printer faces usually have a pitch of 15 or
16.6. Pitch is selected with the Height is sometimes called the font's points because height is measured in
points. A point is 1/72 of an inch. Height is reported in the font printout
as point size. It's selected with the Style indicates whether the font is upright or italic. Stroke Weight specifies whether to select a font that is lightly drawn,
normal, or boldface. Activated with the So the laser has a choice--it can match orientation and miss typeface (that's
the portrait Lineprinter), or it can match typeface and miss orientation
(tha's the landscape Courier). As orientation is more important, it'll give
you the portrait Lineprinter.
IID and Later Printers
The series IID and later printers have an extra feature that the series II
doesn't--they can rotate fonts. You needn't worry about whether a font is
landscape or portrait. Just specify whether you want portrait or landscape.
You need to understand the difference. The series II uses orientation as a
means to narrow down which printer font to use. The IIP and IID use this
information as a command about whether or not to rotate an already selected
font. That means that IID and IIP font-selection strings look like the II
commands with one difference--the orientation part goes at the end of the
string.
That means that the previous font selection example would look like the
following on the IID or IIP: Let's finish off with what we came here to do in the first place: set up the
laser to print Lineprinter. The Lineprinter font has the following
characteristics: portrait orientation, symbol set PC-8, fixed spacing, pitch
of 16.67 characters per inch, height of 8.5 points, upright, normal weight,
and Lineprinter typeface. That adds up to a command string of
Whew! I keep that in a file I call SMALLPRT.TXT, and I have an accompaying
SMALLPRT.BAT that shoots it out to the printer.