Problem
I would like to know how to print using the various typefaces available in PCL mode on an HP LaserJet III or IV printer. Sometimes, when I try to select a certain typeface by specifying "lp" command-line options, I get the printout in the default Courier typeface.
Cause
For each typeface available, there is a certain combination
that uniquely specifies it. All of the characteristics of
that typeface must match, or the printout will revert to the
default typeface of Courier. Solution
First, determine which fonts are available on your HP LaserJet
printer. This is done from the printer's control panel:ONLINE -- to take off-line
MENU -- to get to the TEST MENU
ITEM -- to get to PCL TYPE LIST
ENTER -- to get a printout of the typefaces available
ONLINE -- to put back on-lineModify your printer's interface script to include the typeface options. The basic internal fonts on the HP LaserJet printer have been coded and are included at the end of this document. To add these new options to your printer's interface script:
Log in as root and change directory:
$ cd /usr/spool/lp/admins/lp/interfacesMake a backup copy of the current interface script:
$ cp <printername> <printername>.bakUsing your favorite editor, edit the <printername> file and locate the following (around line 592 for the net_lj4x v1.7 script dated 93/01/06):
b | bold)
weight=1;;After these lines, read or type in the code from the
attachment of this document. Note that you can rename
each option to suit your needs, and may add more options
to include typefaces from font cartridges.Save the file and quit out of the editor. You should
be ready to test as:$ lp -d<printername> -o<newoption> <myfile> Please note that the interface model is provided by the
vendor, and you are on your own in any modifications to
the interface model; that is, SCO Support does not
provide assistance in making these modifications.The remainder of this document deals with describing how each available font is made up of a combination of characteristics, and how you can interpret the escape sequences in order to make up your own "higher level" typeface options.
-----------------------------------------------------------------You will notice that each typeface line listed has its own
unique escape sequence that selects that typeface. This
sequence specifies things like character set, pitch, height,
spacing, style, weight and typeface. For each line, you must
match each characteristic in the escape sequence, either
explicitly or by default, or the typeface printed will default
to Courier. For example, the PCL Typeface List shows that the
Coronet typeface has this escape sequence to set: vvvvvvvvvvvvvvvvvvvvvvvv______/ The entire "<esc>(s"
<esc>(_____<esc>(s1p_____v1s0b4116T \ escape sequence
| |
| \_____ Point size
|
\_____ Character setNote that the "<esc>(s" escape sequence sets several things, using the codes "p", "s" and "T". The fact that the "T" is capitalized delimits the end of the "<esc>(s" sequence.
esc sequence lp option meaning
------------ --------- -----------------------
1p -ops proportional spacing
1s -ostyle1 style #1
4116T -otype4116 typeface of CoronetSince the printer interface model defaults to fixed spacing (0p), style #0 (0s) and Courier type (4099T), you must include these options specifically if you wish to print in the Coronet typeface. The lp command is:
lp -ops -ostyle1 -otype4116 <myfile>In another example, the Letter Gothic typeface has fixed spacing and style #0, both the defaults, so you could just specify the type option:
$ lp -otype4102 myfileA possible problem would be if the printer is set to something
other than the default for one of these options. Therefore, it
is always safer to explicitly specify each of the options:$ lp -ofp -ostyle0 -otype4102 <myfile>If you wish to include a new "higher level" typeface option in your printer's interface script to accommodate font cartridges, or downloadable fonts, please use the attachment as a guide as to how to code the specific case statements.
See also
Another article in this database:How to hard code or change options in the HP LaserJet script.
SCO UNIX Operating System, User's Reference: lp(C); SCO UNIX Operating System, System Administrator's Reference: lpadmin(ADM).
ATTACHMENT:
-----------------------------------------------------------------------------Insert the following within the case statement that processes the lp options: # Add these functions into the script.
courier)
spacing=0
style=0
weight=0
typeface=4099
;;cgtimes)
spacing=1
style=0
weight=0
typeface=4101
;;cgtimes-b)
spacing=1
style=0
weight=3
typeface=4101
;;cgtimes-i)
spacing=1
style=italic
weight=0
typeface=4101
;;cgtimes-bi)
spacing=1
style=italic
weight=3
typeface=4101
;;cgomega)
spacing=1
style=0
weight=0
typeface=4113
;;cgomega-b)
spacing=1
style=3
weight=1
typeface=4113
;;cgomega-i)
spacing=1
style=italic
weight=0
typeface=4113
;;cgomega-bi)
spacing=1
style=italic
weight=3
typeface=4113
;;coronet)
spacing=1
style=italic
weight=0
typeface=4116
;;clarendon-c)
spacing=1
style=4
weight=3
typeface=4140
;;univers-m)
spacing=1
style=0
weight=0
typeface=4148
;;univers-b)
spacing=1
style=0
weight=3
typeface=4148
;;univers-mi)
spacing=1
style=italic
weight=0
typeface=4148
;;univers-bi)
spacing=1
style=italic