Barcode InfoPCL FontsHome


Rotating PCL Fonts
Home > Barcode Basics >
Application Notes > AppNote031

Most PCL fonts are created with portrait orientation (0 degrees rotation).
It is possible to create fonts with rotated characters:  landscape (90
degrees counterclockwise), reverse portrait (180 degrees counterclockwise),
or reverse landscape (270 degrees counterclockwise).  However, since release
of the HP LaserJet Plus and LaserJet II series printers Hewlett-Packard
recommends that all PCL soft fonts be created in portrait mode and that
rotation be done at print time using the Print Direction Command.

Using the Print Direction Command is STRONGLY recommended when printing
barcodes, as it eliminates a number of tricky character spacing issues
associated with non-portrait fonts.

The Print Direction Command rotates the logical page.  It does not cause a
page eject, so you can change the print direction any number of times within
a page. Here is the general approach:

    Print this text normally
    <command to reposition the cursor>
    <command to rotate the print direction to landscape>
    This text is printed sideways
    <command to reposition the cursor>
    <command to rotate the print direction to portrait>
    This text is printed normally

Here is the escape sequence to change the print direction:


Replace the # character with the number of degrees to rotate
counterclockwise.  The choices are 0, 90, 180, or 270.  For example, to
switch to landscape printing:


Note that if you use this command when the print cursor is at the top left
corner of the page your printing will disappear.  The center point of
rotation (cursor position) is the bottom left corner of the next printed
character.  When you rotate counterclockwise, the text will print upward
from the top left corner of the page... it will be outside the printable
area.  We can use the cursor positioning commands to move to a specific
position on the page.

    <esc>&a#H    (horizontal position)
    <esc>&a#V    (vertical position)

Replace the # character with the desired position in decipoints (1/720ths of
an inch).  If you want to move the cursor a relative distance from its
current position, put a plus or minus sign in front of the position.  If you
leave off the plus or minus, position will be measured from the top left
corner of the page.  For example, to move the cursor 2 inches right of the
left margin and 3 inches down from the top margin:


To move the cursor 1 inch left and 0.5 inch down from its current position:


Let's go back to the outline at the beginning of this article and fill in
some details.  We'll print "Print this text normally" at the top left corner
of the page; move to a point 4 inches from the left and 8 inches from the
top of the page and print "This text is printed sideways" vertically; move
to the bottom of the page (left margin, 10 inches down) and print "This text
is printed normally" in normal rotation:

    Print this text normally            (print text)
    <esc>&a2880H                        (move horizontally)
    <esc>&a5760V                        (move vertically)
    <esc>&a90P                          (rotate 90 degrees)
    This text is printed sideways       (print text)
    <esc>&a0H                           (move to left margin)
    <esc>&a7200V                        (move to 10 inches down)
    <esc>&a0P                           (rotate to 0 degrees)
    This text is printed normally       (print text)

Rober H. Lounsbury
April 2006


(c) Copyright Measurement Equipment Corporation
All Rights Reserved