PCL 5 Printer LanguageTechnical Reference Manual HP Part No.
Notice HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance, or use of this material. This document contains proprietary information which is protected by copyright. All rights are reserved.
Printing History This manual was created using HP Tag/Vectra software on an HP Vectra Personal Computer. The body text is printed in Helvetica fonts. The camera-ready copy was printed on an HP LaserJet IIISi printer with Resolution Enhancement technology (REt) and was then reproduced using standard offset printing. First Edition – October 1992 NOTICE This document is the current edition of the technical reference manual for PCL 5 and earlier printers.
Trademark Credits Intellifont and Garth Graphic are U.S. registered trademarks of Agfa Division, Miles Inc. CG Triumvirate and Shannon are trademarks of Agfa Division, Miles Inc. CG Bodoni, CG Century Schoolbook, CG Goudy Old Style, CG Melliza, Microstyle, CG Omega, CG Palacio, CG Times and CG Trump Mediaeval are products of Agfa Division, Miles Inc. CG Times, a product of Agfa Division, Miles Inc., is based on Times New Roman, a U.S. registered trademark of Monotype Corporation plc. PCL, and Vectra are U.
Inside This Manual What You Can Learn From This Manual Hewlett-Packard has developed a standard set of printer features for use in all HP printers. Printer features are accessed through the corresponding commands of Hewlett-Packard’s PCL language. This manual describes the PCL 5 printer language. This includes descriptions of the commands available for Hewlett-Packard PCL 5 LaserJet printers and the basic requirements of PCL language programming.
Note Since actual implementation of printer commands within software applications varies from package to package, specific examples are not given. For examples of printer command usage with many popular software packages, refer to HP’s Software Application Notes, provided with the printer. The most current versions of software application notes can be obtained through the HP Forum on CompuServe, by fax using the HP FIRST fax service, or through HP’s literature distribution.
Chapter 5 - Page Control Commands This chapter describes the commands providing page format control. Page format control allows you to select the page source, size, orientation, margins, and text spacing. Chapter 6 - Cursor Positioning This chapter describes how to position the cursor within the logical page. Chapter 7 - Fonts This chapter describes basic font information including font characteristics.
Chapter 13 - The PCL Print Model This chapter describes the PCL print model which allows for special effects when printing. Chapter 14 - PCL Rectangular Area Fill Graphics This chapter describes how to define and fill a rectangular area with one of the predefined PCL patterns, or with a user-defined pattern. Chapter 15 - Raster Graphics This chapter describes how to download raster graphics to the printer, and includes various techniques for reducing the amount of data needed to define the raster image.
Chapter 19 - The Configuration and Status Group This chapter describes the commands used to set default conditions and values for programmable HP-GL/2 features. It also explains the commands used for scaling, establishing a soft-clip window, and rotating the HP-GL/2 coordinate system. Chapter 20 - The Vector Group This chapter provides information about pen movement and drawing lines, arcs, and circles. It also covers a way to encode coordinates for increased print speed.
Related Documentation The following related manuals provide further information about HP LaserJet printers, including their features and functions. PCL 5 Comparison Guide This document contains supplemental information for programming PCL 5 LaserJet printers. It identifies how different HP PCL 5 LaserJet printers implement the commands described in the HP PCL 5 Printer Language Technical Reference Manual.
Contents Notice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii Printing History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Trademark Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .iv Inside This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Print Environment Factory Default Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . User Default Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modified Print Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Resetting the Print Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Printer Reset. . . . . . . . . . . . . . . . . . . . . . . . . . .
Cursor Positioning Absolute vs. Relative Cursor Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 Cursor Positioning Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 PCL Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 Decipoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 Columns & Rows . . . . . . . . . . . . . . . . . . . . . . . . . .
PCL Font Selection Primary and Secondary Fonts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5 Font Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5 Symbol Set Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7 7-bit ISO Symbol Sets . . . . . . . . . . . .
User-Defined Symbol Sets Symbol Set ID Code Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2 Define Symbol Set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4 Header Size (UI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5 Encoded Symbol Set Designator (UI) . . . . . . . . . . . . . . . . . . . . . . . . . 10-6 Format (UB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Underline Position (Distance) (SB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Underline Thickness (UB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Text Height (UI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Text Width (UI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . First Code (UI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Macro Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-7 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-8 Macro Control Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-9 The PCL Print Model Command Sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-5 Source Transparency Mode Command. . . . .
Raster Graphics Presentation Mode Command . . . . . . . . . . . . . . . . . . . . . . . 15-8 Raster Height Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-11 Raster Width Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-13 Start Raster Graphics Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-14 Raster Y Offset Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
An Introduction to HP-GL/2 Vector Graphics Learning HP-GL/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-2 HP-GL/2 Commands and Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-3 Understanding HP-GL/2 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-6 Notations Used to Express Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17-8 Omitting Optional Parameters. . . . . . . . . . . . . . . . .
The Configuration and Status Group Establishing Default Conditions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-3 The Scaling Points P1 and P2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-4 Using the Scale Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-4 Using Scaling Effectively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-8 Enlarging or Reducing a Picture . . . . .
The Polygon Group Using the Polygon Buffer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-2 Drawing Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-3 Drawing Wedges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-6 Drawing Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-10 Drawing Subpolygons . . . . . . . . . . . .
The Character Group Printing Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-3 Moving to the Carriage Return Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-5 Control Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-6 Default Label Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-7 Enhancing Labels . . . . . . . . . . . . . . . . . . . .
SR, Relative Character Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example:Using the SR Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SS, Select Standard Font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TD, Transparent Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23-81 23-83 23-85 23-86 Programming Hints PCL Command Parsing. . . . . . . . . . . . . . . . . . . . . . . . . .
Contents-14 EN
1 Introduction to HP PCL PCL PRINTER LANGUAGE HISTORY Hewlett-Packard created the PCL printer language (simply referred to as “PCL” elsewhere in this manual) to provide an economical and efficient way for application programs to control a range of printer features across a number of printing devices. HP has evolved both the definition and implementations of PCL to provide the optimal price and performance balance. PCL 5 represents a new breakthrough in price/performance leadership.
PCL Printer Language Architecture PCL printer language structure has been useful to guide language functionality growth and command syntax definition. The PCL printer language has evolved through five major levels of functionality driven by the combination of printer technology developments, changing user needs, and application software improvements.
What are Printer Commands? PCL printer commands provide access to printer features. There are four general types of HP printer language commands: z control codes z PCL commands z HP-GL/2 commands z PJL commands Control Codes A control code is a character that initiates a printer function, for example Carriage Return (CR), Line Feed (LF), Form Feed (FF), etc. PCL Commands PCL commands provide access to the printer’s PCL control structure.
HP-GL/2 Commands HP-GL/2, vector graphic commands are two letter mnemonic codes designed to remind you of the function name (such as IN for Initialize). Following the two letter mnemonic may be one or more parameters, which identify details of how to process the command. For additional information on HP-GL/2 commands, refer to Chapters 17 through 23. PJL Commands PJL (Printer Job Language) commands provide a different type of printer control.
Syntax of Escape Sequences There are two forms of PCL escape sequences: two-character escape sequences and parameterized escape sequences. Two-Character Escape Sequences Two-character escape sequences have the following form: ?X where “X” is a character that defines the operation to be performed. “X” may be any character from the ASCII table within the range 48-126 decimal (“0” through “~” - see Appendix A).
Parameterized Escape Sequences Parameterized escape sequences have the following form: ? X y z1 # z2 # z3 ... # Zn[data] where y, #, zi (z1, z2, z3...) and [data] may be optional, depending on the command. X Parameterized Character - A character from the ASCII table within the range 33-47 decimal (“!” through “/”) indicating that the escape sequence is parameterized.
The following is an example of an escape sequence with a termination character and no parameter character. This escape sequence performs a single function. Notes Some escape sequences shown in this manual contain spaces between characters for clarity. Do not include these spaces when using escape sequences. Also, in the escape sequence a script “l” is used to indicate a lower case “l” for clarity. The following is an example of an escape sequence with a parameter character and a termination character.
Use these three rules to combine and shorten printer commands: 1 The first two characters after “?” (the parameterized and group character) must be the same in all of the commands to be combined. In the example above, these are “&” and “l”. 2 All alphabetic characters within the combined printer command are lower-case, except the final letter which is always upper-case. In the combined example above, “O” becomes “o”.
2 The Page Introduction This chapter describes the PCL coordinate system. It defines the logical page and the printable area; it introduces the HP-GL/2 (vector graphics) picture frame, and identifies the boundaries of each.
Logical Page The PCL logical page (also referred to as the PCL addressable area) defines the area in which the PCL cursor can be positioned. Although the printer does not actually have a cursor (like the blinking underline character used on most computer terminals), the cursor position refers to the Currently Active Position of the cursor (also referred to as the CAP). The location of the “cursor” is the position on the logical page where the next character will be positioned.
Printed Dots The high quality output achieved by HP LaserJet printers is due in part to the ability to lay down a fine grid of “dots” on the page. The density of this grid is referred to as the printer’s resolution. From the first HP LaserJet (the “LaserJet Classic”) until recently, all HP LaserJet family printers printed at a resolution of 300 dots-per-inch.
PCL Coordinate System The PCL coordinate system is defined as shown in Figure 2-2. Figure 2-2 X,Y PCL Coordinates The point (0,0) is at the intersection of the left edge of the logical page and the current top margin position. Note 2-4 The Page Since the point (0,0) is always at the intersection of the left edge of the logical page and the current top margin position, it moves if the top margin is changed, and rotates around the page if the orientation is changed.
Units of the PCL Coordinate System The units of the X-axis of the PCL coordinate system may be PCL Units, decipoints, or columns. The units of the Y-axis may be PCL Units, decipoints, or rows. PCL Units These are user-definable units of measure which are used in PCL commands affecting various PCL cursor moves. The number of units-per-inch used in PCL cursor moves is determined by the current setting of the Unit of Measure command (see “Unit of Measure Command” in Chapter 4).
HP-GL/2 Picture Frame In addition to text and raster graphics, HP-GL/2 vector graphics can be placed on the PCL logical page. HP-GL/2 vector graphics are incorporated using the concept of the HP-GL/2 picture frame (see Figure 2-3). Within this picture frame, HP-GL/2 uses its own coordinate system and units of measure. The HP-GL/2 coordinate system and units are described in detail in Chapter 17, An Introduction to HP-GL/2 Vector Graphics, and Chapter 18, The Picture Frame.
Printable Area The printable area is the area of the physical page in which the printer is able to place a dot. The physical page refers to the size of the media (letter, legal, etc.) installed in the printer. The relationship between physical page, logical page, default picture frame, and printable area is defined in Table 2-1 and Table 2-2.
Table 2-2 Landscape Logical Page & Printable Area Boundaries DIMENSIONS (at 300 DPI - double for 600 DPI) PAPER SIZE A B C D E F G H LETTER 3300 2550 3180 2550 60 0 50 150 Legal List 1 4200 2550 4080 2550 60 0 50 150 LEDGER 5100 3300 4980 3300 60 0 50 150 EXECUTIVE 3150 2175 3030 2175 60 0 50 150 A4 3507 2480 3389 2480 59 0 50 150 A3 4960 3507 4842 3507 59 0 50 150 COM-10 2850 1237 2730 1237 60 0 50 150 MONARCH 2250 1162 2130 1162
The HP LaserJet printers perform pixel-level clipping. When printing characters or graphics, if any portion of the character cell or graphic is outside the printable area, only that portion outside the printable area is clipped (see Figure 2-4). Figure 2-4 Printable Area Character Cell Positioning Notes Pixel level clipping can also occur at the logical page for PCL when the page is positioned using the Left Registration command. Pixel level clipping also occurs at the picture frame for HP-GL/2.
2-10 The Page EN
3 The Print Environment Introduction The group of all of the printer’s current feature settings, collectively, is referred to as the print environment. The printer maintains four print environments: the Factory Default Environment, the User Default Environment, the Modified Print Environment and the Overlay Environment. This chapter describes the Factory Default Environment, the User Default Environment, and the Modified Print Environment (the Overlay Environment is described in Chapter 12, Macros).
Factory Default Environment A factory default is a feature setting programmed into the printer at the factory. The group of all of the printer’s feature settings set to their factory settings is referred to as the Factory Default Environment. These features are described in this manual. Since the HP-GL/2 features are used for HP-GL/2 operation only, the print environment features are separated, for convenience, into two lists or contexts: PCL and HP-GL/2.
Table 3-1 Factory Default Print Environment Features – PCL Context (continued) PAGE CONTROL FONT MANAGEMENT Print Direction Font ID Orientation2 Character Code Page Size2 Symbol Set ID Paper Source RASTER GRAPHICS Vertical Motion Index2 Horizontal Motion Index2 Left Graphics Margin Resolution Top Margin Compression Mode Text Length Raster Height Left Margin Raster Width Right Margin Raster Graphics Presentation Mode Perforation Skip PICTURE FRAME Line Termination Picture Frame Wid
Table 3-1 Factory Default Print Environment Features – PCL Context (continued) RECTANGULAR AREA FILL TROUBLESHOOTING Horizontal Rectangle Size End-of-Line Wrap Vertical Rectangle Size Display Functions Pattern (Area Fill) ID STATUS READBACK Current Location Type Current Location Unit 1. The font characteristics are determined by the default font.
Table 3-2 Factory Default Print Environment Features – HP-GL/2 Context CHARACTER GROUP POLYGON GROUP Symbol Set Polygon Buffer Font Spacing Polygon Mode Pitch LINE AND FILL ATTRIBUTE GROUP Height Line Type Posture Line Type Repeat Length Stroke Weight Line Cap Typeface Line Join Character Direction Miter Limit Character Direction Mode Pen Turret Character Size Mode Pen Width Character Width Pen Width Selection Mode Character Height Selected Pen Character Slant Symbol Mode Extra
User Default Environment There are several PCL features in the printer for which user defaults may be selected from the printer’s control panel. User default settings are stored in the User Default Environment and are retained even if the printer is turned OFF. Some of these features are listed below (for a complete set of the control panel user default features refer to Chapter 3 of the PCL 5 Comparison Guide.
Modified Print Environment The current printer feature settings constitute the Modified Print Environment. Whenever a feature setting is altered using escape sequences, the new setting is recorded in the Modified Print Environment. The Modified Print Environment is saved during a macro call or overlay and restored upon its completion. A Modified Print Environment consists of the current settings for the items listed in Table 3-1 and Table 3-2, with the exception of the items listed in Table 3-3, below.
Resetting the Print Environment Resets are used to return the printer to a known environment. Depending on the type of reset performed, the printer returns to either the User Default Environment or the Factory Default Environment. Printer Reset A Printer Reset restores the User Default Environment and deletes temporary fonts, macros, user-defined symbol sets, and patterns. A Printer Reset is performed by sending the ECE command, or through the printer’s control panel (see the printer User’s Manual).
Cold Reset A Cold Reset restores the Factory Default Environment which includes resetting the control panel items to their factory default settings. A Cold Reset is performed by power cycling the printer while holding [ON LINE] until a 08 COLD RESET is displayed.
3-10 The Print Environment EN
4 PCL Job Control Commands Introduction A job typically consists of three parts: z Commands providing job control. z Commands providing page control. z Print data. Table 4-1 Structure of a Typical Job ?%–12345X UEL Command (exit language) ?E Printer Reset Command. Preamble Job Control Commands. Page 1 Page Control Commands. Data Page Control Commands.1 Page 2 Data. • • • Page n • • • Page Control Commands. Data. ?E Printer Reset Command. ?%–12345X UEL Command (exit language). 1.
This chapter describes the commands providing job control. Job control commands are usually grouped together and sent at the beginning of a job. Page control commands and data are associated with each printed page of a job. Job control commands include the following: z Printer Reset. z Universal End of Language/Start of PJL. z Number of Copies. z Simplex/Duplex Print. z Left and Top Offset Registration. z Duplex Page Side Selection. z Job Separation. z Output Bin Selection.
Universal Exit Language Command The Universal Exit Language (UEL) command causes the PCL printer language to shut down and exit. Control is then returned to the Printer Job Language (PJL). Both PCL 5 and HP-GL/2 recognize this command. ?%–12345X Default = N/A Range = –12345 This command performs the following actions: Notes z Prints all data received before the Exit Language command. z Performs a printer reset (same effect as ? E). z Shuts down the PCL 5 printer language processor.
Number of Copies Command The Number of Copies command designates the number of printed copies of each page. ?&l#X # = Number of copies (1 to 32767 maximum) Default = 1 (Configurable from control panel) Range = 1-32767 (Values 32767 execute as 32767 values 1 are ignored. Maximum number of copies=99 for LaserJet II, IIP, III, IIID, IIIP and earlier LaserJet printers.) This command can be received anywhere within a page and affects the current page as well as subsequent pages.
Simplex/Duplex Print Command This command designates either simplex or duplex printing mode for duplex printers. Simplex mode prints an image on only one side of a sheet (page). Duplex mode prints images on both sides of a sheet. ?&l#S # = 0 - Simplex 1 - Duplex, Long-Edge Binding 2 - Duplex, Short-Edge Binding Default = 0 Range = 0-2 (Other values ignored) Long-Edge bound duplexed pages are bound along the length of the physical page (see Figure 4-2).
Figure 4-2 Long-Edge Binding Mode Figure 4-3 Short-Edge Binding Mode 4-6 PCL Job Control Commands EN
Left Offset Registration Command The Left (long-edge) Offset Registration command designates the position of the logical page across the width (short side) of the physical page. This command can be used to adjust the text position on the page to allow additional room for the page binding. ?&l#U # = The number of decipoints (1/720 inch) Default = 0 Range = –32767 to 32767 The value (#) is a signed number valid to 2 decimal places. The units are decipoints.
Top Offset Registration Command The Top (short-edge) Offset Registration command designates the position of the logical page along the length (long side) of the physical page. ?&l#Z # = The number of decipoints (1/720 inch) Default = 0 Range = –32767 to 32767 The value (#) is a signed number valid to 2 decimal places. The units are decipoints.
Figure 4-4 Short-Edge Binding Mode Offsets Figure 4-5 Long-Edge Binding Mode Offsets EN Top Offset Registration Command 4-9
Duplex Page Side Selection Command The Duplex Page Side Selection command causes a Form Feed and designates which side of the sheet to print. The ability to skip a page while duplexing may be required at certain locations in a document. For example, a chapter typically begins on the front side of a page.
Job Separation Command Job separation provides a means of identifying one print job from others in the printer’s output tray. It usually does this by physically offsetting one print job from the next. The Job Separation command toggles the printer’s separation mechanism. This command must be sent between each job to enable the separation mechanism. ?&l1T HP recommends that the Job Separation command be included at the end of each job, just before the Printer Reset command.
Output Bin Selection Command The Output Bin Selection command selects either of the two output paper bins (upper or lower [rear]) for paper output. ?&l#G # Note = 1 - Upper Output Bin 2 - Lower (Rear) Output Bin Default = Upper Output Bin Range = 1, 2 If this command is received by a printer which does not contain the dual output bin feature, it is ignored.
Unit of Measure Command The Unit of Measure command establishes the unit of measure for PCL Unit cursor movements. ?&u#D # =Number of units-per-inch Default = 300 Range = 96, 100, 120, 144, 150, 160, 180, 200, 225, 240, 288, 300, 360, 400, 450, 480, 600, 720, 800, 900, 1200, 1440, 1800, 2400, 3600, 7200. The value field defines the number of units-per-inch used in the following commands: z Vertical Cursor Position (PCL Units). z Horizontal Cursor Position (PCL Units).
The current unit of measure setting affects all PCL Unit moves, horizontal and vertical rectangle size, bitmap and scalable font metrics (how the cursor moves after printing a character). The Unit of Measure command does not affect the interpretation of binary raster data (bitmap fonts, raster graphics or patterns). Once the units of measure is changed, it stays in effect until another is selected or the printer is reset.
Figure 4-6 Cursor Moves at Different Unit of Measure Settings The printer’s physical dot size has no direct bearing on the size of PCL Units used in cursor movements. In addition, PCL Units are not affected by the current control panel or PJL resolution setting. Note EN If no other unit of measure value has been specified, then the default is one Unit equals 1/300 inch. In this case, a cursor movement of 450 Units moves the cursor 1.5 inches, whether printed at 300 or 600 dpi print resolution.
4-16 PCL Job Control Commands EN
5 Page Control Commands Introduction Page control commands and data are associated with each printed page of a job. These commands determine such features as page source, size, orientation, margins, and text spacing. This chapter describes the commands providing page format control. Note EN If a number of consecutive pages within a job have the same format, the associated page control commands should be sent only once for that group of pages.
Page Size Command The Page Size command designates the size of the paper which in turn defines the size of the logical page. ?&l#A PAPER: # = 1 - Executive (7¼ x 10½ in.) 2 - Letter (8½ x 11 in.) 3 - Legal (8½ x 14 in.) 6 - Ledger (11 x 17 in.) 26 - A4 (210mm x 297mm) 27 - A3 (297mm x 420mm) ENVELOPES: # Note = 80 - Monarch (Letter - 3 7/8 x 7½ in.) 81 - Com-10 (Business - 4 1/8 x 9½ in.
If the Page Size command selection differs from that of the installed paper tray size and the requested page size is not currently available in another non-secure source, then a message is displayed on the control panel requesting installation of a paper tray of the specified size. Note The Page Size command is not supported on the HP LaserJet,, LaserJet+, or the LaserJet 500+ printers.
PAPER SOURCE COMMAND The Paper Source command designates the location to feed paper, or it prints the current page. ?&l#H # = 0 - Print the current page (paper source remains unchanged). 1 - Feed paper from the a printer-specific tray. 2 - Feed paper from manual input. 3 - Feed envelope from manual input. 4 - Feed paper from lower tray. 5 - Feed from optional paper source. 6 - Feed envelope from optional envelope. feeder1 1 Must be used in conjunction with Page Size command, envelope selection.
Logical Page Orientation Command Orientation defines the position of the logical page and the default direction of print with respect to the physical page as shown in Figure 5-1. ?&l#O # Notes = 0 - Portrait 1 - Landscape 2 - Reverse Portrait 3 - Reverse Landscape Default = 0 Range = 0-3 (Other values ignored) This command can be used only once per page. To print multiple directions per page use the Print Direction command.
Table 5-1 HP-GL/2 State Variables ?E or Control Panel Reset: Changing Orientation or Sending a Page Size Command: Redefinition of the horizontal and/or vertical picture frame: Redefinition of the Picture Frame Anchor Point: Specifications of a New HP-GL/2 Plot Size: 5-6 Page Control Commands z executes “IN” command z defaults picture frame z defaults picture frame anchor point z defaults HP-GL/2 plot size z Defaults picture frame anchor point. z Defaults picture frame.
Figure 5-1 Page Orientation With Default Print Direction The orientation of the HP-GL/2 picture is also affected by the logical page orientation. Figure 5-2 illustrates the effect of logical page orientation on the HP-GL/2 picture orientation. It is possible to alter the HP-GL/2 picture orientation within the logical page using the HP-GL/2 RO command (refer to Chapter 21, for additional information).
Figure 5-2 HP-GL/2 Picture Orientation with Respect to Logical Page Orientation 5-8 Page Control Commands EN
Print Direction Command The Print Direction command rotates the logical page coordinate system with respect to the current orientation without performing a page eject. This rotation is performed in 90° increments in a counterclockwise direction. This allows printing in four directions on the same page. ?&a#P # = 0 - 0° rotation. 90 - 90° ccw rotation. 180 - 180° ccw rotation. 270 - 270° ccw rotation.
Figure 5-3 Changing Print Direction on a Page 5-10 Page Control Commands EN
Text Area Text printing may be restricted to a specific area within the logical page using the Left Margin, Right Margin, Top Margin, Text Length, and Perforation Skip Mode commands. This area is known as the text area. The left margin defines the distance between the left edge of the logical page and the left edge of the text area. The right margin defines the distance between the left edge of the logical page and the right edge of the text area.
Figure 5-4 Text Area Within the Page 5-12 Page Control Commands EN
Left Margin Command The Left Margin command sets the left margin to the left edge of the specified column. ?&a#L # = Column number Default = Column 0 (Left bound of logical page) Range = 0 - Right margin The first column within a line is column 0, which is located at the left edge of the logical page (the HMI setting defines the distance between columns, which thereby defines the maximum number of columns on the logical page).
Right Margin Command The Right Margin command sets the right margin to the right edge of the specified column. ?&a#M # = Column number Default = Logical Page right bound Range = Current left margin - Logical page right bound The maximum right column is located at the right edge of the logical page (the HMI setting defines the distance between columns, which thereby defines the maximum number of columns on the logical page).
Clear Horizontal Margins Command The Clear Horizontal Margins command resets the left and right margins. The left margin is set to the left edge of the logical page (column 0) and the right margin is set to the right edge of the logical page.
Top Margin Command The Top Margin command designates the number of lines between the top of the logical page and the top of the text area. ?&l#E # = Number of lines Default = 1/2 inch down from top of logical page1 Range = 0 - Length of logical page (Other values ignored) 1 If logical page length is <½inch, then the top margin is set to top of logical page.
Note The first line of the logical page is line 0.
Text Length Command The Text Length command designates the number of lines (at a given VMI) within the logical page available for printing text, the text area. This effectively defines the bottom margin. ?&l#F # = Number of lines Default = 1/2 inch less than maximum text length1 Range = Logical page length minus top margin 1 Maximum text length = INT(logical page length - top margin). However, if the max text length is less than ½inch, the text length is set to the maximum allowable.
Perforation Skip Command The perforation region is the distance from the bottom of the text area of one page to the top of the text area (top margin) of the next page. When perforation skip is enabled, a Line Feed or Half-Line Feed, which would move the cursor beyond the bottom of the text area, causes the cursor to move to the top of the text area on the next page.
Horizontal Motion Index (HMI) Command The Horizontal Motion Index (HMI) command designates the width of the columns. ?&k#H # = Number of 1/120 inch increments. Default = Determined by the pitch value in the default font header. Range = 0 - 32767 (valid to four decimal places) The value field is valid to 4 decimal places. A value of zero (0) indicates no horizontal motion. When fixed pitch fonts are selected, all printable characters including the Space and Backspace characters are affected by HMI.
Example To print the printer’s resident 16.66 pitch Line Printer font at 17.75 cpi, send ?(s16.66H to select the Line Printer font, then send the command ?&k6.76H to change HMI. This value field is calculated as follows: Each character then occupies 6.76/120 inch or 1/17.75 inch. To use Courier 12 point (10 cpi) and print 80 characters across A4 paper, requires adjusting the HMI value.
Vertical Motion Index (VMI) Command The Vertical Motion Index (VMI) command designates the height of the rows. (The vertical distance the cursor moves for a Line Feed operation.) ?&l#C # = number of 1/48 inch increments between rows. Default = 8 Range = 0 - Current logical page length up to a maximum of 32767 If the specified VMI is greater than the current logical page length, the command is ignored. The value field is valid to 4 decimal places. A Ø in the value field indicates no vertical movement.
Common VMI Settings To print 66 lines per page on letter-size paper, in portrait orientation (with one-half inch top and bottom margins) send: ?&l7.27C 7.27 = (10/66) x 48 To print 66 lines per page on letter or legal-size paper, in landscape orientation (with one-half inch top and bottom margins) send: ?&l5.45C EN 5.45 = (7.
Line Spacing Command The Line Spacing command sets the number of lines printed per inch. Only the values listed below are valid. ?&l#D # = 1 - 1 lpi 2 - 2 lpi 3 - 3 lpi 4 - 4 lpi 6 - 6 lpi 8 - 8 lpi 12 - 12 lpi 16 - 16 lpi 24 - 24 lpi 48 - 48 lpi Default = 6 Range = 0,1,2,3,4,6,8,12,16,24,48 (Other values are ignored) This command performs the same function as the Vertical Motion Index (VMI) command except that it identifies the VMI in lines-per-inch (lpi).
6 Cursor Positioning Introduction This section describes the cursor positioning commands. Although the printer does not actually have a cursor, the PCL cursor position refers to the Current Active Position (CAP), like the blinking underline character (cursor) used on most computers. This “cursor” identifies the current position on the page; the pointer, where a printing command begins laying out page data.
Absolute vs. Relative Cursor Positioning Either absolute or relative motion can be specified. Absolute motion always specifies the distance to move referenced from the top margin at the left bound of the logical page (0,0), regardless of the current active position (CAP) (see Figure 6-1). An unsigned value field in a cursor position command indicates absolute cursor movement. Relative motion specifies the distance to move referenced from the current active position (CAP) (see Figure 6-1).
Cursor Positioning Units Cursor positioning is done in PCL coordinate system units. The units of the X-axis of the PCL coordinate system may be PCL Units, decipoints, or columns. The units of the Y-axis of the PCL coordinate system may be PCL Units, decipoints, or rows. PCL Units The current unit size used in PCL Unit moves is determined by the value specified in the Unit of Measure command, defining the number of units-per-inch used in the following commands: z Vertical Cursor Position (PCL Units).
Decipoints In PCL terminology, a decipoint is 1/720 inch or one-tenth of a PCL point (a PCL point is exactly 1/72 inch as opposed to a typographic point which is approximately 1/72 inch). Columns & Rows The width of a column is defined by the current horizontal motion index (HMI), as described under “Horizontal Motion Index (HMI) Command” in Chapter 5. The distance between rows is defined by the current vertical motion index (VMI), as described under “Vertical Motion Index (VMI) Command” in Chapter 5.
Horizontal Cursor Positioning (Columns) Command This Horizontal Cursor Positioning command moves the cursor to a new column on the current line. ?&a#C # = Number of Columns Default = NA Range = 0 - logical page right bound (valid to 4 decimal places) The width of a column is defined by the current HMI. Note The current unit of measure setting affects how HMI values are rounded.
Horizontal Cursor Positioning (Decipoints) Command This Horizontal Cursor Positioning command moves the cursor to a new position along the horizontal axis.
Horizontal Cursor Positioning (PCL Units) Command This Horizontal Cursor Positioning command moves the cursor to a new position along the horizontal axis. ?*p#X # = Number of PCL Units Default = NA Range = 0 - logical page right bound A value field (#) with a plus sign (+) indicates the new position is to the right of and relative to the current cursor position; a minus sign (–) indicates the new position is to the left of and relative to the current cursor position.
Horizontal Cursor Positioning Control Codes Four control codes can be used to position the cursor horizontally on the current line. These control codes are explained below. Note The distance which the cursor is moved by the Space (SP), Backspace (BS), and Horizontal Tab (HT) control codes is defined by the current HMI value. The current unit of measure setting affects how HMI values are rounded.
BS - Backspace Moves the current active position (CAP) left a distance equal to the width of the last printed symbol or space. If the active position is already at the left margin, no action is taken. If the cursor is currently beyond the right margin, BS positions the cursor just to the left of the right margin. When using fixed pitch fonts, the Backspace distance is defined by the current print pitch (HMI setting).
Vertical Cursor Positioning (Rows) Command This Vertical Cursor Positioning command moves the cursor to a new line in the same column position. ?&a#R # = Number of Rows Default = NA Range = –32767 to 32767 (valid to 4 decimal places) A value field (#) with a plus sign (+) indicates the new position is downward from and relative to the current cursor position; a minus sign (–) indicates the new position is upward from and relative to the current cursor position.
Vertical Cursor Positioning (Decipoints) Command This Vertical Cursor Positioning command moves the cursor to a new position along the vertical axis. ?&a#V # = Number of Decipoints (1/720 inch) Default = NA Range = –32767 to 32767 (rounded to the first decimal place) A value field (#) with a plus sign (+) indicates the new position is downward from and relative to the current cursor position; a minus sign (–) indicates the new position is upward from and relative to the current cursor position.
Vertical Cursor Positioning (PCL Units) Command This Vertical Cursor Positioning command moves the cursor to a new position along the vertical axis. ?*p#Y # = Number of PCL Units Default = NA Range = –32767 to 32767 A value field (#) with a plus sign (+) indicates the new position is downward from and relative to the current cursor position; a minus sign (–) indicates the new position is upward from and relative to the current cursor position.
Half-Line Feed Command The Half-Line Feed command moves the cursor to the same character position one half-line down. The distance moved for a Half-Line Feed is one-half of the current line spacing (defined by the last VMI or line spacing setting). ?= Vertical Cursor Positioning Control Codes Two control codes can be used to position the cursor vertically. These control codes are explained below. LF - Line Feed Advances the current active position (CAP) to the same horizontal position on the next line.
Line Termination Command The Line Termination command controls the way the printer interprets CR, LF, and FF control characters. All CR, LF and FF control characters received after the Line Termination Command are interpreted as shown below.
Push/Pop Cursor Position Command The Push/Pop Cursor Position command allows the current cursor position to be stored and recalled. ?&f#S # = 0 - Push (Store cursor position) 1 - Pop (Recall a cursor position) Default = 0 Range = 0, 1 (Values outside range are ignored) A value field of 0 pushes the cursor position onto the stack, leaving the current position unaffected. A value field of 1 pops the position from the stack, restoring it as the current cursor position.
6-16 Cursor Positioning EN
7 Fonts Introduction A font is a group of symbols that have similar characteristics. A font is described by its symbol set, spacing, height, pitch, style, stroke weight, typeface and orientation. A typical document is printed using several fonts. A large font may be used for the title and chapter headings of a document, a standard size font may be used for the body of the document, and key words or phrases may be highlighted, using a bold or italic font.
A font must be selected for printing by the user. One font is selected at a time. It is selected by identifying the specific characteristics of the font. Font selection commands identify font characteristics to the printer (refer to Summary of Font Selection by Characteristic for detailed font selection information). PCL 5 printers feature scalable fonts. With the addition of this feature, the printer has two font formats available: bitmap and scalable.
Symbol Set Symbol set identifies the specific collection of symbols provided by a font. Each symbol set is defined with a specific application in mind. For example, the legal and math symbol sets were designed to support legal and scientific applications. The following figure shows two common symbol sets, PC-8 and Roman-8.
Spacing Another characteristic that differentiates fonts is spacing. Fonts have either fixed or proportional spacing. Fixed-spaced fonts (Figure 7-3) are those in which the inter-character spacing is constant. Proportionally-spaced fonts (Figure 7-4) are those in which the inter-character spacing varies with the natural shape of a character.
Pitch Pitch describes the number of characters printed in a horizontal inch. Pitch only applies to fixed-spaced fonts, since the number of characters per inch varies for proportional fonts. Figure 7-5 Pitch Height The height of a font is the measurement of the body of the type in PCL points. A PCL point is 1/72 inch in bitmap fonts, and approximately 1/72 inch in scalable fonts.
Style Style is defined by three characteristics: posture (upright, italic), width (condensed, normal, expanded, etc.), and structure (solid, outline, shadow etc.). Examples of upright and italic styles are shown. Figure 7-7 Style Stroke Weight Stroke weight describes the thickness of the strokes that compose characters. Examples of medium and bold stroke weights are shown in the figure below.
Typeface Family Typeface identifies the design of the symbols of the font. Each typeface family has unique and distinguishing design characteristics. The following example shows typefaces from various typeface families.
Orientation Orientation defines the position of the logical page with respect to the physical page as shown in Figure 7-10. Figure 7-10 Orientation The HP LaserJet IID, IIP, 2000, and all PCL 5 LaserJet printers automatically rotate fonts to the current orientation (all fonts are available in all four orientations). (Earlier printers required fonts in the orientation which matched the orientation of the page. Thus, orientation is not as important as it once was.
Bitmap Fonts and Scalable Typefaces There are two basic formats of fonts used by HP PCL 5 printers: bitmap (Figure 7-11) and scalable (Figure 7-12). Earlier HP LaserJet printers supported only bitmap fonts. Bitmap fonts have a fixed bit-pattern for each character. The size of the character is fixed, depending on the bit-pattern. Scalable typefaces, on the other hand, provide an “outline” for the characters. This “outline” can be scaled by the PCL 5 printers to produce a large range of character sizes.
Figure 7-11 Bitmap Character Figure 7-12 Scalable Character 7-10 Fonts EN
Internal Fonts Internal fonts are those fonts that are provided with the printer. Both internal bitmap and scalable font formats are provided. Internal bitmap and scalable fonts and symbol sets for current models of HP LaserJet family printers are listed in Chapter 2 of the PCL 5 Comparison Guide. Font and symbol set listings for earlier printer models can be found in the User’s Manual for each printer. Special Effects HP PCL 5 printers allow you to create special effects when printing characters.
7-12 Fonts EN
8 PCL Font Selection Introduction Several characteristics identify a font (as described in Chapter 7, Fonts). Font characteristic selection commands, described in this chapter, are used to specify the desired font characteristics for printing. Commands are included for the following characteristics: symbol set, spacing, pitch, height, style, stroke weight, and typeface family. The printer maintains a font select table in its operating code that contains the characteristic values of the current font.
Font Selection Priority The printer selects a font based on a prioritization of its design characteristics, then its resolution, then its physical location in the printer, and finally, its orientation. Font selection priority considerations are shown in the following list: Font Priority Considerations Symbol Set highest Spacing | Pitch | Height | Style | Stroke Weight | Typeface Family | Resolution1 | Location2 | Orientation lowest 1.
There are four locations where a font may be stored: printer ROM (Read Only Memory), SIMM module ROM, cartridge ROM, and printer RAM (random access memory; user memory). These font locations are shown below, listed from the highest to lowest priority. The font that matches the characteristics is selected from the highest priority location. Priority of Locations Soft Font (Lowest ID first) Highest Cartridge Font1 | SIMM Font | Internal Font Lowest 1.
Font Select Table The initial font specification in a job should be made using all of the font characteristics. To select a Roman-8, fixed-spaced, 10 pitch, 12 point, upright, bold, Courier font, for the current page orientation, specify each of the characteristics using font selection escape sequences.
At a minimum, only the characteristics of the new font that differ from those of the previously designated font must be sent (the short font selection method). However, HP recommends that all of the characteristics be sent to ensure that the correct font is selected. Note PCL 5 printers can print any number of distinct fonts per page, limited only by available memory.
Symbol Set Command The Symbol Set command identifies the specific set of symbols in a font. “Symbols” are the alphanumeric, punctuation, or any other printable characters or symbols which may be included. E C ( ID Primary Symbol Set Command ID = Symbol Set ID value (see Appendix C in the PCL 5 Comparison Guide) E C ) ID Secondary Symbol Set Command ID = Symbol Set ID value (see Appendix C in the PCL 5 Comparison Guide).
A few symbol sets are listed below. For a more complete list, refer to Appendix C in the PCL 5 Comparison Guide. Typical Symbol Set Values Symbol Set Name Note Symbol Set ID ISO 69: French 1F ISO 8859-1 Latin 1 (ECMA-94) 0N ISO 6:ASCII 0U Legal 1U Roman-8 8U PC-8 10U 3 of 9 Barcode 0Y Windows 3.1 Latin 1 (ANSI) 19U User-defined symbol sets are supported in some HP LaserJet printers.
7-bit ISO Symbol Sets The HP LaserJet printers provide several 7-bit ISO (International Organization for Standardization) or “keyboard” symbol sets to support European languages. Each ISO symbol set is a unique ordering of symbols contained within the Roman-8 symbol set (see Appendix B in the PCL 5 Comparison Guide). The printer automatically generates the requested ISO font from an HP Roman-8 font.
Spacing Command Inter-character spacing can be specified as either proportional or fixed. E C ( s # P - Primary spacing E C ) s # P - Secondary spacing # = 0 - Fixed spacing 1 - Proportional spacing Default = 0 Range = 0, 1 (values outside the range are ignored) When proportional spacing is specified and a proportionally-spaced font is not available (in the requested symbol set), a fixed pitch font with the current pitch specification is selected.
Pitch Command The Pitch command designates the horizontal spacing of a fixed- spaced (bitmap or scalable) font in terms of the number of characters per inch. This characteristic is ignored when selecting a proportionally-spaced (bitmap or scalable) font, but is saved in the font select table and available when a fixed-spaced font is selected. E E C ( s # H - Primary pitch C ) s # H - Secondary pitch # = # = Pitch in characters/inch Default = 10 Range = 0.
The following formula can be used to as a rule of thumb for computing a maximum recommended pitch: The character (“contour”) width in the above formula is expressed as a percentage of an Em. For example, the width of characters in Courier is very close to 60% of an Em, and 30 = 1 ÷ ( 0.64 ÷ 72 ) . (The width of characters in Letter Gothic is approximately 50% of an Em. For other fonts, refer to the font metric data supplied by the font vendor.
Height Command The Height command specifies the height of the font in points. This characteristic is ignored when selecting a fixed-spaced scalable font; however, the value is saved and available when a bitmap font or a proportionally-spaced scalable font is selected. E E C ( s # V - Primary Height C) # s # V - Secondary Height = Height in points Default = 12 Range = 0.25 - 999.75 The value field (#) is valid to two decimal places.
Note If a proportional-spaced scalable font is selected using an ID number, send the Height command to specify the point size otherwise, the size is determined by the height characteristic value of the former font (as listed in the font select table) See “Font Selection by ID Command” later in this chapter for more information. Example To specify a height of 12 points for the primary font, send: E C(s12V To specify a height of 14.4 points for the secondary font, send: E C)s14.
Style Command The Style command identifies the posture of a character, its width, and structure of the font symbols. E E C ( s # S - Primary Style C ) s # S - Secondary Style Default = 0 Range = 0 - 32767 (values greater than 32767 are set to 32767) Style values for the most common typefaces are listed in Table 8-1. Additional style values may also be obtained from the related font documentation provided with HP’s font products.
Notes With the introduction of the HP LaserJet IID printer, Hewlett-Packard expanded the style values (in the Font Header style value field) from a one-byte to a two-byte value field, expanding the style range from 0-255 to 0-32767. This expansion allows for additional styles. Style values can be obtained by calculating the “Style Word” as described under “Style MSB” in Chapter 11. For selecting style, an exact match is required.
Stroke Weight Command The Stroke Weight command designates the thickness of the strokes that compose the characters of a font. E E C ( s # B - Primary stroke weight C ) s # B - Secondary stroke weight Default = 0 Range = - 7 to 7 (less than -7 maps to -7; greater than 7 maps to 7) The value field (#) specifies the thickness of the strokes used in the design of the font. The supported stroke weight values are –7 through 7. The thinnest font available is –7; the thickest font available is +7.
If the specified stroke weight is greater than or equal to 0 and is not available, the next thicker available stroke weight is selected. If no thicker stroke weight is available, the closest available thinner stroke weight is selected. If the specified stroke weight is less than zero and is not available, the next thinner available stroke weight is selected. If no thinner stroke weight is available, the closest available thicker stroke weight is selected.
Typeface Family Command The Typeface Family command designates the design of the font. E E C ( s # T - Primary typeface family C ) s # T - Secondary typeface family # = Typeface family value (see Appendix C in the PCL 5 Comparison Guide for typeface values). Default = 1 Range = 1 4099, Body Text 0 - 65535 (values greater than 65535 are set to 65535) If the value field (#) specifies a typeface that is unavailable, this characteristic is ignored during font selection.
Some typeface (two-byte) family values are listed below. For a complete listing of typeface family and base values, refer to Appendix C in the PCL 5 Comparison Guide.
Orientation The Orientation command (EC&l#O) designates the position of the logical page with respect to the physical page. Earlier printers could only print bitmap fonts and raster graphics in the orientation for which they were designed. However, the HP LaserJet IID, IIP, 2000, and all PCL 5 HP LaserJet printers have the capability to automatically rotate bitmap fonts and raster graphics to match the page orientation; therefore, all fonts are available in all four page orientations and print directions.
Font Selection Examples Bitmap, Fixed-Spaced Font This example illustrates how to select a primary, bitmap, Line Printer, fixed-spaced font with the following characteristics (note that all of the font characteristics are specified): Table 8-3 CHARACTERISTIC VALUE ESCAPE SEQUENCE Symbol set ASCII E C(0U Spacing Fixed E C(s0P Pitch 16.66 cpi E C(s16.66H Height 8.5 point E C(s8.
Scalable, Proportional-Spaced Font This example illustrates how to select a primary, scalable, CG Times, proportional-spaced font with the following characteristics (note that all of the font characteristics are specified except pitch which is not required for a proportional font): CHARACTERISTIC VALUE ESCAPE SEQUENCE Symbol set ASCII E C(0U Spacing Proportional E C(s1P Height 14.25 point E C(s14.
Summary of Font Selection by Characteristic The following summarizes the procedure the printer uses to select a font. Selection by characteristic is an elimination process. The nine steps are performed in the following order: Note When the printer is in 300 dpi mode, any 600 dpi bitmaps are eliminated before the selection process begins. 1Symbol Set - if the specified symbol set exists, that symbol set is selected; otherwise, Roman-8 is selected.
Note For proportionally-spaced scalable fonts, any specified height is available to the nearest quarter point. For fixed-spaced scalable fonts, the designated height is recorded, and the height is calculated from the requested pitch. 5 Style - if the specified style is available in the remaining fonts, that style is selected; otherwise, this characteristic is ignored. 6 Stroke Weight - if the specified stroke weight is available in the remaining fonts, that stroke weight is selected.
9 Orientation - for bitmap fonts the last criteria considered for the selection is its orientation. If two fonts still remain and match in all the above characteristics except orientation, that font which matches the current page orientation is selected.
Font Selectionby ID Command Soft fonts can be specified using their associated ID numbers. (ID numbers are assigned to soft fonts using the Font ID command described in Chapter 9, Font Management).
Examples To specify the font associated with ID number 7 as the primary font, send: E C(7X To specify the font associated with ID number 5 as the secondary font, send: E C)5X Select Default Font Command The Default Font command sets all of the font characteristics to those of the user (control panel selected) default font.
Transparent Print Data Command The Transparent Print Data command provides printing access to those characters which the printer normally defines as unprintable. These characters include decimal character codes 0, 7-15, and 27. E C # & p # X [Transparent Print Data] =Number of bytes of transparent print data. Default = N/A Range = 0 - 32767 Each transparent print data byte is interpreted as a single character code. The appropriate character is printed if one exists; otherwise, a Space is processed.
Underline Command The Underline command controls automatic text underlining. E # C & d # D - Enable underline = 0 - Fixed position 3 - Floating position Default = 0 Range = 0, 3 (values outside range are ignored) E C & d @ - Disable underline Once underlining is enabled, any positive horizontal movement causes an underline to be drawn. Positive horizontal movement includes the printing of text and positive horizontal cursor motion.
8-30 PCL Font Selection EN
9 Font Management Introduction Font management provides mechanisms for manipulating soft fonts. It provides the means for controlling which soft fonts are saved in user memory (RAM) or deleted. This is accomplished by assigning a font as either temporary or permanent, or deleting a soft font. In addition, font management includes the command for assigning ID numbers to RAM fonts.
Downloading Soft Fonts The process of transferring soft fonts from a host computer to the printer’s user memory (RAM) is called downloading. Designate a unique identification (ID) number prior to the download of a font. This number is then associated with the soft font. This number is assigned using the Font ID command, described later in this chapter. Subsequent manipulation of the soft font is accomplished using the font’s ID number.
Temporary vs. Permanent Fonts Once downloaded, a font is automatically designated as temporary. A temporary soft font is deleted from user memory during a printer reset or when a Typeface List, a Font Printout or a self-test is performed from the printer’s control panel. A soft font can be designated as permanent to prevent the printer from deleting it during a printer reset.
Font ID Command The Font ID command is used to specify an ID number for use in subsequent font management commands. The ID number of a font can be used to select the font for printing (refer to “Font Selection by ID” in Chapter 8). E C # *c#D = ID number Default = 0 Range = 0 - 32767 The font ID number is used during subsequent soft font downloads, selections or deletions. The factory default font ID is 0 (if no Font ID command is sent, an ID of 0 is assigned).
Font Control Command The Font Control command provides mechanisms for manipulating soft fonts.
To delete the character “p” (112 decimal) in a bitmap or bound scalable font with an ID of 1, send: E C *c1d112e3F (A space is printed in place of the deleted character. Also, the EC*c#E Character Code command used in the above sequence “...112e...,” is described in Chapter 11.
Font Management Example This example illustrates several typical font management operations. It assumes a bitmap soft font is stored and available on an MS-DOS based hard disk. 1 Set the font ID number to 2: E *c2D C 2 Download a soft font file using the MS-DOS COPY command with the /B option: COPY /B filename PRN Note that the soft font is associated with font ID 2.
Unbound Scalable Fonts Prior to introduction of the HP LaserJet IIIP printer, a downloaded scalable font was restricted to a single symbol set. Now scalable fonts with no symbol set affiliation can be downloaded. These new fonts are called unbound fonts. To download unbound fonts, the “PCL Font Header for Intellifont Unbound Scalable Fonts” or the “Format 15 Font Header for Scalable Fonts” (TrueType) must be used (see Chapter 11).
Symbol Collections The symbols in an unbound font (typeface) can be divided into symbol collections. These symbol collections identify the symbols according to some language basis or special application usage. Some symbol collections include: Basic Latin, East European, Turkish, Math, Semi-Graphic, and Dingbats. If a symbol collection is included in an unbound font, all of the symbols of that collection are included.
Character Complement Numbers The “Intellifont Unbound Scalable Font Header” (header) includes a 64 bit field (bytes 78-85) which contains the Character Complement number. For TrueType fonts, in the “Format 15 Font Header for Scalable Fonts” (unbound), the Character Complement number is included in the accompanying “Segmented Font Data” section of the header. The Character Complement number identifies the symbol collections in the font.
TrueType example: If a symbol set based on Unicode numbers requires one or more characters from the standard ASCII collection and some of the characters from the Latin 5 collection, then bits 31, 28 and 0 are set to one (refer to Appendix D in the PCL 5 Comparison Guide for information regarding the various symbol collections).
Since the printer identifies symbols by their symbol index number (range from 0 to 65535), but receives character codes (range 0-255), a relation must be made between the character codes and the larger range of symbol index numbers. This relation is defined by the symbol set mapping table. The printer contains a symbol set mapping table for each available symbol set. These tables list the character code range and corresponding list of symbol index numbers.
Printing a Character When an unbound font is selected for printing and a character code is received, the printer accesses the requested symbol set mapping table to identify the MSL or Unicode number. For example, if the Roman-8 symbol set is selected and the printer receives character code 254, the printer accesses the Roman-8 symbol set mapping table (Table 9-1). In the Roman-8 mapping table, character code 254 is mapped to MSL number 191 or Unicode number 00b1 (plus-over-minus symbol).
9-14 Font Management EN
10 User-Defined Symbol Sets Introduction User-defined symbol sets are used with unbound scalable fonts. Three new commands provide for the implementation of user-defined symbol sets: Symbol Set ID Code - EC*c#R Define Symbol Set - EC(f#W [symbol set data] Symbol Set Control - EC*c#S To define a symbol set, you must first designate a symbol set ID code. Next, use the Define Symbol Set command to download the list of characters (character codes and related symbol index numbers) for the symbol set.
Symbol Set ID Code Command The Symbol Set ID Code command assigns a symbol set ID code to a user-defined symbol set. This ID code is used by the Symbol Set Control command for symbol set management. The ID code corresponds to the symbol set ID selection value which is used to identify the symbol set during font selection.
When selecting an ID code, select one which is not being used currently. (If an ID code is selected which is already being used in the printer, that symbol set is redefined.) The first step in selecting an ID code is to determine an ID selection value. Since it may be difficult to determine which ID selection values are being used, it is best to select one which has not been assigned.
Define Symbol Set This command defines the characters and character mapping for a user-defined symbol set. E C ( f # W [symbol set definition data] # Default = Range = = Number of bytes in symbol set definition n/a 0 - 32767 If a user-defined symbol set is already present in the printer and a new, valid symbol set is downloaded with the same Symbol Set ID Code, then the old symbol set is deleted. If an internal symbol set with the same ID code exists, it is overridden by the new symbol set.
The following abbreviations are used to define the data type of each field in the symbol set header: Font Header Field Data Type Notation (B) : Boolean (0, 1) (UB) : Unsigned Byte (0 . . 255) (SB) : Signed Byte (-128 . . 127) (UI) : Unsigned Integer (0 . . 65535) (SI) : Signed Integer (-32768 . . 32767) (ULI) : Unsigned Long Integer (0 . . 232-1) (SLI) : Signed Long Integer (-231 . . 231-1) (ASCxx) : ASCII string array (0 . .
Encoded Symbol Set Designator (UI) This field must match the ID code in the Symbol Set ID code command. This field contains the symbol set ID code. The symbol set ID code is calculated from a symbol set ID selection value using the following formula: Symbol Set ID Code = (# * 32) + (ID - 64) where # is the decimal number (0 to 1023) and ID is the ASCII character code of the letter.
First Code (UI) Specifies the first character code in the set. Last Code (UI) The Last Code specifies the last character code in the set. Together, the First Code through the Last Code identify the range of character codes which map to the symbol index numbers (characters) in the Symbol Map field.
MSL Symbol Index Character Requirements Bit Value Designated Use 63 1 Basic Latin required (such as ISO 8859/1 Latin 1) 0 Basic Latin not required 1 East European Latin required (such as ISO 8859/2 Latin 2).
Unicode Symbol Index Character Requirements Bits (numbers/values) Bit Value Designated Use 31 1 ASCII required (such as ISO 6 ASCII) 0 ASCII not required. 1 West Europe extensions required (such as ISO 69 French). 0 West Europe extensions not required. 1 East Europe extensions required (such as ISO 8859/2 Latin 2). 0 East Europe extensions not required. 1 Turkish extensions required (such as ISO 8859/9 Latin 5). 0 Turkish extensions not required.
Examples of values for the field include: Bit Field Designated Use Value (Hex) Meaning 0000000000000000 Default requirement (MSL); symbol set can be used with any typeface indexed bu MSL. 8000000000000000 Symbol set (MSL) requires only the Basic Latin Symbol Collection (such as Roman-8) 0000000100000000 Symbol set (MSL) requires only the Dingbat Collection. 0000000000000001 Default requirement (Unicode); symbol set can be used with any typeface indexed bu Unicode.
Symbol Map (Array of UI) The symbol map contains a list of symbol index numbers. This list identifies symbols for the symbol set. (Refer to Appendix D in the PCL 5 Comparison Guide for a MSL and Unicode symbol indexes.) The symbol map pairs (maps) a character code to a symbol index number. The range of character code numbers (paired with symbol index numbers) is the range from the First Code through the Last Code fields in the header.
Symbol Set Control Command This command provides a means for making user-defined symbol sets permanent or temporary, and for deleting them. E C # Default = Range = *c#S = 0 -Delete all temporary and permanent user-defined symbol sets. 1 - Delete all temporary user-defined symbol sets. 2 - Delete current user-defined symbol set (last symbol set ID code specified). 4 - Make current user-defined symbol set temporary. 5 - Make current user-defined symbol set permanent.
User-Defined Symbol Set Examples The following two examples illustrate the concept of user-defined symbol sets. They create symbol sets for PC-8 in MSL and Unicode symbol indexes. The necessary escape sequences are shown in each example.
Symbol Map Data: (continued) 00 41 (character code 65) Uppercase A 00 61 (character code 97) Lowercase A 20 7f (character code 252) Superior Lowercase N 00 b2 (character code 253) Superior Numeral 2 25 a0 (character code 254) Small Solid Square Box E C*c341r5S PCL Symbol Set #ID: 10U, Make this symbol set permanent.
Symbol Map Data: (continued) EN 00 cf (character code 5) Solid Spade, Card Suit 00 e7 (character code 31) Down Solid Arrowhead 00 00 (character code 32) Space Code 00 01 (character code 33) Exclamation Mark 00 22 (character code 65) Uppercase A 00 43 (character code 97) Lowercase A 01 4c (character code 252) Superior Lowercase N 00 c5 (character code 253) Superior Numeral 2 01 31 (character code 254) Small Solid Square Box 00 00 (character code 255) No-Break Spac
10-16 User-Defined Symbol Sets EN
11 Soft Font Creation Introduction A font that is downloaded (transferred) from a computer to a printer is called a soft font. A PCL soft font contains a font header and a set of character definitions. The font header and character definitions contain all the information needed to format a font for use in the HP LaserJet printers.
The definition of a font with a quantity n characters would appear as shown below. Table 11-1 Font ID Command Font Header Character Code1 Character Descriptor1 Character Data1 Character Code2 Character Descriptor2 Character Data2 Character Coden Character Descriptor n Character Datan Font Classifications There are three basic classifications of fonts accepted by the HP LaserJet printer: PCL bitmap, Intellifont scalable, and TrueType scalable.
TrueType scalable fonts are described in detail in the document, True Type Font Files. (Refer to Related Documents, located in the front of this manual, for information on how to obtain this document.) Note EN The documents, Intellifont Scalable Typeface Format and True Type Font Files do not contain descriptions of scalable PCL fonts. Instead, they contain descriptions of files from which PCL fonts can be built.
Coordinate System Both bitmap and scalable characters are designed in an area referred to as a cell or window, and each has its own coordinate system and set of units. Bitmap Fonts Characters of a bitmap font are designed within a rectangular area referred to as a cell. The bitmap character cell is illustrated in Figure 11-3, Figure 11-6, and Figure 11-7. The physical coordinate system is defined in terms of the directions of raster scan (X) and paper motion (Y), as illustrated in the following figure.
The master font design size is 250 points (a CG point=.01383 inches). There are 8782 units per Em at the Master Font Size. Figure 11-2 Agfa Design Window TrueType Scalable Fonts TrueType scalable font character coordinates are typically based on a system of 2048 units per Em. The baseline is defined by y-coordinate=0. The left reference is usually defined by x-coordinate=0 (although there is some variation among fonts).
Font Header Command The Font Header command is used to download font header data to the printer. E C Default Range ) s # W [font header data] = 0 = 0 - 32767 The value field (#) identifies the number of bytes in the font header. The font header fields are described under Font Header Format, later in this chapter. Note Two examples for downloading a Font Header are provided under Font Header Examples, after the Font Header Format section, later in this chapter.
Note Use the Font ID command to designate a unique ID number prior to the download of a font header. If an existing font is already associated with this ID, the existing font is deleted upon the download of the font header. Unless otherwise specified, inappropriate values in a font header field invalidates the font download process; a font is not created and the associated font data is discarded.
Table 11-2 Format 0 Font Header (for PCL Bitmapped Fonts) 16 Pitch (Default HMI) 18 Height 20 x-Height 22 Width Type Style LSB 24 Stroke Weight Typeface LSB 26 Typeface MSB Serif Style 28 Quality Placement 30 Underline Position (Distance) Underline Thickness (Height) 32 Text Height 34 Text Width 36 First Code 38 Last Code 40 Pitch Extended 42 Cap Height 44-47 Font Number 48-63 Font Name 64 Copyright (optional) Table 11-3 Byte Height Extended Format
Table 11-3 EN Format 20 Font Header (for Resolution-Specified Bitmapped) (continued) 8 Cell Width 10 Cell Height 12 Orientation 14 Symbol Set 16 Pitch (Default HMI) 18 Height 20 x-Height 22 Width Type Style LSB 24 Stroke Weight Typeface LSB 26 Typeface MSB Serif Style 28 Quality Placement 30 Underline Position (Distance) Underline Thickness (Height) 32 Text Height 34 Text Width 36 First Code 38 Last Code 40 Pitch Extended 42 Cap Height 44-47 Font Number
Table 11-4 Byte Format 10 Font Header (for Intellifont Bound Scalable) 15 (MSB) 8 7 0 Font Descriptor Size (minimum 80) 2 Header Format (10) Font Type 4 Style MSB Reserved 6 Baseline Position 8 Cell Width 10 Cell Height 12 Orientation 14 Symbol Set 16 Pitch (default HMI) 18 Height 20 x-Height 22 Width Type Style LSB 24 Stroke Weight Typeface LSB 26 Typeface MSB Serif Style 28 Quality Placement 30 Underline Position (Distance) Underline Thickness (Height) 32 Text
Table 11-4 48-63 Format 10 Font Header (for Intellifont Bound Scalable) (continued) Font Name 64 Scale Factor 66 X Resolution 68 Y Resolution 70 Master Underline Position 72 Master Underline Thickness (Height) 74 OR Threshold 76 Global Italic Angle Desc.
Table 11-5 Format 11 Font Header (for Intellifont Unbound Scalable Fonts) (continued) 16 Pitch (default HMI) 18 Height 20 x-Height 22 Width Type Style LSB 24 Stroke Weight Typeface LSB 26 Typeface MSB Serif Style 28 Quality Placement 30 Underline Position (Distance) Underline Thickness 32 Text Height 34 Text Width 36 Reserved 38 Number of Contours (Characters) 40 Pitch Extended 42 Cap Height 44-47 Font Number 48-63 Font Name Height Extended 64 Scale F
Table 11-5 Format 11 Font Header (for Intellifont Unbound Scalable Fonts) (continued) Desc. Size-2 Global Intellifont Data Size Desc.
Table 11-6 Format 15 Font Header (for TrueType Scalable Fonts) (continued) 32 Text Height 34 Text Width 36 First Code 38 Last Code/Number of Characters 40 Pitch Extended 42 Cap Height 44-47 Font Number 48-63 Font Name Height Extended 64 Scale Factor 66 Master Underline Position 68 Master Underline Thickness 70 Font Scaling Technology 72 [additional data may be inserted here] Desc.
Table 11-7 Font Header Field Data Type Notation (continued) (SI) : Signed Integer (-32768 . . 32767) (ULI) : Unsigned Long Integer (0 . . 232-1) (SLI) : Signed Long Integer (-231 . . 231-1) (ASCxx) : ASCII string array (0 . . xx-1) of characters Font Descriptor Size (UI) Specifies the number of bytes in the font descriptor. See the font header figure for the appropriate font descriptor size. Header Format (UB) The Header Format byte identifies the font to format (see below).
Table 11-9 Note Font Type Values (continued) 2 Bound font. All character codes 0 to 255 are printable, except 0, 7 to 15, and 27 [decimal] (see note below). 10 Unbound font. Character codes correspond to HP MSL numbers (for Intellifont unbound scalable fonts). 11 Unbound font. Character codes correspond to Unicode numbers (for TrueType unbound scalable fonts).
Table 11-11 Value Appearance Width (multiply by 4 for StyleWord partial sum) 0 Normal 1 Condensed 2 Compressed or Extra Condensed 3 Extra Compressed 4 Ultra Compressed 5 Reserved 6 Extended or Expanded 7 Extra Extended or Extra Expanded Table 11-12 Value 0 Solid 1 Outline 2 Inline 3 Contour, Distressed (edge effects) 4 Solid with Shadow 5 Outline with Shadow 6 Inline with Shadow 7 Contour with Shadow 8-11 Patterned (complex patterns, subject to type family) 12-15 Pattern
Note The reserved bits (15 - 10) should be set to zero. If a value is requested, and a match not made, the request is ignored and the current font selection process continues as if the parameter was never requested (but it is saved in the attribute table). Example Assuming a font style of “italic compressed contour” is desired, the value (#) would be: 1 + (2×4) + (3×32) = 105 Baseline Position (UI) Bitmap Font - Specifies the distance from the top of the cell to the baseline.
Bitmap Font - Specified in PCL coordinate system dots. Scalable Font - Specified in design units. Figure 11-3 Character Cell - Bitmap Orientation (UB) Specifies the orientation of the font. All characters within the font must have the same orientation as those specified in the font header; otherwise they are discarded as they are downloaded.
Bitmap Font - Unsupported values invalidate font creation. Scalable Font - set to zero. Note Hewlett-Packard recommends that bitmap soft fonts be designed in portrait (0°), using the paper motion and raster scan direction of the HP LaserJet Plus and LaserJet series II printers. The HP LaserJet IID, IIP, 2000, and PCL 5 LaserJet printers rotate the fonts to match the paper’s physical coordinate system for the various paper sizes. Spacing (B) Specifies the spacing of the font.
Symbol set escape sequence termination characters can be any upper case ASCII character “A” through “Z.” “Q” is reserved for use with HP “Specials” symbol sets and is not recommended for general use. Notes Symbol set ID’s of “@” and “X” do not have a corresponding Symbol Set selection command, sets marked as such can be selected only with the Font ID. This field must have a value of 56 for a type 10 or 11 font (unbound Intellifont scalable) to be valid.
Height (UI) Bitmap Font - Specifies the design height of the font in quarter-dots (radix dots). This value, converted to points, is used as the height 1characteristic value of the font. A PCL point is ----(0.01389) inch. 72 It combines with Height Extended to specify the design height of the font in 1024th-dot (fonts designed at 300 dpi). For example, a 10 point font at 300 dpi has a height of 166 1 - inch/point) quarter-dots (radix dots) (1200 quarter dots/inch, ----72 as calculated: The remainder 0.
Width Type (SB) Specifies the proportionate width of characters in the font. Table 11-13 Width Type Values Value Width Type -5 Ultra Compressed -4 Extra Compressed -3 Compressed or Extra Condensed -2 Condensed 0 Normal 2 Expanded 3 Extra Expanded Additional width types may be added by HP. Style LSB (UB) The least significant byte (LSB) of the Style word. Refer to Style MSB for a description of the Style word.
Table 11-14 Stroke Weight Values (continued) -3 Light -2 Demi Light -1 Semi Light 0 Medium, Book, or Text 1 Semi Bold 2 Demi Bold 3 Bold 4 Extra Bold 5 Black 6 Extra Black 7 Ultra Black Typeface (UB) This field specifies the HP typeface number of the font. The current version of this field, supported by the &payette; printer, is described first. Then a previous field, supported in earlier printers, is described.
Table 11-15 Typeface Family Value (Current) 15 12 Vendor 11 0 Typeface Family Vendor Number - Bits 15 - 12. This value is assigned by HP and is between decimal values 0 and 15. Table 11-16 Current Vendor Number Values Value Vendor =0 Reserved =1 Agfa Division, Miles Inc. =2 Bitstream Inc. =3 Linotype Company =4 The Monotype Corporation plc =5 Adobe Systems Inc. = 6-15 (Reserved) Typeface Family Number - Bits 11 - 0 This value is between 0 and 4095.
Previous Usage The previous treatment of the Typeface field supported the LaserJet IIP, IID and LaserJet III family printers. It consisted of the Typeface Least Significant Byte (LSB; the original, one-byte typeface value used prior to the LaserJet IID printer) and the Typeface Most Significant Byte (MSB) in the font header. The previous typeface family value field is shown below.
Typeface Base ValueThe Typeface Base Number (bits 0 through 8) ranged from 0 to 511. Some of these values referred to the styles that vary by structure and appearance width (such as Helvetica Condensed, Helvetica Outline, etc.). Do not use these values in new designs since they are being deleted. Refer to Appendix C in the PCL 5 Comparison Guide for a list of typeface families and their typeface base values. Note For future compatibility, use the two-byte (typeface MSB/LSB) typeface family value.
Table 11-19 Serif Style Values (continued) 11 Script Calligraphic 12 Script Broken Letter 13-63 Reserved Values for bits 6 & 7 64 Sans Serif 128 Serif 192 Reserved Quality (UB) This field specifies the quality of the font. Table 11-20 Quality Values Value Quality 0 Data processing (draft) 1 Near Letter Quality 2 Letter Quality Placement (SB) Placement specifies the position of character patterns relative to the baseline.
Underline Position (Distance) (SB) Bitmap Font - Specifies the distance from the baseline to the top dot row of the underline in font design dots. Zero specifies an underline position at the baseline. A positive value specifies an underline position above the baseline. A negative value specifies an underline position below the baseline. Scalable Font - Set Underline Position to zero. The Master Underline Position field (see below) identifies this information for scalable fonts.
First Code (UI) First Code specifies the character code of the first printable character in the font. This value is between 0 and 255 inclusive. The Space Character may be printable and will print an image if one is defined, otherwise a Space control code is executed. Currently, PCL 5 LaserJet printers use the Font Type field to determine the first and last codes of the symbol set, as shown below: Table 11-22 Font Type First Code../..
Scalable Font - Set Pitch Extended field to zero. Height Extended (UB) Bitmap Font - This is an addition to the Height field which extends the height an extra eight bits. The value of this field is in font design units. For example, a 10 point font designed at 300 dpi would have a Height field of 166 (41.5 dots, or 9.96 points) and a Height Extended field of 170 (0.1660 dots additional, which adds to 9.9998 points). This field is calculated similar to the Pitch Extended field.
Font Number (ULI) The Font Number field uses four bytes (byte 44, 45, 46, and 47). The lower three bytes (45, 46, and 47) contain the font number in hexadecimal. This is the number the vendor assigns to their typeface. The most significant byte (byte 44) consists of a flag in the most significant bit indicating whether the font is in its native (0) format or has been converted (1) from another format.
Figure 11-4 This field is ignored by the printer for bitmap fonts. Font Name (ASC16) This is a 16 character ASCII field to which you may assign a font name. The font name is used in the Typeface List (or Font List printout), under Name or Typeface (if the printer does not have a name string assigned to the typeface family code in its font selection table). X Resolution (UI) The X Resolution field is the pixel resolution in the X scan direction at which the font was designed.
Y Resolution (UI) The Y Resolution field is the pixel resolution in the Y scan direction at which the font was designed. Note This field is not present in the Format 15 Font Header and is not necessary for TrueType fonts. Scale Factor (UI) The Scale Factor field indicates the number of design units per Em, and is the unit used for all scalable metrics in the font header. It is used for TrueType and Intellifont scalable soft fonts.
Variety (UB) The interpretation of this field depends on the value of the preceding (Font Scaling Technology) byte. For TrueType fonts, this field must be set to zero. OR Threshold (UI) Formerly called the “LRE Threshold,” this is the pixel size in design units above which the missing pixel recovery process is switched on in Intellifont scaling and rasterization. Note The size of a pixel (in design units) increases as point size and device resolution decrease.
Note In the Format 15 Font Header for TrueType Scalable Fonts, the data in this field is contained in the “CC” (Character Complement) field in the Segmented Font Data section immediately following the descriptor data. See “Segmented Font Data” later in this chapter . Table 11-25 MSL Symbol Index Bit Field Designated Use 58-63 Reserved for Latin fonts. 55-57 Reserved for Cyrillic fonts. 52-54 Reserved for Arabic fonts. 50-51 Reserved for Greek fonts. 48-49 Reserved for Hebrew fonts.
Individually defined bits are shown in the following two tables: Table 11-27 MSL Symbol Index Character Complement Bits Bit Value 63 0 if font is compatible with standard Latin character sets (e.g., Roman-8, ISO 8859-1 Latin 1); 1 otherwise. 62 0 if font is compatible with East European Latin character sets (e.g., ISO 8859-2 Latin 2); 1 otherwise. 61 0 if font contains Turkish character sets (e.g., ISO 8859/9 Latin 5); 1 otherwise.
Table 11-28 Unicode Symbol Index Character Complement Bits 26 0 if font is compatible with character sets requiring a wider selection of accents (e.g., MC Text, ISO 8859/1 Latin 1); 1 otherwise. 25 0 if font is compatible with traditional PCL character sets (e.g., Roman-8, Legal, ISO 4 United Kingdom); 1 otherwise. 24 0 if font is compatible with the Macintosh character set (MC Text); 1 otherwise. 23 0 if font is compatible with PostScript Standard Encoding (PS Text); 1 otherwise.
Table 11-29 (continued) ‘‘ffffffff5ffffffe’’ Font indexed in Unicode and is compatible only with East Europe Latin character sets. Checksum The Checksum field is over bytes 64 through the end of the header. The checksum should contain a value which, when added to the sum of byte 64 through the reserved byte, equals a value which, when divided by 256 (modulo 256 arithmetic), results in a remainder of 0. For example, if the sum = 10,234 then, 10,234 mod 256 = 250.
Table 11-30 below shows the structure of the Segmented Font Data section. Table 11-30 Segmented Font Data Byte 15 (MSB) 8 7 x+0 First segment, Segment Identifier x+2 First segment, Segment Size x+4 First segment, Data Segment (LSB) 0 x+4 Second segment: Segment Identifier, Size, Data + 1st Segment seg size #–6 Null Segment Identifier (FFFF - hex) #–4 Null Segment Size (0) #–2 Reserved Checksum x = Font Descriptor Size. # = Font header length (as defined in Font Header command).
Data segments with an unrecognized identifier are ignored. Segment Size (UI) For each entry in the Segmented Font Data section, the Segment Size indicates the number of bytes in the immediately following Data Segment. The size for the Null Segment is 0. Formats of Data Segments AP (Application Support Segment) The definition of this segment is reserved. CC (Character Complement) This field has the same form (i.e., 8 unsigned bytes) and function as does the Character Complement of Format 11 fonts.
The optional cvt, fpgm and prep tables, as defined in True Type Font Files, typically appear in the Global TrueType Data Segments of hinted TrueType soft fonts, but should not appear in unhinted fonts. IF (Intellifont Face Data) Reserved for future use. PA (PANOSE Description) This data segment of variable length may be used for the purpose of font selection and substitution. Its definition continues to evolve.
Font Header Examples Two examples for downloading a Font Header are provided below; one for a bitmap font and one for an Intellifont scalable font. Bitmap Example To download a bitmap font header for a portrait HP Roman-8, 10 pitch, 12 point, upright, medium, Courier font, with an ID number of one, send: E *c1D (set Font ID to 1) C E )s#W (# = 64 bytes of font descriptor data C + x bytes of optional data) An example of the bitmap header is shown on the following page.
Table 11-32 (continued) Style LSB 0 Upright, Normal Width, Solid (0,0,0) Stroke Weight 0 Medium Typeface LSB 3 Body Text Typeface MSB 0 No Font Vendor ID Serif Style 2 Serif Line Quality 0 ∅ Placement 0 ∅ -10 ∅ 3 ∅ Underline Position Underline Thickness Text Height 200 Quarter dots (50.00 Dots) Text Width 120 Quarter Dots (30.
Table 11-33 FIELD NAME DESCRIPTION Descriptor Size 80 Bytes Header Format 10 Scalable Font Format Font Type 1 Eight Bit Style MSB 0 Reserved 0 Baseline Location 5380 Y reference in Design Window Cell Width 0 ..not defined for Intellifont Cell Height 0 ..not defined for Intellifont Orientation 0 ..not defined for scalable fonts Spacing 1 Proportional Symbol Set 277 8U: Roman-8 Pitch 2602 29.63% Em Default HMI Design Height 2000 250 Points * 8 x-Height 4009 45.
Table 11-33 (continued) Placement 0 ..not defined for scalable fonts Underline Position 0 ..not defined for scalable fonts Underline Thickness 0 ..not defined for scalable fonts Text Height 0 ..not defined for Intellifont Text Width 4391 First code 33 Last Code 273 Width of En Space Compound Pieces Present (n255) Pitch Extended 0 ..not defined for scalable fonts Height Extended 0 ..not defined for scalable fonts Cap Height 5851 66.
Table 11-33 (continued) EN ....Global Intellifont Data .... }= 112 bytes added to header data ....Copyright Statement (optional) .... }= x bytes added to header data ....Application Support (optional) ....
Character Definitions Following the font header, the individual characters must be defined. Every PCL character definition contains a character descriptor and a body of character data. The character definition always consists of one or more character data blocks. Each character data block begins with its own header. The character data block header always has a size of 2 bytes. The first data block of a character definition must always have a character descriptor immediately after its 2-byte header.
Character Code Command The Character Code command establishes the decimal code that is associated with the next character downloaded. This value is used to reference the character for printing. E C # = 0 = 0 - 65535 Default Range Notes *c#E =character code For unbound fonts, the character code for a given character equals its symbol index value. For TrueType fonts, a special code must be used to download glyphs which never stand alone as characters. FFFF (hex) should be used for this purpose.
Character Definition Command The Character Descriptor and Data command is used to download character data blocks to the printer for both bitmap and scalable fonts. E C Default Range ( s # W [character descriptor and data] = N/A = 0 - 32767 The value field (#) identifies the number of bytes in the immediately following character data block. The maximum number is 32767.
Character Descriptor Formats Character definition formats for PCL Bitmap, Intellifont Scalable and TrueType Scalable fonts are shown on the following pages. Note The following notation is used to define the data type of each field in the character descriptors. Table 11-34 Character Descriptors/Data Continuation Block (B) : Boolean (0,1) (UB) : Unsigned Byte (0 . . 255) (SB) : Signed Byte (-128 . . 127) (UI) : Unsigned Integer (0 . . 65535) (SI) : Signed Integer (-32768 . .
Table 11-35 PCL Bitmap Character Descriptor and Data Format (continued) 6 Left Offset 8 Top Offset 10 Character Width 12 Character Height 14 Delta X 16 Raster Character Data: (in bytes) Table 11-36 PCL Bitmap Continuation Character Descriptor and Data Format Byte 15 (MSB) 8 7 0 Format (4) 2 Raster Character Data: (in bytes) (LSB) 0 Continuation (non-zero) Format (UB) This is the first byte of every character data block header.
Continuation (B) This is the second (and last) byte of every character data block header. It specifies whether the following data is the first (0) data block of a new character definition, or a continuation (1) block for a character definition which has already been received by the printer. Because the value field in a Character Definition command is limited to 32767 bytes, characters whose byte count exceed this must be sent in two or more blocks.
Class 1 - Bitmap Data Class 1 or bitmap (raster) character data is a string of bytes containing the dot-per-bit image of the character, no data compression. If a bit is set to one, the corresponding dot is printed. The data is grouped in dot rows. A row describes a one-dot-high strip of the character from left to right, in the direction of the printer’s raster scan (see the Portrait Bitmap Character Data Example, at the end of this chapter).
Figure 11-5 Class 2 Character Data EN Character Descriptor Formats 11-55
Orientation (UB) Orientation byte specifies the orientation of the character. The orientation of the character must match the orientation of the font. Table 11-39 Value Orientation 0 Portrait 1 Landscape 2 Reverse portrait 3 Reverse landscape If the orientation is not supported or is different from the orientation specified in the font header, the character is discarded.
Character Width (UI) The Character Width, used for bitmap fonts only, identifies the width of the character in dots on the physical coordinate system. Generally, this width is from the farthest left black dot to the farthest right black dot. Character width is orientation dependent. The legal range for character width is 1 to 16384 dots. Character Height (UI) Character Height specifies the height of the character in dots on the physical coordinate system. Character height is orientation dependent.
Figure 11-6 Portrait Character Example 11-58 Soft Font Creation EN
Figure 11-7 Landscape Character Example EN Character Descriptor Formats 11-59
Character Descriptor and Data Format for Intellifont Scalable Fonts The character header contains a block of bytes that identify character outline data. Table 11-40 and Table 11-41 show the format of the Intellifont scalable character descriptor and data .
Table 11-41 Intellifont Scalable Contour Data Format Contour Tree Data XY Coordinate Data Table 11-42 Intellifont Scalable Character Descriptors/Data Continuation Block Byte 15 (MSB) 8 7 Continuation (1)1 0 Format (10) 2 Contour Character Data, resumed: (in bytes, see Table 11-41. #–2 (LSB) 0 Checksum2 Reserved 1. Continuation is supported for Intellifont scalable fonts for class 3 only. 2. This byte appears only on the last continuation.
Format (UB) This is the first byte of every character data block header. It specifies the format of the character descriptor and data. The format number for Intellifont scalable fonts is 10. Table 11-44 Value Format 4* LaserJet Family (Raster) 10 Intellifont Scalable 15* TrueType Scalable * These are described elsewhere in this chapter. If the format number is different from that expected by the device, the character is discarded.
Table 11-45 Value Class 1* Bitmap 2* Compressed Bitmap 3 Contour (Intellifont Scalable) 4 Compound Contour (Intellifont Scalable) 15* TrueType Scalable * These are described elsewhere in this chapter. Class 3 -Intellifont Scalable Character Contour Data Class 3 is for Intellifont scalable contour character data. The contour character data is organized as described in Table 11-41. Bytes 0-3 contain the character descriptor.
Character Intellifont Data Offset (SI) The offset to the Character Intellifont Data relative to the address of the Contour Data Size field. Contour Tree Offset (SI) The offset to the contour Tree Data relative to the address of the Contour Data Size field. XY Data Offset (SI) The offset to the XY data relative to the address of the Contour Data Size field. Metric Data For information about Metric Data refer to the Intellifont Scalable Typeface Format document.
Compound Character Escapement (SI) The escapement in design units of a compound character. Number of Components (UB) The number of components of a compound character. Component List This is a list of component descriptions. The list contains Number of Components elements. Each component descriptor consists of 6 bytes as described in Table 11-46 below.
Table 11-47 TrueType Character Descriptor (no continuation block required) Byte 15 (MSB) 8 7 0 Format (15) Continuation (0) 2 Descriptor Size Class (15) 4 [additional descriptor data may be inserted here] 2+ Desc Size Character Data Size 4+ Desc Size Glyph ID 6+ Desc Size TrueType Glyph Data #–2 Reserved (LSB) 0 Checksum # = Character data block size as defined in Character Definition command.
Table 11-48 (continued) 6+ Desc Size beginning of TrueType Glyph Data Table 11-49 TrueType Character Descriptor (multiple character data blocks) Byte 15 (MSB) 8 7 0 Format (15) 2 conclusion of TrueType Glyph Data #–2 (LSB) 0 Continuation (1) Reserved Checksum # = Character data block size as defined in Character Definition command. Format (UB) This is the first byte of every character data block header. It specifies the format for character downloading.
Continuation (B) This is the second (and last) byte of every character data block header. It specifies whether the following data is the first (0) data block of a new character definition, or a continuation (1) block for a character definition which has already been received by the printer. Because the value field in a Character Definition command is limited to 32767 bytes, characters whose byte count exceed this must be sent in two or more blocks.
Character Data Size (UI) The value of the Character Data Size should equal the sum of the sizes of the Character Data Size, Glyph ID, and TrueType Glyph Data fields. This value alerts the PCL interpreter when a continuation block is needed. The minimum possible value is 4. The value of Character Data Size plus Descriptor Size plus 4 (for the Format, Continuation, Reserved and Checksum bytes) will never be less than the value # given in the character download command.
Character Definition Examples Bitmap Portrait Character Example To download a bitmap character descriptor and data for a portrait, 10 Pitch, 12 point, upright medium, Courier lower-case “p”, send: E *c112E (112 is the decimal character code for an ASCII C lower-case “p”) E (s140W [character descriptor and data] C Note Notice that the 140 appearing in the Character Definition Command accounts for 2 bytes of the Character Data Block Header, 14 bytes of Character Descriptor, and 124 bytes of Character Data.
Table 11-53 Portrait Character Data Example Dot Row Bit Map Decimal Equivalent 01 00000000 00001111 11000000 00000000 0 15 192 0 02 11111100 01111111 11111000 00000000 252 127 249 0 03 11111100 11111111 11111100 00000000 252 255 252 0 04 11111101 11110000 00111110 00000000 253 240 62 0 05 00011111 11000000 00001111 00000000 31 192 15 0 06 00011111 10000000 00000111 00000000 31 128 7 0 07 00011111 00000000 00000111 10000000 31 0 7 128 08 00011110 00000000 0000001
Table 11-53 Portrait Character Data Example (continued) 25 00011100 00000000 00000000 00000000 28 0 0 0 26 00011100 00000000 00000000 00000000 28 0 0 0 27 00011100 00000000 00000000 00000000 28 0 0 0 28 00011100 00000000 00000000 00000000 28 0 0 0 29 11111111 11111100 00000000 00000000 255 252 0 0 30 11111111 11111100 00000000 00000000 255 252 0 0 31 11111111 11111100 00000000 00000000 255 252 0 0 Bitmap Landscape Character Example To download the character descript
Table 11-55 Landscape Character Data Example Dot Row Bit Map Decimal Equivalent 01 00000000 01111110 00000000 00000000 0 126 0 0 02 00000011 11111111 11000000 00000000 3 255 192 0 03 00001111 11111111 11110000 00000000 15 255 240 0 04 00011111 10000001 11111000 00000000 31 129 248 0 05 00111110 00000000 01111100 00000000 62 0 124 0 06 00111000 00000000 00111100 00000000 56 0 124 0 07 01111000 00000000 00011110 00000000 120 0 30 0 08 01110000 00000000 00001110 00
Table 11-55 Landscape Character Data Example (continued) 25 01110000 00000000 00000000 00001110 112 0 0 14 26 01110000 00000000 00000000 00001110 112 0 0 14 11-74 Soft Font Creation EN
12 Macros Introduction A Macro is a group of PCL and H”P-GL/2 commands and/or data created by the user that is downloaded and stored in the printer. Once stored in the printer, a macro can be invoked upon request (using the assigned macro ID number), using a single command. When printing letters, for example, which include a company letterhead, the letterhead is repeated for each letter. This letterhead can be created as a macro and stored in the printer.
Hewlett-Packard provides a service to assist you by developing these custom products. For information contact: Hewlett-Packard Boise Printer Division Attention: Product Specials 11311 Chinden Blvd.
Macro Creation Designate a unique identification (ID) number prior to the definition of a macro using the Macro ID command. This number is assigned to the macro. If a macro is already associated with this ID number, the previously existing macro is deleted from user memory during the definition of the new macro. Subsequent macro operations are accomplished using the macro ID number. A macro is created in the printer in several steps.
Macros occupy a portion of user memory. The number of macros that can be stored simultaneously in user memory is limited only by the amount of available user memory. Macro Invocation There are three ways to invoke a macro: execute, call, and overlay, using the Macro Control command. When a macro is executed, it begins performing its commands using the current modified print environment.
The overlay environment consists of the current settings for the following features with the remainder of the environmental features set to their user default values: Table 12-2 PCL CONTEXT: Page length Paper source Page size Number of copies Orientation Cursor position stack Registration HP-GL/2 CONTEXT: Current Pen Position Scaling Points Hard Clip Limits Soft Clip Window Logical Page Boundaries Fill Attributes Line Attributes Refer to Chapter 3 for descriptions of environments.
Deleting Macros There are several mechanisms provided by PCL macro control for explicit deletion of macros from user memory. These include commands to delete all macros, all temporary macros, or an individual macro by reference to its macro ID number, using the Macro Control command described later in this chapter. Both temporary and permanent macros are deleted from memory whenever the printer’s power is turned off. Macro ID The Macro ID command specifies an ID number for use in subsequent macro commands.
Macro Control The macro control command provides mechanisms for definition, invocation, and deletion of macros.
ROM-Based Macros Macros can be supplied in ROM (read only memory), such as custom macro cartridges or on SIMM modules. The following considerations apply to all ROM-based macros. z ROM-based macros include the macro ID numbers for their macros. These numbers cannot be changed. It is possible for a downloaded macro to be assigned the same ID number as a ROM macro. If this occurs, the downloaded macro has precedence. To access the ROM macro, the downloaded macro must be deleted.
To enable the macro with an ID of 7 for automatic overlay, send: E &f7y4X C To delete the macro with an ID of 7, send: E &f7y8X C Macro Control Example The following illustrates the definition of a letterhead macro. Table 12-4 E &f1Y C Specify the Macro ID as one. E &f0X C Start Macro Definition. E &a540h360V C Position logo at (540, 360) decipoints in the PCL coordinate system. E *t150R C Set graphics resolution to 150 dots-per-inch. E *r1A C E *b60W C E *b60W C EN Start raster image of logo.
Table 12-4 (continued) Fred, Texas 83707 Text E &a540h960V C Position first rule at (540, 960) decipoints. E *c10v4680H C Set rule height and width. E *c0P C Print the first rule. E &a540h980V C Position second rule at (540, 980) decipoints. E *c&zero;P C Print second rule. E &a54&zero;h12&zero;& C zero;V Position for first line of text at (540, 1200) decipoints. E C&f1X Stop Macro Definition. This macro now can be executed, called, or enabled for automatic overlay.
13 The PCL Print Model Introduction The Print Model feature allows images and characters to be filled with any of the printer’s predefined shading or cross-hatch patterns, or with a user-defined pattern. Images include any raster graphic, such as one created with PCL raster graphics commands (as described in Chapter 15, Raster Graphics); a rectangular fill area (as described in Chapter 14, PCL Rectangular Area Fill Graphics); or a character or characters selected from any font.
Pattern The design which is “painted” through the black (“1” bits) area of the source image onto the destination image. For patterns, the Print Model uses one of the printer’s internal predefined eight shading patterns (see Figure 13-4) or one of the six cross-hatch patterns (see Figure 13-5), or a user-defined pattern. Notes When printing a page, text and raster images are printed using the current pattern. The default current pattern is 100% black.
Pattern Transparency Mode The transparency or opaqueness of the white pixels in the pattern. When set to 0 (transparent), these pixels have no effect on the destination; when set to 1 (opaque), they are applied through the black pixels of the source pattern to the destination. Figure 13-2 Opaque and Transparency Modes Figure 13-3 illustrates the effects of the source and pattern transparency modes on the final image.
Figure 13-3 Effect of Transparency Modes on Images 13-4 The PCL Print Model EN
Command Sequence The following illustration shows the Print Model Command Sequence for selecting a current pattern and using it to fill a destination image. Table 13-1 Operation Comments • • Download Page Data Prior raster and character data downloaded to the page is considered destination image.
Table 13-1 (continued) • • End of Page Data Source Transparency Mode Command The Select Source Transparency Mode command sets the source image’s transparency mode to transparent or opaque. E C*v#N # Default Range =0 - Transparent 1 - Opaque = 0 = 0, 1 (other values cause the command to be ignored) With a transparency mode of “0” (transparent), the white regions of the source image are not be copied onto the destination.
Pattern Transparency Mode Command The Pattern Transparency Mode command sets the pattern’s transparency mode to transparent or opaque. E *v#O C # Default Range =0 - Transparent 1 - Opaque = 0 = 0, 1 (other values cause the command to be ignored) A transparency mode of “0” (transparent) means that the white regions of the pattern image are not copied onto the destination. A transparency mode of “1” (opaque) means that the white pixels in the pattern are applied directly onto the destination.
Pattern ID (Area Fill ID) Command The Pattern ID command (formerly called Area Fill ID) identifies the specific shading, cross-hatch, or user-defined pattern. (This command is also used for rectangular area fill. Refer to Chapter 14, PCL Rectangular Area Fill Graphics.
Notes This command is used for both the Select Pattern and Area Fill graphics (it is also described in Chapter 14, PCL Rectangular Area Fill Graphics). It is duplicated here for convenience. For user-defined patterns, this command, sent prior to downloading a user-defined pattern, assigns an ID pattern number to the downloaded pattern. (For more information, see “User- Defined Graphics,” later in this chapter.
Figure 13-4 Shading Patterns 13-10 The PCL Print Model EN
Figure 13-5 Cross-Hatch Patterns EN Pattern ID (Area Fill ID) Command 13-11
Select Current Pattern Command The Select Current Pattern command identifies the type of pattern to be applied onto the destination. E C*v#T # =0 - Solid black (default) 1 - Solid white 2 - Shading pattern 3 - Cross-hatch pattern 4 - User-defined pattern Default Range = 0 = 0 - 4 (values outside of range are ignored) This command selects which type of pattern is applied.
User-Defined Pattern Graphics In addition to the eight shading patterns and six cross-hatch patterns, users can design their own patterns (area fill). These user-defined patterns are downloaded to the printer and controlled using three new commands: z User-Defined Pattern EC*c#W [data] z Set Pattern Reference Point EC*p#R z Pattern Control EC*p#Q > User-Defined Pattern Implementation To create a user pattern, a user defines a binary raster data image as a base pattern.
Figure 13-7 Pattern Layout Across the Printable Area Pattern Reference Point The pattern reference point is a position on the logical page at which the base pattern is positioned for tiling. The upper left corner of the base pattern is positioned at this point (see ). The default pattern reference point is position 0,0. However, it is possible to set the pattern reference point to the current cursor position. This allows the pattern to be positioned or adjusted for fill areas.
Figure 13-8 Moving Pattern Reference Point for Pattern Filling EN User-Defined Pattern Graphics 13-15
User-Defined Pattern Command The User-Defined Pattern command provides the means for downloading the binary pattern data that defines the user pattern. E C * c # W [pattern data] # =Number of pattern data bytes Default Range = 0 = 0 - 32767 (values outside the range are ignored) The value field (#) identifies the number of pattern data bytes that follow the User-Defined Pattern command.
Table 13-4 Notes Resolution-Specified User-Defined Pattern Header 4 Height in Pixels 6 Width in Pixels 8 X Resolution 10 Y Resolution 12 Pattern image The Master X and Master Y Resolution fields can be used to specify 600 dpi resolution for a pattern originally designed at 300 dpi. However, a pattern which was designed at 600 dpi is not available for selection at 300 dpi resolution. Patterns are identified by some value (ID number). This is the current pattern ID number.
Reserved (Byte 3) This field, byte 3, is not currently used and must be set to 0. Height in Pixels (Bytes 4 and 5) This field, bytes 4 and 5, identifies the number of rows (height) of the pattern. Width in Pixels (Bytes 6 and 7) This field, bytes 6 and 7, identifies the number of pixels (width) of the pattern. Pattern Image This field contains the raster data for the pattern.
User-defined Pattern Example This example shows how the user-defined pattern command is used to create a user-defined patterns. For this example, a pattern of triangles is used. The first step is to design the base pattern triangle (in this case, using 64 bytes of data).
When using the 300 dpi User-Defined Pattern header (see Table 13-3). Set the eight bytes of header information to the following values: Byte 0 - Format = 0 (00 hex) Byte 1 - Continuation = 0 (00 hex) Byte 2 - Pixel Encoding = 1 (01 hex) Byte 3 - Reserved = 0 (00 hex) Byte 4/5 - Height in Pixels = 0 / 16 (00 / 10 hex) Byte 6/7 - Width in Pixels = 0 / 32 (00 / 20 hex) Byte eight begins the first bytes of binary data. The PCL code below downloads the user-defined pattern and assigns it an ID number of 3.
3 Send the pattern header and binary data: Table 13-6 00 FF 7F 3F 1F 0F 07 03 01 00 00 00 00 00 00 00 00 Notes 00 FF FF FF FF FF FF FF FF FF 7F 3F 1F 0F 07 03 01 01 FF FF FF FF FF FF FF FF FF FE FC F8 F0 E0 C0 80 00 00 10 00 20 FF FE FC F8 F0 E0 C0 80 00 00 00 00 00 00 00 00 There must be an even number of bytes in user-defined pattern data, hence the trailing zeros (“padding”) in the last eight data rows above.
Set Pattern Reference Point Command The Set Pattern Reference Point command causes the printer to tile patterns with respect to the current cursor position. This command also specifies whether the pattern rotates with the print direction or remains fixed. E C*p#R # =0 - Rotate patterns with print direction 1 - Keep patterns fixed Default Range = 0 = 0,1 (values outside the range are ignored) A value field of 0 rotates the patterns with changes in the print direction (see Print Direction command).
Pattern Control Command The Pattern Control command provides a means for manipulating user-defined patterns.
13-24 The PCL Print Model EN
14 PCL Rectangular Area Fill Graphics Introduction The PCL language includes commands for filling or shading rectangular areas on the page with pre-defined patterns, and allows creation and use of user-defined patterns. Pre-defined patterns include eight shading patterns and six cross-hatch patterns. Note User-defined patterns are not supported on all LaserJet family printers. Refer to the “PCL Feature Support Matrix” in the PCL 5 Comparison Guide.
Note 3 Specify width of rectangle (Horizontal Rectangle Size Command Decipoints=EC*c#H, or PCL Units=EC*c#A). 4 Specify height of rectangle (Vertical Rectangle Size Command Decipoints=EC*c#V, or PCL Units=EC*c#B). 5 Select specific shade, cross-hatch, or user-defined pattern (Pattern ID Command - EC*c#G - Chapter 13)1. 6 Fill rectangular area with pattern (Fill Rectangular Area Command - ECc#P).1 This ends the procedure and prints the patterned area.
Horizontal Rectangle Size (Decipoints) Command This Horizontal Rectangle Size command specifies the rectangle width in decipoints. E *c#H C # =Number of decipoints (1/720 inch) = 0 = 0 - 32767 (valid to 4 decimal places) Default Range The printer converts the specified width to printer dots by rounding up to an integral number of dots. For example, 5 decipoints, which corresponds to 2.08 dots in 300 dpi mode, is converted to 3 dots.
Vertical Rectangle Size (Decipoints) Command This Vertical Rectangle Size command specifies the rectangle height in decipoints. E C*c#V # Default Range =Number of decipoints (1/720 inch) = 0 = 0 - 32767 valid to 4 decimal places The printer converts the specified width to printer dots by rounding up to an integral number of dots. For example, 5 decipoints, which corresponds to 2.08 dots in 300 dpi mode, is converted to 3 dots.
Pattern ID (Area Fill ID) Command The Pattern ID command (formerly called Area Fill ID) identifies the specific shading, cross-hatch, or user-defined pattern (see Figure 14-2) to be used when filling a rectangular area.
There are six HP defined cross-hatch patterns. To specify a crosshatch pattern type, use a value between 1 and 6 to select a pattern as shown in Figure 14-2. For user-defined patterns, this command, sent prior to downloading a user-defined pattern, assigns an ID pattern number to the downloaded pattern. (For more information, see “User-defined Pattern Graphics,” in Chapter 13.
Figure 14-1 Shading Patterns EN Pattern ID (Area Fill ID) Command 14-7
Figure 14-2 Cross-hatch Patterns 14-8 PCL Rectangular Area Fill Graphics EN
Fill Rectangular Area Command This command fills (prints) a rectangular area of the specified width and height with the specified area fill. E *c#P C # Default Range =0 - Black fill (rule) 1 - Erase (white) fill 2 - Shaded fill 3 - Cross-hatch fill 4 - User-defined pattern fill 5 - Current pattern fill = 0 = 0 - 5 (values outside the range are ignored) Black fill — fills the rectangular area with black fill.
The upper left corner of the rectangular area is located at the cursor position when printing a rectangular area. After printing the rectangular area the cursor is returned to the upper left corner; the cursor position does not change positions as a result of printing a rectangular area. Rectangular areas are independent of the text area and perforation skip mode; these boundaries are ignored (rectangles are not clipped at these boundaries). Addressable rectangular areas are limited to the logical page.
Pattern Transparency for Rectangular Area Fill Pattern transparency, described in Chapter 13, under “Pattern Transparency Mode Command,” affects how a pattern is applied to the rectangular fill area. Rectangular areas are special case images for transparency mode. The pattern and pattern type are selected by the Pattern ID command (EC*c#G) and the Fill Rectangular Area (EC*c#P) command (described earlier in this chapter).
Figure 14-3 Effect of Transparency Modes on Rectangular Areas 14-12 PCL Rectangular Area Fill Graphics EN
Rectangular Area Fill Examples This section shows example usage of area fill commands to print pre-defined patterns as well as user-defined patterns. Pre-defined Pattern Examples Solid Fill (Black/White) To print a 900 by 1500 Unit black rule (3 inches by 5 inches at 300 units-per-inch), then white fill a small area inside the black rectangle, perform the following steps. 1 1. Position the cursor: E *p300x400Y C This moves the cursor to PCL Unit position (300, 400) within the PCL coordinate system. 2 2.
6 6. Specify the width and height for the smaller white fill rectangular area: E C*c300a600B 7 7. Select the white fill and print. E C*c1P Figure 14-4 Solid Fill Example Shaded Fill To print a 900 by 1500 Unit 25% shaded rectangle (3 inches by 5 inches at 300 units-per-inch), perform the following steps. 1 Position the cursor: E C*p300x400Y This moves the cursor to PCL Unit position (300, 400) within the PCL coordinate system.
3 Specify the height of the rectangle: E *c1500B C This sets the rectangle to 1500 PCL Units (5 inches at 300 units-per-inch). 4 Specify the Pattern ID: E *c25G C This sets the Pattern ID to 25.
Cross-hatch Fill To print a 900 by 1500 Unit rectangular area (3 inches by 5 inches at 300 units-per-inch), filled with a horizontal cross-hatch pattern, perform the following steps: 1. Position the cursor: E C*p300x400Y Moves the cursor to PCL Unit position (300,400) within the PCL coordinate systems. 2. Specify the width of the rectangle: E C*c900A Sets the rectangle width to 900 PCL Units (3 inches at 300 units-per-inch). 3.
This example prints the following: Figure 14-6 Patterned Fill Example User-defined Pattern Example This example shows how to print a user-defined pattern which has already been downloaded to the printer. For this example we will print the pattern of triangles which was downloaded in the example in Chapter 13, under “User-Defined Pattern Command.” The following commands define a 600 PCL Unit square rectangular area, select ID number 3, and print the user-defined pattern associated with that ID number.
Sets the rectangle width and height both to 600 PCL Units (2 x 2 inches at 300 Units/inch). 3 Specify the Pattern ID: E C*c3G Sets the Pattern ID to 3. 4 Print the user-defined pattern-filled area: E C*c5P This example prints as shown in Figure 14-7.
15 Raster Graphics Introduction A raster image is an image composed of dots. Pictures in newspapers or on television screens (also, a page printed by this printer) are examples of raster images. The PCL language includes commands for printing raster graphic images. These commands enable the LaserJet printer to receive binary data and print it as a raster image. The binary data used to create a raster image is divided into dot rows: a row describes a one-dot-high strip of the image.
several binary data compression methods, and additional reduction techniques associated with the raster area feature (see Figure 15-2). Figure 15-2 Raster Area Data compression methods include: run-length encoding, tagged image file format (TIFF), delta row, and adaptive compression. These techniques are described in detail later in this section, under the Set Compression Method command.
The final data reduction technique provided by the raster area involves the printer’s ability to fill in trailing zeros to the edge of the raster area. Any zeros following the last “1“ in the raster row to the edge of the picture area need not be sent. The printer automatically fills them. This technique eliminates the need to transmit raster data rows that are all the same length, as required in a raster image which does not use the raster area feature. The raster area represents a boundary.
Raster Graphics Command Sequence PCL raster commands include: Start Raster Graphics and End Raster Graphics commands, Transfer Raster Data by Row, Raster Compression, Raster Presentation, Raster Resolution, Raster Height and Raster Width (which define the raster area), and Raster Y Offset commands.
Raster Presentation, Raster Resolution, Raster Height, Raster Width, and Raster Compression are all true modes. Once specified, the printer remains in that mode unless explicitly changed by issuing the command again, or reset to default values by a soft reset, self test, font printout, or power cycle. Note EN Only raster data appearing within the intersection of the logical page, the printable area, the raster width, and height is printed.
Raster Graphics Resolution Command Raster graphics can be printed at various resolutions. This command designates the resolution of subsequent raster data transfers in dots-per inch. E C*t#R # Default Range = 75 - 75 dots-per-inch 100 - 100 dots-per-inch 150 - 150 dots-per-inch 200 - 200 dots-per-inch1 300 - 300 dots-per-inch 600 - 600 dots-per-inch = 75 = 75, 100, 150, 200, 300, 600 This command must be sent prior to the start graphics command. The factory default resolution is 75 dots-per-inch.
Figure 15-3 Raster Graphics Expansion - at 300 dpi Note Rectangular area fills and character data are not affected by changes in resolution. Rectangular Area fills and character data always print at the maximum resolution, regardless of the resolution setting. When configured for 600 dpi resolution, the printer automatically expands raster graphics transferred at resolutions less than 600 dots-per-inch to 600 dots-per-inch during printing.
Raster Graphics Presentation Mode Command The Raster Graphics Presentation command specifies the orientation of the raster image on the logical page. E C*r#F # Default Range =0 - Raster image prints in orientation of logical page 3 - Raster image prints along the width of the physical page = 3 = 0, 3 A value of 0 indicates that a raster row ‘will be printed in the positive X-direction of the PCL coordinate system. (The print direction translates the PCL coordinate system.
Table 15-2 (continued) 3 landscape 50 dots in from the logical page top bound 3 reverse landscape 50 dots in from the logical page top bound Figure 15-5 Raster Graphics Presentation Mode for Portrait Orientation EN Raster Graphics Presentation Mode Command 15-9
Figure 15-6 Raster Graphics Presentation Mode for Landscape Orientation 15-10 Raster Graphics EN
Raster Height Command The Raster Height command specifies the height in raster rows of the raster area. Height is the direction perpendicular to the direction that raster rows are laid down, hence, height is subject to the current raster presentation mode and print direction (see Figure 15-7).
Upon receiving an End Raster Graphics (EC*rC) command, the cursor position is set to the left graphics margin of the next raster row after the raster height boundary.
Raster Width Command The Raster Width command specifies the width in pixels of the raster area. Width is in the direction that the raster rows are laid down, hence, width is subject to the current raster presentation mode and print direction (see Figure 15-8).
Figure 15-8 Maximum Raster Width Start Raster Graphics Command The Start Raster Graphics command identifies the beginning of the raster data and also specifies the left graphics margin. E C*r#A # Default Range =0- Start graphics at default left graphics margin X-position 0). 1 - Start graphics at current cursor position (current X-position). = 0 = 0, 1 (values outside the range default to 0) A value of 0 specifies that the left graphics margin is at the default left margin of the page (X-position 0).
Once in Raster Graphics Mode, PCL commands and text imply an End Raster Graphics (EC*rC) except for the following commands: z Transfer Raster Data z Set Raster Compression Method z Raster Y Offset In addition, the following commands are ignored (i.e.
Set Compression Method Command The Set Compression Method command allows you to code raster data in one of four compressed formats: Run-length encoding, tagged imaged file format (TIFF) rev. 4.0, delta row compression, and adaptive compression. The choice of compression methods affects both the amount of code needed to generate a raster graphic image and the efficiency with which the image is printed.
Tagged Image File Format Encoding (Method 2) Tagged image file format encoding interprets raster data as TIFF “Packbits.” This format combines features of methods 0 and 1. A control byte precedes the raster data (pattern bytes). The control byte identifies whether the pattern byte(s) represent a byte that is to be repeated some number of times (up to 127), or represent some number of bytes (up to 127) which are to be printed as is (literal).
The range of numbers for the control byte is shown below. Table 15-3 Literal Pattern Values # of Bytes Binary value Decimal value 1 0000 0000 1 to to to 127 0111 1111 127 Table 15-4 No Operation Value NOP value Binary value Decimal value 128 (-128) 1000 000 128 Table 15-5 Repeated Pattern Values # of Repetitions Binary value1 Decimal value 1 (-1) 1111 1111 255 to to to 127 (-127) 1000 0001 129 1.
TIFF encoding also allows you to include a non-operative (NOP) control byte, represented by the value –128. This byte is ignored, and the subsequent byte is treated as the new control byte. Note It is more efficient to code two consecutive identical bytes as a repeated byte. If these bytes are preceded and followed by literal bytes, however, it is more efficient to code the entire group as literal bytes.
TIFF Encoding E C*r1A E E C*b2m6W(-3)U(0)A(-1)T or C*b2m6W(-3)U(2)ATT E C*rC In the TIFF encoding example above, parenthetical expressions are used to identify control bytes. For example, the byte (-3) is shown to represent the control byte for a repetition (minus value) of 3. The actual value for this position is the decimal value 253. Additional “encoded” control bytes in this sequence include: (0) for decimal 0, (-1) for decimal 255, and (2) for decimal 2.
Table 15-7 Command Byte 7 5 Number of bytes to replace (1-8) 4 0 Relative offset from last untreated byte If more than eight replacement (delta) bytes are needed, additional command byte/replacement bytes may be added, as shown below: E C*3m#W [(Command Byte)(1 to 8 Replacement Bytes)][(Command Byte)(1 to 8 Replacement Bytes)]. . . In the command byte, the upper three bits identify the number of replacement (delta) bytes (which can be 1 to 8 bytes).
As mentioned, the offset is contained in the lower five bits of the command byte allows for offset values from 0 to 31. Compression mode allows offsets larger than 31 bytes as follows: z An offset value of 0-30 indicates that the replacement bytes are offset from the 1st byte to the 31st byte. z A value of 31 indicates that the next byte following the command byte is an additional offset byte which adds to the first (32) offset value. This allows offset values larger than 31.
Repeating a Row E C*b0W When using the delta compression method, it is possible to repeat or copy the previous raster row using the Raster Data Transfer command. This is accomplished by setting the Raster Data Transfer command, value field, to zero. Printing A Zeroed Row (Setting the Seed Row to Zero) E C*b1Y It is possible to print a row of all zeros using the Raster Y-Offset command. Sending a Raster Y Offset command, with a value field of 1, sets the seed row to zero and prints the zeroed row.
Example: Delta Row Compression The following example demonstrates how to compress the following data using the delta row compression. (The bytes highlighted in italic type indicate those bytes needing replacement — those bytes that are different from the previous row, the seed row.) Table 15-8 Byte No.
Adaptive Compression (Method 5) Adaptive compression enables the combined use of any of the four previous compression methods (0 through 3), and it includes the ability to print empty (all zeros) rows or to duplicate rows. Adaptive compression interprets a raster image as a block of raster data rather than as individual rows.
For command byte values 0 - 3, the two <# of bytes/rows> bytes specify the number of bytes (row length) for the row. For command byte values 4 and 5, these bytes identify the number of empty or duplicate rows to print. The maximum value for these two bytes is 65,535; however, the image is clipped to the logical page. Thus, the value of these bytes should not exceed the maximum number of bytes/rows that can be printed on the current logical page size.
Adaptive Compression Operation Hints Note EN Some HP LaserJet printers perform internal compression techniques to support full-page graphics. Refer to Chapter 1 of the PCL 5 Comparison Guide for specifics. z The compression methods cannot be mixed within one raster row. A raster row must be compressed using only one method. z The cursor position is updated with each row of the raster block. The cursor position is also incremented when a block count of less than 3 is sent.
z For method 3 - Since delta row compression requires that the seed row be available whenever raster graphics mode is entered, the seed row is initialized to zeros upon raster graphics mode entry (EC*r#A). The seed row is also initialized upon receipt and completion of each raster block. z For method 3 - If the row length terminates the data before the control byte value is satisfied (literal byte count greater than row length), the data following the control byte (if any) is printed as text.
Transfer Raster Data Command The Transfer Raster Data command is used to transfer a row of raster data to the printer. E *b#W [ raster data] C Default Range = N/A = 0 - 32767 The value field (#) identifies the number of bytes in the raster row. These bytes are interpreted as one row of raster graphics data that is printed at the current Y position at the left raster graphics margin.
Notes If the last byte indicated by the value field in the Transfer Raster Data command is a control byte, that byte is ignored. If a Transfer Raster Data command is received without an accompanying Start Raster Graphics command, any preceding start raster values are used (such as left graphics margin, raster height and width, etc.). End Raster Graphics Command The End Raster Graphics command signifies the end of a raster graphic data transfer.
Raster Graphics Example To transfer an unencoded raster graphic image (see Figure 15-11) in the shape of an arrow, perform the following steps: Table 15-10 1. Position the cursor: E *p300x400 C Y This moves the cursor to PCL Unit position (300, 400) within the PCL coordinate system. 2. Specify the raster graphics resolution: E *t75R C This sets the raster graphics resolution to 75 dots-per-inch. 3.
Table 15-11 Example of Raster Graphic Image Data (continued) 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 00000000 00000000 00000000 00000000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 111
Figure 15-11Example of Raster Graphic Image Data EN Raster Graphics Example 15-33
15-34 Raster Graphics EN
16 Status Readback Introduction This chapter describes the PCL status readback features. PCL status is requested from the printer with the commands described in this chapter. Following a status request, the printer generates a status response. This response consists of ASCII data which is sent directly from the printer, through the I/O, back to the host.
z Flush All Pages Command z Echo Command z Status Readback Programming Hints For status readback to work, the host system must contain a bi-directional driver to receive status response data. In network operations, some printing environments do not support bi-directional communication, such as many printer sharing devices which spool data, and some network operating systems.
Table 16-1 Memory Status Request Example (continued) Status response sent from printer to host PCL INFO MEMORY TOTAL=100000 LARGEST=25000 Entity Status It is possible to request status for the printer’s entities. An entity is a font, symbol set, macro, or user-defined pattern stored in the printer. Each individual entity request is limited to one specific entity, and is further limited to a specific location.
A basic entity status request is shown in the example below. This example identifies a status request for downloaded permanent fonts. The example also includes a status readback response at the bottom. Note that this example shows only one possible request/response; for more detailed information, refer to the status readback command descriptions provided later in this chapter.
Status Response When the printer receives a status request (command), it processes that request and forms the response data. This data is then stored in an I/O status buffer. The response is saved in this buffer until it is either read (by any user) or the printer is turned off.
Status Response Syntax All status responses start with the letters “PCL” followed by a Carriage Return control code (decimal 13; ) and a Line Feed control code (decimal 10; ). In addition, each remaining line of the response is terminated by a Carriage Return and Line Feed control code. Finally, status responses are terminated by a Form Feed control code (decimal 12; ). The basic syntax for the status response is shown below.
PCL INFO FONTS SELECT=“(8U(s0p10.00h12.00v0s0b3T” SELECT=“(0N(s0p16.67h8.5v0s0b0T” SELECT=“(s1p__v1s0b4101T(78X” SYMBOLSETS=“0D,0I,0N,0S,0U,1E,1F,1G,...” SELECT=“(8U(s1p__v0s3b4148T” Notes In the example listings, “,” “,” and “” identify the Carriage Return (decimal 13), Line Feed (decimal 10), and Form Feed (decimal 12) control codes.
Set Status Readback Location Type Command The Set Location Type command sets the status location type to the specified value. Location type is used in conjunction with the location unit to identify an entity location for a status request (Inquire Status Readback Entity command).
Set Status Readback Location Unit Command The Set Location Unit command sets the status location unit to the specified value. Location unit is used in conjunction with the location type to identify an entity location for a status request (Inquire Status Readback Entity command). Note that the unit value is interpreted differently, depending on the location type specified.
A value of 0 indicates all units of the location type. A printer reset (ECE) returns the location unit to its default value, 0. The printer retains the location unit setting. If this command is not sent to change the setting for an entity request, then the existing location unit setting is used. Note The location type and unit may be set in any order. Invalid combinations are not determined until the Inquire Entity command is received.
Entity Status Responses The status response for an Inquire Status Readback Entity command varies depending on the type of entity requested. The status responses for font, font extended, macro, user-defined pattern, and symbol set are described below. Font Response The status response information returned for font (inquire entity value field 0) varies. Depending on whether the printer’s font is a bitmap, unbound scalable, or bound scalable, different keywords are returned.
As mentioned, variations in the font response occur as a result of the font being a bitmap, bound scalable, unbound scalable, soft (downloaded) font, or the location type set to 1 (currently selected). These variations include slight differences in the information included in the “SELECT=” line, with the addition of different keywords (“SYMBOLSETS=” “LOCTYPE=” and “LOCUNIT=”). These variations are described in detail in the following paragraphs.
Unbound Scalable Fonts For unbound fonts, since multiple symbol sets can be associated with an unbound font, the “SYMBOLSETS=” keyword is added to list the available symbol sets and the symbol set sequence is no longer present in the “SELECT=” line. For example, the printer’s internal unbound scalable Courier (medium, fixed spaced) font and CG Times (bold italic, proportional spaced) fonts would be returned as shown below. PCL INFO FONTS SELECT=“(s0p__h0s0b4099T” SYMBOLSETS=“0D,0I,0N,0S,0U,1E,1F,1G,...
z For all fonts, if the font is a secondary font, then the “(“ characters are replaced by ”)” characters in the “SELECT=” line. “LOCTYPE=” identifies the location type of the currently selected font. The value returned corresponds to the value field of the Set Status Readback Type command. “LOCUNIT=” identifies the location unit of the currently selected font. The value returned corresponds to the value field of the Set Status Readback Unit command.
Font Extended Response The font extended response (inquire entity value field 4) provides a way to return the name and internal ID number of the font, as well as the “SELECT=” line. It is the same as a font status response (inquire entity value field 1), in that “SELECT=,” “SYMBOLSETS=,” “LOCTYPE=,” and “LOCUNIT=” are returned in the same manner. They are not re-described here; refer to the “Font Response” section for a description of their operation.
“NAME=” is returned for font extended status requests only. It identifies the name of the font, such as, Courier, Times Roman, Univers, etc., and its treatment (such as BdIt - bold italic) as listed in the font printout. For example, the font extended response for the printer’s internal bitmap Line Printer font and a downloaded unbound CG Palacio temporary font would be returned as shown below. PCL INFO FONTS EXTENDED SELECT=“(8U(s0p10.00h12.
A macro status response might appear as shown below. PCL INFO MACROS IDLIST=“1,3,8,29,32” User-Defined Pattern Response The status response for user-defined patterns (inquire entity value field 2) lists all of the user-defined pattern IDs (“IDLIST=”) for the patterns in the specified location. A user-defined pattern response might appear as shown below. PCL INFO PATTERNS IDLIST=“1,2,9,13,27,456” If the location type is set to 1 (currently selected), then “LOCTYPE=” and “LOCUNIT=” lines are added.
Symbol Set Response The response for symbol sets (inquire entity value field 3) lists all of the symbol set IDs (“IDLIST=”) for all of the symbol sets that can be bound to unbound scalable fonts in the specified location (type and unit). A symbol set response might appear as shown below. PCL INFO SYMBOLSETS IDLIST=“0U,2K,8M,8U,11U” Notes Status location type 1 (currently selected) is an invalid location for unbound font symbol sets and returns an error (“ERROR=NONE”).
Entity Error Codes If you request out-of-range values in the command value fields, or if the entity is unsupported or does not exist, or if the request is inappropriate, the printer responds with one of four possible errors: z Invalid Entity z Invalid Location z None z Internal Error ERROR=INVALID ENTITY If the entity type specified in the escape sequence is out of range or unsupported, an invalid entity error is returned.
ERROR=NONE If the entity type and location are valid, but there are no entities of the specified type in that location, or if the type is inappropriate for the specified entity (internal user-defined pattern or currently selected macro), then an error response is generated.
Free Space Command The Free Space command returns the amount of available memory. This response returns two values: the total available memory, and the largest available block of memory (refer to the “Memory Status Response” section later in this chapter for additional information). E *s1M C If a value other than 1 is sent, this command returns an error (“ERROR = INVALID UNIT,” refer to “Memory Error Response” section later in this chapter for additional information).
If you determine there is insufficient memory to hold the data to be downloaded, some action is required. One method to make more memory available is to send the Flush All Pages command. This causes the printer to clear (process) the current page data from memory without accepting any new data for processing (refer to the “Flush All Pages Command” described later in this section). Another, more comprehensive method to clear memory is to send the Printer Reset (ECE) command.
“LARGEST=” identifies the largest continuous block of available memory (in bytes). An example response is shown below: PCL INFO MEMORY TOTAL=100000 LARGEST=25000 The above example indicates that the printer has 100,000 bytes of available memory and the largest continuous block is 25,000 bytes. Memory Error Response If the Free Memory command value field is out of range (not 1), then the memory status response returns an invalid unit error.
Flush All Pages Command The Flush All Pages command suspends accepting input data until all pages currently in the printer are printed. This gives the printer time to clear some memory. E C&r#F # Default Range =0- Flush all complete pages 1 - Flush all pages = 0 = 0-1 A value of 0 indicates that only complete pages are to be processed. If a partial page exists, it is not processed. A value of 1 indicates that all page data including the partial page will be processed.
Echo Command The Echo command echoes its value field (in ASCII format) back to the host. E *s#X C # Default Range =Echo value (ASCII) = 0 = –32767 to 32767 If multiple users are requesting status, it can be difficult to distinguish one user’s status response from another. The Echo command provides the means to label status responses. Since the user-selected value for the value field is returned, this command can be used as a user identification mark or “place holder.
If the application sends the Echo command and Free Space command, the printer returns the response to the first Echo command and Free Space command, along with the response to the second request. The application will assume that the response received is the response to its last request. If the application uses random numbers in the Echo command, this type of mix-up will not occur.
Status Readback Programming Hints The following hints can assist in using the status readback feature. z PCL status readback is useful during the development of applications. Status readback allows you to determine that fonts, macros, user-defined patterns, and symbol set resources you have downloaded were accepted by the printer. z If the printer does not contain sufficient memory to accept a downloaded entity, the printer discards the data.
16-28 Status Readback EN
17 An Introduction to HP-GL/2 Vector Graphics The PCL 5 printer provides the ability to print vector graphics using the HP-GL/2 graphics language. HP-GL/2 graphics may be created within application software, or imported from existing applications. For various types of images (many technical drawings and business graphics, for example), it is advantageous to use vector graphics instead of raster graphics. The advantages include faster I/O transfer of large images and smaller disk storage requirements.
Learning HP-GL/2 Read through this chapter and Chapter 18 for a general overview of the HP-GL/2 language and its relationship to the PCL printer language. Then, flip through the other HP-GL/2 chapters until you see an example that interests you or fits your objective. Read through the examples and try printing them using your choice of programming languages.
HP-GL/2 Commands and Syntax There are two classes of commands used to print vector graphics: PCL printer language commands and HP-GL/2 commands. As the name implies, the PCL printer language commands are used when in the PCL printer language mode. They define the area on the page where HP-GL/2 graphics are printed and provide a means to enter HP-GL/2 mode. The HP-GL/2 commands are used within HP-GL/2 mode. They define the image that is printed, and allow you to return to the PCL printer language mode.
Table 17-2 The HP-GL/2 Commands by Group (2 of 5) VECTOR GROUP AA Arc Absolute AR Arc Relative AT Absolute Arc Three Point BR Bezier Relative BZ Bezier Absolute CI Circle PA Plot Absolute PD Pen Down PE Polyline Encoded PR Plot Relative PU Pen Up RT Relative Arc Three Point Table 17-3 The HP-GL/2 Commands by Group (3 of 5) POLYGON GROUP EA Edge Rectangle Absolute EP Edge Polygon ER Edge Rectangle Relative EW Edge Wedge FP Fill Polygon PM Polygon Mode RA Fill Rectangl
Table 17-4 The HP-GL/2 Commands by Group (4 of 5) CHARACTER GROUP AD Alternate Font Definition CF Character Fill Mode CP Character Plot DI Absolute Direction DR Relative Direction DT Define Label Terminator DV Define Variable Text Path ES Extra Space FI1 Select Primary Font FN1 Select Secondary Font LB Label LO Label Origin SA Select Alternate Font SB Scalable or Bitmap Fonts SD Standard Font Definition SI Absolute Character Size SL Character Slant SR Relative Character
Table 17-5 The HP-GL/2 Commands by Group (5 of 5) LINE AND FILL ATTRIBUTES GROUP AC Anchor Corner FT Fill Type LA Line Attributes LT Line Type PW Pen Width RF Raster Fill Definition SM Symbol Mode SP Select Pen SV1 Screened Vectors TR1 Transparency Mode UL User-defined Line Type WU Pen Width Unit Selection 1. These commands are part of the Palette Extensions to HP-GL/2.
Figure 17-1 Typical HP-GL/2 Command z Mnemonic--The two-letter mnemonic reminds you of the command’s function. The mnemonic can be uppercase or lowercase. z Parameter(s)--Some commands have no parameters; for those commands which have them, parameters can be either required or optional (as indicated in the description of that command). z Separator(s)--When you use parameters, you must separate them with a comma or space, or in the case of a numeric parameter, with a + or - sign.
The next section explains how the syntax of individual commands is presented. Notations Used to Express Syntax The following describes the notations used in the syntax section of each command description: Mnemonic For readability, the mnemonic is shown in uppercase and separated from the parameters and/or terminator. parameters Parameters are shown in italic. [] Parameters in square brackets are optional. [param1,param2...[,param1,param2]] These optional parameters must be paired. params...
Note Remember that while X,Y coordinates are shown in parentheses in text [for example (3,4) or (0,0)], the parentheses are not part of the syntax. Do not enter these parentheses in your commands. ; iCommand terminator. In most HP-GL/2 commands, a semicolon is optional, and is shown in parentheses in most command syntax. Notes Three exceptions to the optional use of the semicolon as a command terminator occur in the following commands: Polyline Encoded (PE), Label (LB), and Comment (CO).
If you omit the second parameter you must also omit the third parameter, as shown below: LT6 The printer uses the most recently specified pattern length and mode. If you have not specified a length or mode since sending a Default Values (DF) or Initialize (IN) command, the printer uses the parameter’s defaults.
4 Clamped Real—A number with an integer portion from –32,768 to 32,767; you are assured of at least 6 significant digits (including integer and fractional portion). You may omit the decimal point when no decimal fraction is specified. Sending a number outside this range does not cause an error, but the number is “clamped” to the limits of the range. For example, the printer treats all numbers above 32,767 as 32,767. Certain commands have parameters which are restricted to a smaller range.
Notes When LOST mode is entered, the pen is raised and the following commands are ignored: AA, AR, AT, CI, CP, EA, ER, EW, LB, PE, PM, PR, RA, RR, RT, and WG. The commands allowed in LOST mode are: AC, AD, CF, CO, DF, DI, DR, DT, DV, ES, FT, IN, IP, IR, IW, LA, LO, LT, PA, PD, PG, PU, PW, RF, RO, RP, SA, SB, SC, SD, SI, SL, SM, SP, SR, SS, TD, UL, WU, and the PM1/PM2 forms of PM.
Using HP-GL/2 With Programming Languages The HP-GL/2 examples included in this manual are given in a “generic” format (they show the commands required to perform a specific function but usually do not use a specific programming language). In most cases, the commands are accompanied by a brief description of the command being used. To see how HP-GL/2 commands are used in BASIC and the C programming language, see the following examples.
Example:C Programming Language This example uses the C programming language to print the same three lines shown on the previous page. Table 17-6 #include
The HP-GL/2 Coordinate System Both PCL and HP-GL/2 use a Cartesian Coordinate System. The Cartesian coordinate system is a grid formed by two perpendicular axes, usually called the X-axis and Y-axis (refer to Figure 17-4). The intersection of the axes is called the origin of the system and has a location of (0,0). The default HP-GL/2 coordinate system is different than the PCL coordinate system; +Y is down in PCL and up in HP-GL/2.
Study Figure 17-4 to locate these points: (0,0); (-2,2); (6,2); (6,3); (10,0); (6,-3); (6,-2); (-2,-2); (0,0). Draw a straight line between each point in the order listed. (You should have drawn an arrow.) This is a simple demonstration of defining a vector image when in HP-GL/2 mode. Note To specify a point when programming an application, you must always give a complete X,Y coordinate pair; the X coordinate is first and the Y coordinate second.
HP-GL/2 & PCL Orientation Interactions The relationship between the orientation of the HP-GL/2 coordinate system and the PCL coordinate system is important. Figure 17-6 illustrates this relationship for the default HP-GL/2 orientation (RO 0) and the PCL logical page orientation. As shown in the illustration, in the default HP-GL/2 orientation, the origin of the HP-GL/2 coordinate system defaults to the lower-left corner of the PCL Picture Frame.
Figure 17-7 Modifying HP-GL/2 Orientation on a Portrait Page 17-18 An Introduction to HP-GL/2 Vector Graphics EN
The Vector Graphics Limits The area on the page where a vector graphics image can be printed is determined by the intersection of the following four boundaries: z Hard-clip Limits z Soft-clip Window z PCL Logical Page z PCL Picture Frame The hard-clip limit refers to the boundaries resulting from the physical limits of the printer (in PCL mode, this is referred to as the printable area). The soft-clip limit refers to the area defined using the HP-GL/2 Input Window (IW) command.
HP-GL/2 Units of Measure In HP-GL/2 mode, you can measure along the X,Y axes and express coordinates using two types of units: plotter units and user-units. Plotter Units One plotter unit equals 0.025 mm. When specifying distances in plotter units, the printer converts the number of plotter units to equivalent dot coordinates before printing. Under default conditions, the printer uses plotter units. The following table lists equivalent measurements for plotter units.
Pen Status and Location Since printing vector graphics has traditionally been performed with plotters, the terms pen and pen position are used to described the HP-GL/2 cursor, the current active position (CAP) when in HP-GL/2 mode. Like a physical pen, this imaginary pen must be selected if you want to draw images. Commands such as Pen Up (PU) or Pen Down (PD), and phrases such as “current pen position” or “moving the pen” apply to the imaginary pen just as they would a physical pen on a plotter.
Table 17-8 Notes Commands That Include an Automatic Pen Down Command Group CI Circle The Vector Group EA Edge Rectangle Absolute The Polygon Group EP Edge Polygon ER Edge Rectangle Relative EW Edge Wedge FP Fill Polygon RA Fill Rectangle Absolute RR Fill Rectangle Relative WG Fill Wedge LB Label The Character Group SM Symbol Mode The Line and Fill Attributes Group Whenever the printer receives a Pen Down command, it produces a dot at the current pen location.
Pen Location Pen location refers to the X,Y coordinates of the current active position (CAP — the point at which the next HP-GL/2 command begins). Most commands, when completed, update the pen location. The next command then begins at that location. Some commands do not update the current pen location. The definition of each command tells you whether the current pen location is updated or restored. Use the Pen Up (PU) command with the desired X,Y coordinates to lift the pen and move it to a new location.
Scaling When you scale a drawing, you define your own units of measurement instead of using plotter units; the printer converts your units (user-units) to dot positions for placing the image on the page. Scaling allows control of the printer using units that are easy for you to work with. For example, you can scale your drawing to divide the drawing area into 100 squares. As you plan the drawing, you can think in terms of 100 squares rather than plotter units.
Absolute and Relative Pen Movement The Plot Absolute (PA) and Plot Relative (PR) commands allow you to set whether you want to draw using absolute or relative “pen” moves. Absolute pen movement uses X,Y coordinates to specify an exact, fixed point relative to the origin (0,0). In Figure 17-9, the coordinates (3,8), (5,4), and (8,1) are always in the same place with respect to the origin, no matter where the pen is when the coordinates are issued.
Figure 17-10Relative Coordinates Relative movement is useful in many applications where you know the dimensions of the shape you want, but do not want to calculate the absolute coordinates. For example, if you want a box 4 X-units by 8 Y-units, you can use the Edge Rectangle Relative (ER) command to draw the box without having to calculate the absolute coordinates of the opposite corner.
18 The Picture Frame Introduction When importing an existing HP-GL/2 file, or creating an HP-GL/2 image within an application, you use several PCL commands to set up the picture frame size, choose the picture frame location, and enter and exit HP-GL/2 mode. This chapter explains these PCL commands. The following terms are used in this discussion: Picture presentation directives are a group of PCL commands which: z Provide the means to enter and exit HP-GL/2 context.
Defining the Image Area(PCL Picture Frame) There is a group of commands that allows you to specify an area on the page for placing an HP-GL/2 graphic image. These commands are the Picture Presentation Directives and are used to define a bounding rectangle to contain the HP-GL/2 image. Figure 18-1 illustrates the Picture Presentation Directives.
Automatically Adjusting Image Size to Fit the PCL Picture Frame FrameImported HP-GL/2 drawings can be adjusted automatically to fit the size of the PCL Picture Frame without changing the locations of P1 and P2 (in Scale mode, as described earlier). This is called picture frame scaling. When using picture frame scaling, specify the HP-GL/2 plot size unless the drawing is page size-independent (described below).
If a drawing does not meet the above criteria and the drawing is not the same size as the picture frame, the HP-GL/2 plot size must be specified to accomplish the desired scaling. If it is not specified, the image is clipped to the effective window and no scaling occurs. Note The above bulleted items are required for automatic scaling when the picture frame size changes, without specifying the HP-GL/2 plot size.
Typical HP-GL/2 PlotCommand Sequence Before we discuss the actual commands and how they operate, we will demonstrate the general sequence in which these commands are used to print HP-GL/2 files. The following command sequence is usually followed when creating HP-GL/2 images: Note EN z Send the job control and page control commands, and any other PCL commands that you wish to send before drawing the HP-GL/2 image. (See Chapters 3, 4, and 5 for job control and page control information.
Table 18-1 Example: Creating and Using a PCL Picture Frame E E C Reset the printer. E C&l2A Set the page size to letter. E C&l0O Specify portrait orientation. E C*c3060x3960Y Specify a 4.25-inch wide by 5.5-inch high PCL Picture Frame (4.25in. x 720 decipoints/in. = 3060 decipoints; 5.5in. x 720 decipoints/in. = 3960 decipoints). E C*p565x600Y Move the cursor to the point you desire as the picture frame anchor point. E C*c0T Set the picture frame anchor point to the current cursor position.
Table 18-1 Example: Creating and Using a PCL Picture Frame IN;SP1;PU50,50; Send the HP-GL/2 commands you desire to send. (The IN command defaults the pen position to the HP-GL/2 origin, the lower-left corner of the PCL Picture Frame.) E %1A C Enter the PCL mode with the cursor at the current HP-GL/2 pen position. TextTextText Send some text or more PCL commands. E E C Reset the printer to end the job and eject a page.
Note If you have a page size-independent HP-GL/2 image, there is no need to set plot size, otherwise it is good practice to set plot size. The commands that allow you to set up a PCL Picture Frame and enter/exit HP-GL/2 mode are discussed in detail in the rest of this chapter. By reading the following command descriptions, you can see how changing command parameters can affect your printed output.
Example: To specify a horizontal picture frame size of 5 inches, send: E *c3600X C (5 in. x 720 decipoints/in. = 3600 decipoints). Vertical Picture Frame Size (Decipoints) This PCL command specifies the vertical dimension of the window used for printing an HP-GL/2 plot.
Set Picture Frame Anchor Point This command sets the location of the PCL Picture Frame anchor point to the PCL cursor position. E C*c0T Default Range = 0 = 0 The position of the picture frame anchor point defines the location of the upper left corner of the PCL Picture Frame. The “upper left” refers to the corner for which X and Y coordinates are minimized when the print direction is 0. A parameter value of zero (EC*c0T) specifies that the picture frame anchor point should be set to the cursor position.
HP-GL/2 Plot Horizontal Size This command specifies the horizontal size of the HP-GL/2 drawing being imported. E *c#K C # Default Range =The horizontal size in inches = width of the currently selected picture frame = 0 to 32767 (valid to 4 decimal places) The horizontal HP-GL/2 plot size determines the horizontal scaling factor used to fit the drawing into the PCL Picture Frame.
HP-GL/2 Plot Vertical Size This command specifies the vertical size of the HP-GL/2 drawing being imported. E C*c#L # Default Range =The vertical size in inches = height of the currently selected picture frame = 0 to 32767 (valid to 4 decimal places) The vertical HP-GL/2 plot size value determines the vertical scaling factor used to fit the drawing into the PCL Picture Frame.
Enter HP-GL/2 Mode This command causes the printer to interpret subsequent commands as HP-GL/2 commands, instead of PCL printer language commands.
Enter PCL Mode This command causes the printer to return to PCL mode from HP-GL/2 mode. E C%#A # Default Range =0— Position cursor at previous PCL cursor position. 1 — Position cursor at current HP-GL/2 pen position. = 0 = 0, 1 (even values are mapped to 0; odd values are mapped to 1) Sending the Enter PCL Mode command causes the printer to stop interpreting the incoming data as HP-GL/2 commands and to begin interpreting the data as PCL commands.
Default Settings When you enter HP-GL/2 mode, most vector graphics variables retain their previous HP-GL/2 value.
As the printer enters HP-GL/2 mode for the first time since ECE, power-on, or control panel reset, all HP-GL/2 variables are at their default settings, as determined by the Picture Presentation Directives (the PCL Picture Frame Size, Picture Frame Anchor Point, and HP-GL/2 Plot Size commands). Table 18-2 Example: Creating a Simple Drawing E CE Reset the printer. E C&&l2A Set the page size to letter. E C&&l0O Specify portrait orientation.
Table 18-2 EN Example: Creating a Simple Drawing (continued) E %1B C Enter HP-GL/2 mode with the cursor (pen) at the PCL cursor position. In this example, the cursor is at the picture frame anchor point (450 dots [1.5 in.] down from the top margin and 675 dots [2.25 in.] to the right of the left logical page boundary). IN;SP1; Initialize HP-GL/2 command values and select pen number 1 (black).
Table 18-2 Note Example: Creating a Simple Drawing (continued) PU50,50;CI25; Lift the pen and move to the center of the PCL Picture Frame (50,50); draw a circle with a radius that is 25% of the picture frame width. E C%1A Enter the PCL mode with the cursor at the current HP-GL/2 pen position. E CE Reset the printer to end the job and eject a page. Any line drawn along the border of the effective window will cause the line to be clipped, producing a line width one-half of the defined pen width.
19 The Configuration and Status Group Introduction The configuration and status group commands help you: z Establish default conditions and values for HP-GL/2 features. z Scale images in the dimensional units you want to use. z Enlarge/reduce images for different media sizes. z Establish a window (soft-clip limits). z Draw equal-sized and mirror-imaged drawings. z Rotate the HP-GL/2 coordinate system. z Add comments to your HP-GL/2 command sequence.
Table 19-1 The Configuration and Status Group Commands Command Summary CO, Comment Allows comments to be included in an HP-GL/2 command sequence. DF, Default Sets most programmable HP-GL/2 features to their default conditions. IN,Initialize Sets all programmable HP-GL/2 features to their default conditions. IP, Input P1 and P2 Establishes new or default locations for the scaling points P1 and P2.
Establishing Default Conditions Whether you are using HP-GL/2 mode or strictly the PCL printer language mode, you should establish default conditions at the beginning of each print job to prevent unexpected results due to “leftover” command parameters from a previous job. From within HP-GL/2 mode there are two ways to establish default conditions: using the Initialize (IN) command or using the Default (DF) command. Using the IN command sets the printer to its user-selected defaults.
The Scaling Points P1 and P2 When you scale a drawing, you define your own units of measurement, which the printer then converts to plotter units. Scaling relies on the relationship between two points: P1 and P2. These two points are called the scaling points because they take on the user-unit values that you specify with the Scale (SC) command. You can change the locations of P1 and P2 using either the Input P1 and P2 (IP), or Input Relative P1 and P2 (IR) command.
For example, to divide the X-axis into 12 units, and the Y-axis into 10 units, specify the X-axis to scale from 0 to 12, and the Y-axis to scale from 0 to 10. P1 becomes the origin with user-unit coordinate (0,0) and P2 becomes (12,10). The entire plotting area is now divided into the desired units. Subsequent plotting commands use these units (see Figure 19-1). If you command the printer to move to the point (3,4), the printer moves to the location equivalent to (3,4) user-units (not (3,4) plotter units).
Figure 19-2 Same User-Unit Scaling with New P1 and P2 To further illustrate the flexibility of user-unit scaling, Figure 19-3 shows the P1 and P2 locations with negative user-unit values. Note that the framework set by the scaling points P1 and P2 is not a graphics limit. The user-unit coordinate system extends across the entire PCL Picture Frame area. You can print to a point beyond P1 or P2 as long as you are within the PCL Picture Frame. In Figure 19-3, P1 is in the -X and -Y quadrant.
Figure 19-3 New P1 and P2 User-Unit Scaling with Negative Values Refer to the Scale (SC) command at the end of this chapter for more information on scaling drawings.
Using Scaling Effectively The following sections describe how to combine scaling and P1/P2 concepts to do the following. z Enlarge or reduce the size of a drawing z Draw equal-size pictures on the same page. z Create mirror-imaged pictures Enlarging or Reducing a Picture The basic technique for changing a picture’s size is to scale the printing area defined by P1 and P2, then move the locations of P1 and P2 to define a smaller or larger area.
Table 19-2 E EN Example: Changing the Size of a Drawing C%0B Enter HP-GL/2 mode, using the default picture frame size and anchor point. IN; Initialize HP-GL/2 mode. IP0,0,2000,2000; Set P1 to be (0,0) and P2 to be (2000,2000). SC0,10,0,10; Set up user-unit scaling to range from (0,0) to (10,10). SP1; Select pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. PA5,5; Begin absolute plotting from the center of the square (5,5).
Figure 19-4 Changing the size of a drawing Drawing Equal-Size Pictures on a Page You may occasionally want to print more than one drawing on the same page for a side-by-side comparison. This can be useful for comparing parts, assemblies, layouts, or other similar information. The easiest way to draw equal-sized pictures on one piece of paper is to take advantage of the fact that P2 follows P1 whenever you change the location of P1. The following example illustrates this feature.
Table 19-3 EN Example: Drawing Equal-Size Pictures on a Page E CE Reset the printer. E C&l1O Select landscape orientation. E C%0B Enter HP-GL/2 mode, using the default picture frame size and anchor point. IN; Initialize HP-GL/2 mode. IP500,500,5450,7500; Set P1 to be (500,500) and P2 to be (5450,7500). SC0,10,0,15; Set up user-unit scaling to range from (0,0) to (10,15). SP1; Select pen number 1. Even though there is no physical pen, the SP command must be used to enable printing.
Figure 19-5 Drawing equal-size pictures on a page Note The P1/P2 frames are not windows or graphics limits; the pen can print HP-GL/2 images anywhere within the PCL Picture Frame. Note that the new P1 and P2 retain their scaled values. This allows you to use the same coordinates on both halves of the page. In contrast, if you do not assign a scale to P1 and P2, you must calculate the new plotter unit coordinates for the drawing on the second half of the page.
The following example uses a subroutine to draw the same picture (an arrow) four times. Because the program changes the relative locations of P1 and P2, the direction of the arrow is different in each of the four drawings. The program sets P1 and P2, draws the plot, then returns to reset P1 and P2 (using the IP command). This continues until all four possible mirror-images are plotted. (The original drawing is shown in each picture so you can compare the orientation of the mirror-image.
Table 19-4 Example: Creating a Mirror-Image (continued) SUBROUTINE: Subroutine that prints the arrow figure on the next page PA1,2;PD1,4,3,4,3,7,2,7, 4,9,6,7,5,7,5,4,12,4,12, 5,14,3,12,1,12,2,1,2; PU; Figure 19-6 Creating a mirror-image 19-14 The Configuration and Status Group EN
Adapting the HP-GL/2 Coordinate System to Match the PCL System The following example uses the IP and SC commands to change HP-GL/2 coordinate system to match the default PCL coordinate system. The IP command is used to invert the Y-axis so that the Y values increase as the pen moves down the page. The SC command equates user-units to dot positions (300 dots-per-inch).
Table 19-5 Example: Adapting the HP-GL/2 Coordinate System to Match the PCL System in Portrait Orientation IN;SP1; Initialize HP-GL/2 command values and select pen number 1 (black). (The IN command moves the pen position from the anchor point to the HP-GL/2 origin, the lower-left corner of the PCL Picture Frame.) SC0,3.3867,0,-3.3867,2 Set-up a user scale with a user-unit equal to 1/300 inch.
Table 19-5 E Example: Adapting the HP-GL/2 Coordinate System to Match the PCL System in Portrait Orientation C%1BPU;PR300,0; PD;PR0,500; Enter HP-GL/2 mode (inheriting PCL’s CAP) and lift the pen; move to a point 300 user-units (dots) to the right; place the pen down and print a line 500 user-units down. E C%1A Enter the PCL mode with the CAP at the current HP-GL/2 pen position. E CE Reset the printer to end the job and eject a page.
Windowing: Setting Up Soft-Clip Limits Soft-clip limits temporarily restrict pen movement to a rectangular area, or window. When you initialize or set the printer to default conditions, the soft-clip limits are the same as the PCL Picture Frame limits. To create a window, you use the Input Window (IW) command. The printer does not draw outside the window. The following illustration shows the four types of line segments you can specify from one point to another.
The IW command lets you control the size of the HP-GL/2 printing area so that you can draw a particular portion of a drawing. You can leave the rest as white space, or use the remaining area for labels, or another drawing. Refer to “The Vector Graphic Limits” in Chapter 17, and the IW command description later in this chapter. CO, Comment This command allows comments to be inserted within an HP-GL/2 command sequence. The comment string of the CO command must be delimited by double quotes. CO “text ...
Table 19-7 Default Conditions (continued) Absolute Direction DI1,0 Character direction parallel to X-axis. Define Label Terminator DT ETX and non-printing mode. Define Variable Text Path DV Text printed left to right with normal Line Feed. Extra Space ES No extra space. Fill Type FT Solid fill. Input Window IW Set equal to PCL Picture Frame Window. Line Attributes LA Butt caps, mitered joins, and miter limit=5. Label Origin LO1 Standard labeling starting at current location.
Table 19-7 Default Conditions (continued) Transparency Mode TR1 Transparency mode on. Transparent Data TD Normal printing mode. User-Defined Line Type UL Defaults all 8 line types. In addition, the printer updates the Carriage Return point for labeling to the current pen location. (See Chapter 23, The Character Group, for more information on the Carriage Return point.) The DF command does not affect the following HP-GL/2 conditions. z Locations of P1 and P2.
The IN command sets the printer to the same conditions as the DF command, plus the following: z Raises the pen (PU). z Returns the pen location to the lower-left corner of the PCL Picture Frame (PA0,0). z Cancels drawing rotation (RO). z Sets P1 and P2 to the lower-left and upper-right corners, respectively, of the PCL Picture Frame (IP). z Sets pen width mode to metric; units are millimeters (WU). z Sets the pen width to 0.35 mm (PW). z Sets number of pens to 2 (black [1] and white [0]).
IP, Input P1 and P2 This command establishes new or default locations for the scaling points P1 and P2. P1 and P2 are used by the Scale (SC) command to establish user-unit scaling. You can also use IP in advanced techniques such as printing mirror-images, enlarging/reducing drawings, and enlarging/reducing relative character size, or changing label direction (see the previous discussion in this chapter).
z Note No Parameters — Sets P1 and P2 to their default locations, adjusted by any current axis rotation. If an IP command without parameters is executed after the axes are rotated with the RO command, P1 and P2 locations change to reflect the rotation. If the coordinate system orientation subsequently changes (e.g., by sending an RO command), the plotter unit position is maintained with respect to the new orientation. z X,Y Coordinates — Specify the location of P1 (and, optionally, P2) in plotter units.
An IP command remains in effect until another IP command is executed, an IR command is executed, or the printer is initialized.
IR, Input Relative P1 and P2 This command establishes new or default locations for the scaling points P1 and P2 relative to the PCL Picture Frame size. P1 and P2 are used by the Scale (SC) command to establish user-unit scaling. IR can also be used in advanced techniques such as printing mirror-images, enlarging/reducing drawings, and enlarging/reducing relative character size, or changing label (text) direction.
Sending the command IR25,25,75,75 establishes new locations for P1 and P2 that create an area half as high and half as wide as the PCL Picture Frame, in the center of the picture frame. Refer to the following illustration. Figure 19-10Example: P1 and P2 command P1 or P2 can also be set outside the PCL Picture Frame by specifying parameters less than zero and greater than 100. For example, sending (IR-50,0,200,100) would set P1 and P2 as shown in the following illustration.
If you specify P1 and P2 beyond the PCL Picture Frame, your drawing is scaled with respect to those locations; however, only the portion of the drawing fitting within the effective window is drawn. Note The specified P1/P2 percentages are converted to the equivalent plotter unit coordinates. If the coordinate system orientation subsequently changes (for example, by sending an RO command), the plotter unit position is maintained with respect to the new orientation.
Table 19-14 Related Commands Group IP, Input P1 and P2 The Configuration/Status Group IW, Input Window RO, Rotate Coordinate System SC, Scale IW, Input Window This command defines a rectangular area, or window, that establishes soft-clip limits. Subsequent HP-GL/2 drawing is restricted to this area. Use IW to restrict printing to a specified area on the page.
When you turn on the printer, the window is automatically set to the PCL Picture Frame boundaries. You can define a window that extends beyond the picture frame, however the printer cannot print vector graphics beyond the effective window. All programmed pen motion is restricted to this area. For more information, refer to “Windowing: Setting Up Soft-Clip Limits” at the beginning of this chapter.
Table 19-15 Example: The IW Command (continued) SP1; Select pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. SI.2,.35; Set Absolute Character Size to .2 x .35 cm. PA2000,3200; Specify absolute plotting and move to location (2000,3200) (plotter units). DT@,1; Define label terminator to be the “@” character, without printing the character. LBTHIS IS AN EXAMPLE Print a label beginning at (2000,3200).
Figure 19-13Example: IW command Table 19-16 Related Commands Group IP, Input P1 and P2 The Configuration/Status Group IR, Input Relative P1 and P2 RO, Rotate Coordinate System SC, Scale 19-32 The Configuration and Status Group EN
PG, Advance Full Page This HP-GL/2 command is ignored by the printer since it could cause undesirable results when importing plots. A page eject can be accomplished only from the PCL printer language mode.
RO, Rotate Coordinate System This command rotates the printer’s coordinate system relative to the default HP-GL/2 coordinate system, in the following increments of rotation: 90°, 180°, and 270°. Use RO to orient your drawing vertically or horizontally, or to reverse the orientation.
Figure 19-14Angle of rotations Note The relationship of the X-axis to Y-axis can change as a result of the scaling point or scaling factor changes, thus changing the direction of a positive angle of rotation. The physical location of the pen does not change when you rotate the coordinate system. The printer updates the pen’s X,Y coordinate location to reflect the new orientation. The scaling points P1 and P2 rotate with the coordinate system.
Note The RO command also rotates the contents of the polygon buffer. The RO command remains in effect until the rotation is changed by another RO command, or the printer is initialized. Figure 19-15 shows the default orientation and the result of rotating the orientation without relocating P1 and P2.
Figure 19-16 shows the locations of P1 and P2 when you follow the rotation with the IP command. Figure 19-16Using IP after the RO Command When you set-up a soft-clip window (see the IW command), RO also rotates the window. If a portion of a window rotates outside the hard-clip limits, it is clipped. Note that IP does not affect the window limits. Use IW to reset the window to the size of the PCL Picture Frame.
Figure 19-17Using IP and IW after the RO Command Table 19-17 Related Commands Group IP, Input P1 and P2 The Configuration/Status Group IR, Input Relative P1 and P2 IW, Input Window 19-38 The Configuration and Status Group EN
RP, Replot This command is ignored by the printer; to eject a page, the printer must be in PCL printer language mode. The following commands cause a conditional page eject; a page is ejected if there is any printable data in the print buffer: z E z UEL (Universal Exit Language) z Flush All Pages z Page Length z Page Size z Orientation z Paper Source CE Reset The PCL Form Feed control code causes an unconditional page eject and advances the cursor position to the top of form on the next page.
SC, Scale This command establishes a user-unit coordinate system by mapping user-defined coordinate values onto the scaling points P1 and P2.
There are three forms of scaling: anisotropic, isotropic, and point-factor. The Type parameter tells the printer which form you are using. Refer to the following table. Table 19-18 Scaling Form Type Description Anisotropic 0 Establishes standard user-unit scaling allowing different unit size on X-axis and Y-axis. Isotropic 1 Establishes standard user-unit scaling with same unit size on X-axis and Y-axis.
z Note XMIN, XMAX, YMIN, YMAX — These parameters represent the user-unit X- and Y-axis ranges, respectively. For example, SC0,15,0,10 indicates 15 user-units along the X-axis and 10 user-units along the Y-axis. As a result, the first and third parameters (XMIN and YMIN) are the coordinate pair that is mapped onto P1; the second and fourth parameters (XMAX and YMAX) are the coordinate pair mapped onto P2. Using the same example, the coordinate location of P1 is (0,0) and P2 is (15,10).
Figure 19-18Isotropic Scaling z Left, Bottom — Positions the isotropic area in the P1/P2 limits. (These parameters are always specified together and are valid for isotropic scaling only.) The left parameter indicates the percentage of the unused space on the left of the isotropic area; the bottom parameter indicates the percentage of unused space below. • The defaults for the left and bottom parameters are each 50%.
• Although you must specify both parameters, the printer applies only one: the left parameter applies when there is extra horizontal space; the bottom parameter applies when there is extra vertical space. The following examples illustrate left and bottom parameters of 0% and 100%. Figure 19-19The Left and Bottom Parameters For Scaling Type 2: The third form of scaling, point-factor scaling, sets a specific ratio of plotter units to user-units, and establishes the user-units coordinate of P1.
z XMIN,XFACTOR,YMIN,YFACTOR — Establish the user-unit coordinates of P1 and the ratio of plotter to user-units. X MIN and YMIN are the user-unit coordinates of P1. XFACTOR sets the number of plotter units per user-unit on the X-axis; YFACTOR sets the number of plotter units per user-unit on the Y-axis. z Type — Must be 2 for this type of scaling. An SC command remains in effect until another SC command is executed, or the printer is initialized or set to default conditions.
Figure 19-20Example: Printing point-to-point Table 19-22 Related Commands Group IP, Input P1 and P2 The Configuration/Status Group IR, Input Relative P1 and P2 IW, Input Window Table 19-23 Possible Error Conditions for SC Condition Printer Response no parameters turns scaling off more than 7 parameters executes first 7 parameters for types 0 or 1: 6 parameters or less than 4 parameters ignores command for type 2: any more or less than 5 parameters ignores command XMIN=XMAX or YMIN=YMAXor numb
20 The Vector Group Introduction The information in this chapter enables you to achieve the following results in your programs: z Use absolute and relative coordinates when plotting. z Draw lines, arcs, bezier curves, and circles. z Encode coordinates to increase your printer’s throughput. The following commands are described in this chapter. Table 20-1 EN The Vector Group Commands Command Summary AA, Arc Absolute Draws an arc using absolute coordinates.
Table 20-1 The Vector Group Commands (continued) PA, Plot Absolute Enables movement to absolute coordinate locations (with respect to the origin [0,0]). PD, Pen Down Lowers the "pen" to the page. PE, Polyline Encoded Increases throughput by encrypting common HP-GL/2 commands. PR, Plot Relative Enables movement relative to the current pen location. PU, Pen Up Lifts the pen from the page. RT, Relative Arc Three Point Draws an arc from the current pen location through two relative points.
In the following example, note that the PA (Plot Absolute) command specifies absolute plotting, and the coordinate pair (0,0) sets the beginning pen location. Table 20-2 Example: Drawing Lines E CE Reset the printer. E C%ØB Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1 (black). You must use the SP command to be able to print HP-GL/2 images. PA0,0; Begin absolute plotting from coordinate (0,0). PD2500,0,0,1500,0,0; Specify Pen Down and draw lines between the points.
Note Any line drawn along the border of the effective window causes the line to be clipped, producing a line width of one-half of what it should be. For example, in the above plot, the lines from (0,0) to (0,1500), and (0,0) to (2500,0) is clipped. Drawing Circles The Circle (CI) command uses your current pen position as the center of the circle; you specify the radius of the circle. The following example shows a simple command sequence using CI to draw a circle with a radius of 500 plotter units.
Figure 20-2 Drawing circles Drawing Arcs The Arc Absolute (AA) and Arc Relative (AR) commands use the following method for drawing arcs. Your current pen location becomes one end of the arc; you specify the center point with one parameter (setting the radius), and set another parameter to specify the number of degrees through which you want the arc drawn.
Table 20-4 Example: Drawing Arcs AA4600,2500,-180; Using the Arc Absolute command, specify the pivot point of the arc, thereby setting the radius; draw the arc for 180° in a negative angle of rotation. E C%ØA Enter the PCL mode. E CE Send a reset to end the job and eject the page.
Angle of Rotation NoteS A positive angle of rotation is in the direction of the +X-axis to the +Y-axis as shown below. A negative angle of rotation is in the direction of the +X-axis to the −Y-axis. Figure 20-4 Drawing arcs (2 of 3) Note The relationship of the +X-axis to +Y-axis (and -Y-axis) can change as a result of the scaling point or scaling factor changes, thus, changing the direction of a positive (or negative) angle of rotation.
Figure 20-5 Drawing arcs (3 of 3) Drawing Bezier Curves The Bezier Absolute (BZ) and Bezier Relative (BR) commands use your current pen position as the first control point in the Bezier curve. You specify the second, third, and fourth control points. If you are drawing more than one curve, the fourth control point of the first curve (X3, Y3) becomes the first control point of the next curve.
Table 20-5 E Example: Drawing Bezier Curves (continued) CE Send a reset to end the job and eject the page. Figure 20-6 Bezier Curves AA, Arc Absolute This command draws an arc, using absolute coordinates, which starts at the current pen location and pivots around the specified center point.
Note Do not use an adaptive line type when drawing arcs with small chord angles. The printer attempts to draw the complete pattern in every chord (there are 72 chords in a circle using the default chord angle). z XCenter, YCenter — Specify the absolute location of the center of the arc. (The center of the arc is the center of the circle that would be drawn if the arc was 360 degrees.) z Coordinates are interpreted in current units: as user-units when scaling is on; as plotter units when scaling is off.
z For a specific chord angle, a circle or arc always has the same number of chords, regardless of its size. For example, for the default chord angle, a circle is always composed of 72 chords (360°/5° per chord = 72 chords). This results in larger circles appearing less smooth than smaller circles with the same chord angle; setting the chord angle to a smaller number will help large circles or arcs appear more smooth (see Figure 20-8).
Table 20-6 Example: Varying the Chord Angle (continued) PU1000,0; Lift the pen and move to (1000,0). PD;AA0,0,45; With the pen down, draw another 45° arc (positive angle) with the same center point, but with the default chord angle (5°). E C%ØA Enter the PCL mode. E CE Send a reset to end the job and eject the page.
Table 20-7 The Line and Fill Attributes Group LA, Line Attributes LT, Line Type PW, Pen Width AR, Arc Relative This command draws an arc, using relative coordinates, which starts at the current pen location and pivots around the specified center point. AR Xincrement,Yincrement,sweep angle[,chord angle;] Parameter Format Functional Range Default Xincrement,Yincrement current units -230 to 230 - 1 no default sweep angle clamped real -32768 to 32767 no default chord angle clamped real 0.
z Sweep Angle — Specifies (in degrees) the angle through which the arc is drawn. A positive angle draws an angle in the positive direction (angle of rotation); a negative angle draws the angle in the negative direction. z Chord Angle — Specifies the chord angle used to draw the arc. The default is a chord angle of 5 degrees. Refer to the Arc Absolute (AA) command discussion (earlier this chapter) for information on setting and determining the chord angle.
Figure 20-10 Table 20-9 Related Commands Group AA, Arc Absolute The Vector Group AT, Absolute Arc Three Point BR, Bezier Relative BZ, Bezier Absolute CI, Circle RT, Relative Arc Three Point LA, Line Attributes The Line and Fill Attributes Group LT, Line Type PW, Pen Width EN AR, Arc Relative 20-15
AT, Absolute Arc Three Point This command draws an arc segment, using absolute coordinates, from a starting point, through an intermediate point, to an end point. Use AT when you know these three points of an arc. AT Xinter,Yinter, Xend,Yend[,chord angle;] Parameter Format Functional Range Default Xinter, Yinter current units -230 to 230 - 1 no default Xend, Yend current units -230 to 230 - 1 no default chord angle clamped real 0.
z If the end point is the same as the current pen location, a circle is drawn, with its diameter being the line from the current pen position to the intermediate point. z If the current pen position, intermediate point, and end point are collinear, a straight line is drawn.
Table 20-10 Example: Using the AT Command (continued) PU650,450; PD1000,450; Lift the pen, move to (650,450), place the pen down, and draw a line to (1000,450). PU1000,100; PD1000,1500, 2500,1500; Lift the pen, move to (1000,100), place the pen down, draw a line to (1000,1500), then to (2500,1500). AT3200,800,2500,100; Print an arc, starting at current pen position (2500,1500), passing through (3200,800) and ending at (2500,100). PU3200,900;PD; Lift the pen, move to (3200,900) and set the pen down.
Table 20-11 Related Commands Group AA, Arc Absolute The Vector Group AR, Arc Relative BR, Bezier Relative BZ, Bezier Absolute CI, Circle RT, Relative Arc Three Point LA, Line Attributes The Line and Fill Attributes Group LT, Line Type PW,Pen Width BR, Bezier Relative This command draws bezier curves using relative coordinates. This command uses the current pen position as the first control point, and specifies the other three control points as relative increments from the first point.
Bezier curves are drawn with the current pen, line type, current line attributes, and pen-state (up/down). The curve is clipped to the hard-clip limits and the soft-clip window. Following the command execution, the current pen position is updated to the end point of the curve. The BR command is allowed in Polygon Mode. (The first chord after PM1 is not treated as a pen-up move.) z X1, Y1...
Figure 20-13 Table 20-13 Related Commands Group AA, Arc Absolute The Vector Group BZ, Bezier Absolute AR, Arc Relative AT, Absolute Arc Three Point CI, Circle RT, Relative Arc Three Point LA, Line Attributes The Line and Fill Attributes Group LT, Line Type PW, Pen Width EN BR, Bezier Relative 20-21
BZ, Bezier Absolute This command draws bezier curves using absolute coordinates. The BZ command uses the current pen position as the first control point, and specifies the other three control points as absolute coordinates. BZ X1,Y1, X2,Y2,X3,Y3,...[X1,Y1, X2,Y2,X3,Y3]] Parameter Format X1, Y1... (control points) current units Functional Range Default -223 to 223 - 1 no default The BZ command uses the current pen location and three specified control points to draw a bezier curve.
Table 20-14 Example: Using the BZ Command (Bezier Absolute) PA1016,5080; Specify the absolute point (1016,5080) as the starting location. PR;PD; Specify relative plotting and pen down. BZ1016,8128,5588,5080, 4572,7112,4064,8128, EN 7112,7620,7112,2032; Draw a Bezier using the current position (1016,5080) as the first control point. The specified control points for the first curve are (1016,8128), (5588,5080), and (4572,7112).
Figure 20-14 Table 20-15 Related Commands Group AA, Arc Absolute The Vector Group BR, Bezier Relative AR, Arc Relative AT, Absolute Arc Three Point CI, Circle RT, Relative Arc Three Point LA, Line Attributes The Line and Fill Attributes Group LT, Line Type PW, Pen Width 20-24 The Vector Group EN
CI, Circle This command draws the circumference of a circle using the specified radius and chord angle. If you want a filled circle, refer to the WG or PM commands. CI radius[,chord angle;] Parameter Format Functional Range Default radius current units -230 to 230 - 1 no default chord angle clamped real 0.5° to 180° 5° The CI command includes an automatic pen down.
Figure 20-15 Table 20-16 Example: Effects of Chord Angle on Circle Smoothness E CE Reset the printer. E C%ØB Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1 (black). SC-3000,3000, -2000,2000,1; Specify scaling mode, making P1 equal to (-3000,-2000) user-units and P2 equal to (3000,2000) user-units. Isotropic scaling is specified. PA-1700,2000; CI750,45; Specify absolute plotting and move to (-1700,2000), the center of the circle to be drawn.
Table 20-16 Example: Effects of Chord Angle on Circle Smoothness (continued) PA-1700,-200; CI750,15; Specify absolute plotting and move to (-1700,-200), the center point of a third circle. Draw this circle with a radius of 750 user-units and a chord angle of 15°. PA300,-200;CI750; Specify absolute plotting and move to (300,-200), the center of the fourth circle. Draw this circle with a radius of 750 user-units and a chord angle of 5° (default). E C%ØA Enter the PCL mode.
Table 20-17 Example: Drawing Circles with Different Radii and Line Types E CE Reset the printer. E C%ØB Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1 (black). SC-75,75,-75,75,1; Set up user scaling with (-75,-75) as P1 and (75,75) as P2; the "1" parameter specifies isotropic scaling. PA0,0; Specify absolute plotting and move to user-unit location (0,0). LT;CI5; Specify a default line type (solid) and draw a circle with a radius of 5 user-units.
Figure 20-17 Table 20-18 Related Commands Group EW, Edge Wedge The Polygon Group WG, Fill Wedge SC, Scale The Configuration/Status Group AA, Arc Absolute The Vector Group AR, Arc Relative AT, Absolute Arc Three Point RT, Relative Arc Three Point LA, Line Attributes The Line and Fill Attributes Group LT, Line Type PW, Pen Width EN CI, Circle 20-29
PA, Plot Absolute This command establishes absolute plotting and moves the pen to the specified absolute coordinates from the current pen position. PA X,Y [,...;] or PA [;] Parameter Format Functional Range Default X,Y coordinates current units -230 to 230 - 1 no default The printer interprets the parameters as follows: Note z No Parameters — Establishes absolute plotting for subsequent commands. z X,Y Coordinates — Specify the absolute location to which the pen moves.
Table 20-19 Related Commands Group PE, Polyline Encoded The Vector Group PR, Plot Relative PD, Pen Down PU, Pen Up Line and Fill Attributes Group LA, Line Attributes LT, Line Type PW, Pen Width SM, Symbol Mode PD, Pen Down This command lowers the printer’s "logical pen" and draws subsequent graphics commands. PD X,Y[,...
• Coordinates are interpreted in current units: as user-units when scaling is on; as plotter units when scaling is off. • Whether the PD command uses coordinates or increments depends on the most recently executed PA or PR command. If no PA or PR command is issued, absolute plotting (PA) is used. • When you use the symbol mode (SM) command, PD draws the specified symbol at each X,Y coordinate.
Figure 20-18 Note If an odd number of coordinates is specified (an X coordinate without a corresponding Y coordinate), the printer ignores the last unmatched coordinate .
PE, Polyline Encoded This command incorporates the PA, PR, PU, PD, and SP commands into an encrypted format that substantially decreases the size of your file and the time required for data transmission. (This command is especially useful when using an RS-232-C interface.) PE [flag[value]]|coord_pair...[flag[value]]|coord_pair; or PE; Note Parameter values are self-terminating; do not use commas with this command. Also, you must use a semicolon to terminate PE.
The PE command represents vectors in base 64 (default) or base 32 (explained under Encoding PE Flag Values and X,Y Coordinates). In parameter value data, all spaces, delete characters, control characters, as well as ASCII characters 128-160 and 255 are ignored. z No parameters — Updates the Carriage Return point. The PE command without parameters does not affect the pen’s current location or up/down status. z Flag — Indicates how the printer interprets subsequent values.
Note Because SP is not allowed in polygon mode, if you select a pen within PE while in polygon mode, the Select Pen command is ignored. z Value — Specifies data according to the preceding flag. For example, a value following a select-pen flag should be a pen number. Flag values are encoded in the same manner as coordinate data. Instructions for encoding flag values follow the parameter descriptions. z Pen Number — Specifies the pen to be selected (black [1] or white [0]).
Encoding PE Flag Values and X,Y Coordinates Flag values and X,Y coordinates are encoded into a base 64 (default) or base 32 equivalent (7-bit mode). The following steps give a generic algorithm for encoding a number. Assume x is the number to be encoded. Use steps 1 and 2 only if you are encoding fractional data; otherwise, begin with step 3.
Table 20-24 Procedure to encode a number (continued) 2. Round to an integer. Round the results of step 1 to the nearest integer. x = round (x) x = round (10,525.42) = 10,525 3. Set the sign bit. If x is positive, multiply it by two. If x is negative, multiply the absolute value of x by two and add one. This sets the sign bit. if (x ≥ 0) x=2×x x = 2 × 10,525 = 21,050 else x = 2 × abs(x) + 1 4. Convert the number to base 64 or 32 and encode the data.
Table 20-25 Terminator and non-terminator characters Note Range Type Non-terminator Terminator 8-bit Range (base 64) 63-126 191-254 7-bit Range (base 32) 63-94 95-126 Values following the fractional data or select pen flag also must be encoded. while n ≥ base output CHR$(63 + (n MOD base)) n = n DIV base end if base = 64 then n = 191 + n if base = 32 then n = 95 + n output CHR$(n) Table 20-26 Procedure for determining base range STEPS EXAMPLE Base 64.
Table 20-26 Procedure for determining base range (continued) Next order digit: 64ths place (63-126) 63 + 8 = 71 CHR$ (71) High order digit: 4096ths place (191-254) 191 + 5 = 196 CHR$ (196) Base 32. Encode all the low order digits into the ASCII range 63 to 94. For a digit with value i, use ASCII character CHR$(63 + i).| Encode the highest order digit (or the single digit in a one-digit number) into the range 95 to 126.
When using PE (in the default relative mode), the application program does not know the current pen location after printing a label (normally, the current pen location is updated to the end of the label.) If this presents a problem in your program, follow these steps. Note 1 Create a flag called "lost" in your program. 2 After labeling (or any command which updates the current pen location), set lost to true.
‘‘130 ‘‘140 ‘‘150 ‘‘160 ‘‘170 ‘‘180 ‘‘190 ‘‘200 ‘‘210 ‘‘220 ‘‘230 ‘‘240 ‘‘250 ‘‘260 ‘‘270 ‘‘280 ‘‘290 ‘‘300 ’Convert coordinate data to base 64 ’’ FOR J = 1 to 6 ’’ READ C ’’ C = C * (2^A) ’’ C = INT(C) ’’ IF C = 0 THEN C = 2*C ELSE C = 2*ABS(C)+1 ’’ WHILE C = 64 ’’ LPRINT CHR$(63+(C MOD 64)) ’’ C = C64 ’’ WEND ’’ C = 191+C ’’ LPRINT CHR$(C) ’’ NEXT J ’’ LPRINT ";"; ’’ LPRINT CHR$(27);"%0A"; ’Enter PCL Mode ’’ LPRINT CHR$(27);"E"; ’Reset to eject page.’’ DATA 10.58,0,-5.58,10.67,-5,-10.
Table 20-27 Related Commands Group PA, Plot Absolute The Vector Group PD, Pen Down PR, Plot Relative PU, Pen Up LA, Line Attributes Line and Fill Attributes Group LT, Line Type PW, Pen Width SM, Symbol Mode EN PE, Polyline Encoded 20-43
PR, Plot Relative This command establishes relative plotting and moves the pen to specified points, with each move relative to the current pen location. PR X,Y[,...;] or PR [;] Parameter Format Functional Range Default X,Y (increments) current units -230 to 230 - 1 no default * PR and PE have extended ranges of -230 to 230 - 1 plotter units.
Table 20-28 Example: Using the PR Command E CE Reset the printer. E C%ØB Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1. The SP command must be used to enable printing. PA10,10;PD; Move to absolute position (10,10) and put the pen down. PR2500,0,-2500, 1500,0,-1500; Specify relative plotting and draw lines beginning at (10,10) and then moving the relative coordinate distances indicated. E C%ØA Enter the PCL mode.
Table 20-29 Related Commands Group PA, Plot Absolute The Vector Group PD, Pen Down PE, Polyline Encoded Line and Fill Attributes Group LA, Line Attributes LT, Line Type PW, Pen Width SM, Symbol Mode U, Pen Up This command moves to subsequent points without drawing. Use PU to move to another location without drawing a connecting line. PU X,Y[,...
• When you use the Symbol Mode (SM) command, PU draws the specified symbol at each X,Y coordinate. When you use the polygon mode (PM) command, the X,Y coordinates enter the polygon buffer (for use when the polygon is edged or filled). • Coordinates are interpreted in current units: as user-units when scaling is on; as plotter units when scaling is off. • Whether the PU command uses absolute coordinates or relative coordinates (increments) depends on the most recently executed PA or PR command.
RT, Relative Arc Three Point This command draws an arc segment, using relative coordinates, from a starting point through an intermediate point to an end point. Use RT when you know these three points of an arc. RT X\incr inter,Yincr inter, X\incr end\,Yincr end[,chord angle;] Parameter Format Functional Range Default Xincr inter, Yincr inter current units -230 to 230 - 1 no default Xincr end, Yincr end current units -230 to 230 - 1 no default chord angle 0.
z If the end point is the same as the current pen location, a circle is drawn, with its diameter being the distance between the current pen position and the intermediate point. z If the current pen position, intermediate point, and end point are collinear, a straight line is drawn.
Table 20-31 Example: Using the RT Command (Relative Arc Three Point) (continued) SP1; Select pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. PA1000,100; Specify the absolute point (1000,100) as the starting location. PR;PD1500,0; Specify relative plotting, pen down, and draw (1500,0) relative plotter units from the current pen location (1000,100).
Table 20-31 Example: Using the RT Command (Relative Arc Three Point) (continued) RT100,-100,0,-200; Draw an arc from the current pen position, through a point (100,-100) plu away, with an ending point (0,-200) from the starting point of the arc. PU100,100;PD200,0; Lift the pen and move it (100,100) plu from the current pen position, pen down, and draw a line 200 plu in the X direction. E C%ØA Enter the PCL mode. E E C Send a reset to end the job and eject the page.
Table 20-32 Related Commands Group AA, Arc Absolute The Vector Group AR, Arc Relative AT, Absolute Arc Three Point BR, Bezier Relative BZ, Bezier Absolute CI, Circle LA, Line Attributes The Line and Fill Attributes Group LT, Line Type PW,Pen Width 20-52 The Vector Group EN
21 The Polygon Group Introduction All of the commands in this group use the polygon buffer, a temporary data storage area in your printer. Using the polygon buffer is an integral part of drawing wedges, rectangles, and other types of polygons. Some of the commands in this chapter define and draw complete shapes while others act only on the contents of the polygon buffer. The information in this chapter enables you to achieve the following results in your programs: z Draw circles, wedges, and rectangles.
Table 21-1 The Polygon Group Commands (continued) RA, Fill Rectangle Absolute Fills a rectangle specified with absolute coordinates. RR, Fill Rectangle Relative Fills a rectangle specified with relative coordinates. WG, Fill Wedge Defines and fills a wedge-shaped polygon. Using the Polygon Buffer As mentioned, a buffer is a temporary storage area for information. The polygon buffer collects the commands and coordinates that define a polygon you want to print.
Drawing Rectangles You can draw a rectangle by outlining (edging) the defined area using the Edge Rectangle Absolute (EA) or Edge Rectangle Relative (ER) commands. To draw a rectangle, the printer uses the current pen location for one corner; you give the coordinates for the diagonally opposite corner. The printer draws the rectangle defined by these two points. The following simple command sequence uses EA to draw a rectangle. Table 21-3 Example: Drawing Rectangles EN ?E Reset the printer.
Figure 21-1 The Fill Rectangle Absolute (RA) and Fill Rectangle Relative (RR) commands, both discussed later in this chapter, fill their rectangles with the default or current fill pattern. You may also want to edge (or outline) the rectangle for better image definition with some fill types. The following command sequence draws two filled rectangles: one edged and one not. Table 21-4 Example: Filled Rectangles ?E Reset the printer. ?%0B Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode.
Table 21-4 Example: Filled Rectangles (continued) EP; Draw an edge around the rectangle that was just drawn. Since the previous RR command leaves its definition in the polygon buffer (1500,1000), you do not need to specify the coordinates again. PR2000,0; Specify relative plotting and move the cursor 2000 plu in the X direction from the current pen location. FT4,100,45; Specify fill type number 4 (cross-hatching), set the spacing to 100 plu between fill lines, and set the fill line angle to 45°.
Drawing Wedges A wedge is a section of a circle. Wedges are commonly used to draw pie charts. You can draw a wedge by outlining (edging) the defined area using the Edge Wedge (EW) command, or you can create filled wedges using the Fill Wedge (WG) command. The wedge commands use your current pen location as the center point; you specify the radius, the start angle, and the sweep angle. The radius determines the length of the two sides of the wedge.
Figure 21-4 Drawing Wedges The following example draws a wedge using the EW command. The radius of the wedge is 600 plotter units, the wedge begins 90° from the zero-degree reference point, and the wedge “sweeps” for 60°. Note In the example plots, some reference points are added which are not part of the example plot. These reference points are added for clarification. Table 21-5 EN Example: Drawing Wedges ?E Reset the printer. ?%0B Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode.
Table 21-5 Example: Drawing Wedges (continued) EW600,90,60; Draw the outline of a wedge, using the current pen location (2500,3500) as the point of the wedge. The wedge has a radius of 600 plotter units, begins at 90° from the default zero-degree reference point, and “sweeps” for 60°. ?%0A Enter the PCL mode. ?E Send a reset to end the job and eject the page. Figure 21-5 The following example uses different fill types with wedges and circles.
Table 21-6 EN Example: Filling Wedges and Circles (continued) PA2300,2500;FT3, 75,45; Specify absolute plotting and move to (2300,2500). Select fill type number 3 (hatching--parallel lines), with 75 plu between hatching lines, and hatching lines tilted at 45°. WG600,90,180; Fill a wedge with the current fill type; use a radius of 600 plu, a start angle of 90°, and a sweep angle of 180°.
Figure 21-6 Drawing Polygons A polygon consists of one or more closed sequences of connected line segments (which may cross each other). Drawing polygons requires the use of the polygon mode. The Polygon Mode (PM) command tells the printer to store subsequent commands and coordinates in the polygon buffer before printing the shape. (Rectangles and wedges are polygons which have their own drawing commands; the printer automatically generates and stores the coordinates in the polygon buffer.
Table 21-7 (continued) PR, Plot Relative PU, Pen Up RT, Relative Arc Three Point PM1/PM2, Polygon Mode The Polygon Group Drawing Subpolygons While in polygon mode, you can define either one polygon or a series of subpolygons. Like a polygon, a subpolygon is a closed sequence of connected line segments. For example, the block letter C is one complete polygon. However, the block letter D is actually two subpolygons: the outline and the ‘hole.
To create a series of subpolygons, for example, the letter D, move the pen to the starting location of the first subpolygon, then enter polygon mode. Define the outer shape of the letter D using the appropriate commands and coordinates, then close the subpolygon, staying in polygon mode. Define the inner shape of the D, then exit polygon mode. Now draw the subpolygons using either the Edge Polygon (EP) or Fill Polygon (FP) command.
Figure 21-8 Filling Polygons: Even/Odd Fill Method Non-Zero Winding Fill Method The non-zero winding fill algorithm (fill method 1) determines whether a point is inside a region enclosed by a line path using the following steps: EN 1 Draw a ray from the point across the path segment. 2 Add 1 every time the line segment crosses the ray from left to right or bottom to top. 3 Subtract 1 every time the segment crosses the ray from right to left or top to bottom.
Figure 21-9 Filling Polygons: Non-Zero Winding Fill Method Drawing Circles in Polygon Mode Polygon mode interprets the Circle (CI) command differently than the other HP-GL/2 commands. The printer treats a circle as a complete subpolygon. The printer automatically closes the first polygon (if any) before starting the circle, and uses the first coordinates (if any) after the circle is drawn to start a new subpolygon.
If you multiply 512 points by 8 bytes per point, the result is 4096 bytes (4 Kbytes). That means the minimum your printer can store in the polygon buffer is 4 Kbytes. That is the worst case, however. Unless the printer has a substantial amount of fonts, macros, or graphics already downloaded into user memory, you can put much more into the polygon buffer. As we just calculated, for every 4 Kbytes of extra unused user memory, the polygon buffer can store 512 more points.
The following shape has seven points. Figure 21-11 Counting the Points in a Circle or Arc When a circle or arc defines a polygon, the number of points depends on the number of chords in the arc. There is always one more point than the number of chords, because the starting location is counted again as the ending location.
EA, Edge Rectangle Absolute This command defines and outlines a rectangle using absolute coordinates. Use EA when drawing charts or schematic diagrams that require rectangles. EA X,Y[;] Parameter Format Functional Range Default X,Y coordinates current units -230 to 230 - 1 no default The EA command defines and edges a rectangle using absolute coordinates and the current pen, line type and line attributes. The EA command performs an automatic pen down.
Figure 21-12 Note Any line drawn along the border of the effective window causes the line to be clipped, producing a line width one-half of the defined pen width. For example, all the lines drawn in the above example are half the width of the other lines since they are clipped at the window borders. The only difference between the EA command and the RA (Fill Rectangle Absolute) command is that the EA command produces an outlined rectangle, and RA, a filled one.
Table 21-8 EN Example: Using EA to Draw Rectangles (continued) SP1; Select pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. SC0,150,0,150,1; Set up user scaling, with P1 being (0,0) user-units and P2 being (150,150) user-units. (Isotropic scaling is specified.) PA75,105; EA115,130; Specify absolute plotting mode and move to (75,105).
Figure 21-13 Table 21-9 Related Commands Group EP, Edge Polygon The Polygon Group ER, Edge Rectangle Relative FP, Fill Polygon RA, Fill Rectangle Absolute RR, Fill Rectangle Relative LA, Line Attributes The Line and Fill Attributes Group LT, Line Type PW, Pen Width 21-20 The Polygon Group EN
EP, Edge Polygon This command outlines the polygon currently stored in the polygon buffer. Use EP to edge polygons that you defined in polygon mode and with the Fill Rectangle and Wedge Commands (RA, RR, and WG). EP [;] The EP command outlines any polygon that is currently in the polygon buffer. This includes wedges and rectangles defined using the EA, ER, EW, RA, RR, and WG commands. EP accesses the data in the polygon buffer, but does not clear the buffer or change the data in any way.
Table 21-10 Example: Using the EP Command (continued) EP; Outline the polygon that was just stored in the polygon buffer. ?%0A Enter the PCL mode. ?E Send a reset to end the job and eject the page.
ER, Edge Rectangle Relative This command defines and outlines a rectangle using relative coordinates. Use ER when drawing charts or schematic diagrams that require rectangles. ER X,Y[;] Parameter Format Functional Range Default X,Y increments current units -230 to 230 - 1 no default The ER command defines and edges a rectangle using relative coordinates and the current pen, line type, and line attributes. The ER command includes an automatic pen down.
Figure 21-15Edge Relative Rectangle Command The only difference between the ER command and the RR (Fill Relative Rectangle) command is that the ER command produces an outlined rectangle, and RR, a filled one. The ER command clears the polygon buffer and then uses it to define the rectangle before drawing. Refer to “Drawing Polygons” earlier in this chapter for more information. The following example uses relative coordinates to draw the same image shown in the EA command example.
Table 21-12 Example: Using ER to Draw Rectangles (continued) EN PA75,105;ER40,25; Enter absolute plotting mode and move to (75,105). Draw a rectangle using the current pen location as the lower left corner and a point (40,25) user-units away as the upper right corner. PR20,0;PD0,-10; Specify relative plotting and move the pen 20 user-units to the right. Place the pen down and draw a line to a point 10 user-units down. PD-30,0,0,-5; With the pen down, move 30 user-units to the left and 5 units down.
Figure 21-16 Table 21-13 Related Commands Group EA, Edge Rectangle Absolute The Polygon Group EP, Edge Polygon FP, Fill Polygon RA, Fill Rectangle Absolute RR, Fill Rectangle Relative LA, Line Attributes The Line and Fill Attributes Group LT, Line Type PW, Pen Width 21-26 The Polygon Group EN
EW, Edge Wedge This command outlines any wedge. Use EW to draw sections of pie charts. EW radius,start angle,sweep angle,[,chord angle;] Parameter Format Functional Range Default radius current units -230 to 230 - 1 no default start angle clamped real -32768 to 32767 no default modulo 360 sweep angle clamped real ±360° no default chord angle clamped real 0.5° to 180° 5° The EW command defines and edges a wedge using the current pen, line type and attributes.
Figure 21-17Anisotropic and Isotropic Scaling z Radius — Specifies the distance from the current pen location to the start of the wedge’s arc. Since the wedge is a portion of a circle, this parameter is the radius of the circle. It specifies the distance from the current pen location (which becomes the center of the circle), to any point on the circumference of the circle. The radius is interpreted in current units: as user-units when scaling is on; as plotter units when scaling is off.
Figure 21-18 Table 21-14 Example: Using EW to Draw a Pie Chart EN ?E Reset the printer. ?%0B Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. SC-3000,3000, -2000,2000,1; Enter the scaling mode, specifying P1 as (-3000,-2000) and P2 as (3000,2000). Use isotropic scaling. PA0,0; Specify absolute plotting and move to user-unit location (0,0).
Table 21-14 Example: Using EW to Draw a Pie Chart EW-1000, 330,120; Using the same center point and zero-degree reference point, draw a wedge section outline starting at 330° and sweeping 120°. PR-60,110; Move the cursor 60 user-units to the left and 110 user-units up. EW-1000,270,60; From the new center point location, draw a wedge using a negative zero-reference point, starting at 270° and sweeping for 60°. ?%0A Enter the PCL mode. ?E Send a reset to end the job and eject the page.
Table 21-15 (continued) LT, Line Type PW, Pen Width Table 21-16 Possible Error Conditions Condition Printer Response polygon buffer overflow edges contents of buffer FP, Fill Polygon This command fills the polygon currently in the polygon buffer. Use FP to fill polygons defined in polygon mode or with the Edge Rectangle or Edge Wedge commands (EA, ER, EW, RA, RR, or WG).
The FP command fills between points defined with either the pen down or the pen up. The polygon is filled using the current pen, fill type, line type and attributes (if the fill type is not raster). The FP command includes an automatic pen down. When the command execution is complete, the original pen location and up/down status are restored. The example on the next page creates a polygon composed of two subpolygons. In this case, the FP command fills alternating areas, beginning with the outside area.
Figure 21-20 Table 21-18 Related Commands Group EA, Edge Rectangle Absolute The Polygon Group ER, Edge Rectangle Relative EW, Edge Wedge PM, Polygon Mode RA, Fill Rectangle Absolute RR, Fill Rectangle Relative WG, Fill Wedge FT, Fill Type The Line and Fill Attributes Group LA, Line Attributes LT, Line Type PW, Pen Width EN FP, Fill Polygon 21-33
PM, Polygon Mode Command This command enters polygon mode for defining shapes, such as block letters or any unique area, and exits for subsequent filling and/or edging. Fill polygons using the Fill Polygon (FP) command and/or outline them using the Edge Polygon (EP) command. PM polygon definition [;] or PM [;] Parameter Format Functional Range Default polygon definition clamped integer 0, 1, and 2 0 In polygon mode, you define the area of the polygon(s) using graphics commands.
Table 21-19 Polygon Mode Allowable Commands Group DF, Default Values The Configuration/Status Group IN, Initialize AA, Arc Absolute The Vector Group AR, Arc Relative AT, Absolute Arc Three Point BR, Bezier Relative BZ, Bezier Absolute CI, Circle PA, Plot Absolute PD, Pen Down PE, Polyline Encoded PR, Plot Relative PU, Pen Up RT, Relative Arc Three Point PM1/PM2, Polygon Mode The Polygon Group The polygon buffer stores the lines (vectors) that define your polygon.
commands (PA0,1750;PM0), the absolute coordinates (0,1750) specify the first point of your polygon. Each subsequent pair of coordinates defines a point, or vertex, of the polygon. You can define points with the pen up or down. However, the EP command only draws between points that are defined when the pen is down. On the other hand, the FP command fills the area(s) between all vertices, regardless of whether the pen is up or down when defined.
(PM2) Use (PM2) to close the current polygon (or subpolygon) and exit polygon mode. Remember, if you have not closed your polygon, executing (PM2) adds a point to close the polygon. Refer to “Pen Status and Location” in Chapter 17, Introduction to HP-GL/2 Graphics. The following example draws the surface area of a 3-prong electrical receptacle as a series of subpolygons, then fills and edges it using the FP and EP commands, respectively. Table 21-20 Example: Using the PM Command EN ?E Reset the printer.
Table 21-20 Example: Using the PM Command (continued) PD2920,2340,2920, 2660,2720,2660; Begin a third subpolygon that draws the ground plug portion of the receptacle. AA2720,2500,180; PD2920,2340; Store a 180° arc that goes from (2720,2660) to (2720,2500). PM2;FP;EP; Close the subpolygon and exit polygon mode. Fill (even/odd), then edge the polygon and subpolygons currently stored in the buffer. ?%0A Enter the PCL mode. ?E Send a reset to end the job and eject the page.
RA, Fill Rectangle Absolute This command defines and fills a rectangle using absolute coordinates. Use RA to fill rectangular shapes in drawings. (To outline a rectangle using absolute coordinates, use the EA command.) RA X,Y[;] Parameter Format Functional Range Default X,Y coordinates current units -230 to 230 - 1 no default The RA command defines and fills a rectangle using the current pen, the current line and fill types, and absolute X,Y coordinates.
The only difference between the RA command and the EA (Edge Rectangle Absolute) command is that the RA command produces a filled rectangle, and EA, an outlined one. The RA command clears the polygon buffer and then uses it to define the rectangle before drawing. Refer to “Using the Polygon Buffer” earlier in this chapter. The following example uses RA with three different fill types to create rectangles such as those you might use in a bar chart.
Table 21-22 Example: Using the RA Command with Different Fill Types (continued) PA1200,1200;FT3 , 50;RA1600,1600; EA1600,1600; Move to absolute position (1200,1200) and select fill type 3, with a 50 plu distance between each line. Draw a rectangle with (1200,1200) as the lower left corner and (1600,1600) as the upper right. Using the default line type, edge the rectangle just drawn. PA1200,1600;FT4 ; RA1600,2000; EA1600,2000; Move to (1200,1600) and select the cross-hatch pattern fill type.
Table 21-23 (continued) The Line and Fill Attributes Group FT, Fill Type LT, Line Type RF, Raster Fill Definition RR, Fill Rectangle Relative This command defines and fills a rectangle using relative coordinates. Use RR to fill rectangular shapes in drawings. (To outline a rectangle using relative coordinates, use the ER command.
Figure 21-24Fill Rectangle Relative The only difference between the RR command and the ER (Edge Relative Rectangle) command is that the RR command produces a filled rectangle, and ER, an outlined one. The RR command clears the polygon buffer and then uses it to define the rectangle before drawing. A rectangle requires enough buffer space to hold five points.
Table 21-24 Example: Using the RR Command with Different Fill Types (continued) PR0,800;FT3,50; RR400,400; Enter the relative plotting mode and move 800 plu in the Y direction and select fill type 3 (parallel lines). Draw a rectangle using the current pen location as the lower left corner; the upper right corner is 400 plu to the right and 400 plu up from the lower left corner. PR0,400;FT4; RR400,400; Move 400 plu up and select fill type 4 (crosshatching).
Figure 21-25 Table 21-25 Related Commands Group EA, Edge Rectangle Absolute The Polygon Group EP, Edge Polygon ER, Edge Rectangle Relative FP, Fill Polygon RA, Fill Rectangle Absolute WG, Fill Wedge This command defines and fills any wedge. Use WG to draw filled sections of a pie chart.
The WG command defines and fills a wedge using the current pen, fill type, and line types. The WG command includes an automatic pen down. When the command operation is complete, the original pen location and up/down status are restored. The only difference between the WG command and the EW (Edge Wedge) command is that the WG command produces a filled wedge, and the EW, an outlined one. Always use isotropic scaling in any drawing that contains wedges (to avoid drawing an elliptical wedge).
z Sweep Angle — Specifies in degrees the angle through which the arc is drawn. A positive angle draws the angle in the positive direction (angle of rotation - +X-axis to the +Y-axis); a negative angle draws the angle in the negative direction (+X-axis to the – Y-axis). (Note, the relation of the +X-axis to the +Y-axis/–Y-axis can change as a result of scaling point or scaling factor changes.) If a sweep angle greater than 360 degrees is specified, a 360-degree angle is used.
Table 21-26 Example: Filling then Edging vs. Edging then Filling Chart ?E Reset the printer. ?%0B Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. SC-3000,3000, -2000,2000,1; Set up user scaling, with P1 being (-3000,-2000) and P2 being (3000,2000). Specify isotropic scaling. PA0,0;FT3,75,45; WG-1000,90,180; Enter absolute plotting mode and move to user-unit position (0,0).
Table 21-26 Example: Filling then Edging vs. Edging then Filling Chart (continued) ?%0A Enter the PCL mode. ?E Send a reset to end the job and eject the page. Figure 21-28 The center point of the above circle is located at (0,0). Note When transparency mode (TR command) is opaque, filling then edging an object may produce different results from edging and then filling. This is especially true when large pen widths are used. The following example illustrates this.
Table 21-27 Example: (continued) PW5; Select pen width of 5 units. PM0; Enter polygon mode. CI1000; Draw a circle with a radius of 1000 units. PM2; Close polygon and exit polygon mode. FT10,30; Select 30% shading fill type. FP;EP; Fill then Edge polygon. PU4000,3000; Select pen position (4000, 3000) for second circle. PM0; Enter polygon mode. CI1000; Draw another circle with a radius of 1000 units. PM2; Close polygon and exit polygon mode. EP;FP; Edge then fill polygon (circle).
Table 21-28 Related Commands Group EP, Edge Polygon The Polygon Group EW,Edge Wedge EN SC, Scale The Configuration/Status Group CI, Circle The Vector Group FP, Fill Polygon The Polygon Group FT, Fill Type The Line and Fill Attributes Group WG, Fill Wedge 21-51
21-52 The Polygon Group EN
22 The Line and Fill Attributes Group Introduction The information in this chapter enables you to achieve the following results in your HP-GL/2 applications: z Enhance your drawings with various line types. z Enhance your drawings with different fill types. z Position fill type patterns. The following commands are described in this chapter: Table 22-1 EN The Line and Fill Attribute Commands Command Summary AC, Anchor Corner Specifies the starting point for fill patterns.
Table 22-1 The Line and Fill Attribute Commands SV, Screened Vectors Selects the type of area fill to be applied to vectors (lines, cross-hatch lines, arcs, circles, edges of polygons, rectangles, and wedges). TR, Transparency Mode Defines how the white areas of the source graphics image affect the destination graphics image. UL, User-Defined Line Type Defines a line pattern.
Figure 22-2 Line Types Attribute Once you specify a line type and line attributes, all lines created by the following commands are drawn using the new line type and attributes. Line types and their interactions with fill patterns are discussed later in this chapter. Table 22-2 Commands Affectedby Line Types Command Group AA, Arc Absolute AR, Arc Relative AT, Absolute Arc Three Point BR,.Bezier Relative BZ,.
Table 22-2 Commands Affectedby Line Types (continued) EW, Edge Wedge FP, Fill Polygon RA, Fill Rectangle Absolute RR, Fill Rectangle Relative WG, Fill Wedge Using Fill Types Using the Fill Type (FT) command adds detail to your drawings and increases their visual effectiveness. The fill type affects the RA (Fill Rectangle Absolute), RR (Fill Rectangle Relative), WG (Fill Wedge), FP (Fill Polygon) commands, and CF (Character Fill) commands.
Figure 22-4 Fill Area Anchor Corner Use the AC (Anchor Corner) command to position the fill type in relation to the figure. Rectangle 3 has an anchor corner set in its the lower-left corner. Rectangle 4 has an anchor corner set below the lower-left corner to alter the pattern’s position and give contrast to the adjacent figure.
AC, Anchor Corner This command positions the starting point of any fill pattern. Use AC to ensure that the selected fill pattern is positioned as expected within the figure. AC X,Y[;] or AC [;] Parameter Format Functional Range Default X,Y coordinates current units -230 to 230 - 1 no default The ‘anchor corner’ is the point at which any fill pattern starts.
Table 22-3 EN Example: Changing the Anchor Corner (continued) SP1; Select pen number 1. The SP command must be used to enable printing. PA3000,3000; Specify absolute plotting and move to location (3000,3000).
Figure 22-5 Table 22-4 Related Commands Group FT, Fill Type The Line and Fill Attributes Group RF, Raster Fill Definition SV, Screened Vectors FP, Fill Polygon The Polygon Group RA, Fill Rectangle Absolute RR, Fill Rectangle Relative WG, Fill Wedge 22-8 The Line and Fill Attributes Group EN
FT, Fill Type This command selects the shading pattern used to fill polygons (FP), rectangles (RA or RR), wedges (WG), or characters (CF). Use FT to enhance drawings using solid fill, shaded fill, parallel lines (hatching), cross-hatch, patterned (raster) fill, or PCL user-defined patterns.
Table 22-5 (continued) 4 cross-hatch spacing of lines angle of lines 10 shading shading level ignored 11 HP-GL/2 user-defined raster-fill index ignored 21 PCL cross-hatch patterns pattern type ignored 22 PCL user-defined pattern ID ignored For fill types 3 and 4, the option1 parameter specifies the distance between the lines in the fill. This distance is specified in current units measured along the X-axis.
Note The relationship of the +X-axis to the +Y-axis (and the -Y-axis) can be changed as a result of scaling point or scaling factor changes, thus changing the direction of a positive (and negative) angle of rotation. Types 3 and 4 use the current pen and line type defined by the Line Type, Pen Width, and Line Attribute commands. If the spacing between lines is defined in plotter units (no Scale command used), turning scaling on or changing the locations of P1 and P2 has no affect on the spacing.
Figure 22-7 HP-Defined Shading Patterns For fill type 11, the option1 parameter selects the corresponding HP-GL/2 user-defined raster fill using the index number specified in the RF command. Refer to the Raster Fill Definition (RF) command for more information about creating user-defined fill types. If you have not issued an RF command, the printer uses solid fill.
For fill type 21, the option1 parameter selects one of the six predefined PCL cross-hatch patterns using a value between 1 and 6. The following illustration shows the six different PCL cross-hatch patterns, and their corresponding parameter numbers. Figure 22-9 PCL Cross-Hatch Patterns For fill type 22, the optional parameter selects the corresponding PCL user-defined pattern specified by way of the ?*c#W command. Option1 specifies the pattern associated with the user-defined fill pattern.
Table 22-6 Example: Using the FT Command (continued) PA2000,2000; Specify absolute plotting and move to location (2000,2000). FT;RR2500,300; ER2500,300; Select the default fill type (solid black); fill a rectangle using solid black fill, with the lower left corner being the current pen location and the upper right corner a point 2500 plu to the right and 300 plu up; edge the rectangle that was just filled.
Table 22-7 Related Commands Group LA, Line Attributes The Line and Fill Attributes Group LT,Line Type PW,Pen Width RF,Raster Fill Definition FP, Fill Polygon The Polygon Group RA, Fill Rectangle Absolute RR, Fill Rectangle Relative WG, Fill Wedge CF, Character Fill Mode The Character Group SV, Screened Vectors The Line and Fill Attributes Group LA, Line Attributes Specifies how line ends and line joins are physically shaped. Use this command when drawing lines thicker than 0.35 mm.
There are three line attributes: line ends, line joins, and the miter limit. The LA command parameters are used in pairs: the first parameter, kind, selects a line attribute, and the second parameter, value, defines the appearance of that attribute. The printer uses the current line attributes when the optional parameter pairs are omitted. z No Parameters — Defaults the line attributes to butt ends, mitered joins, and a miter limit of 5. Equivalent to (LA1,1,2,1,3,5).
Note Labels are always drawn with rounded ends and joins. Line Ends The value you specify for line ends determines how the ends of line segments are shaped. The following illustration describes the four types of line ends. Figure 22-11Four Line Ends Line Joins The value you specify for the line joins attribute determines how connecting line ends (corners) are shaped. The following illustration describes the five types of line joins.
Figure 22-12Five Line Joins When you select ‘no join’ (LA2,6;), the currently selected line ends for the two lines merely overlap. Refer to the following illustration.
Miter Limit The value you specify for miter limit determines the maximum ‘length’ of a mitered join, as shown in the following illustration. The miter limit is the ratio of the miter length (the length of the diagonal line through the join of two connecting lines), to the line width. For example, with the default miter limit of 5, the miter length can be as long as 5 times the line width.
The following example draws an electrical ground symbol using the LA command. Table 22-9 Example: Using the LA Command ?E Reset the printer. ?%0B Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. PA4000,3000; Specify absolute plotting and move the pen to (4000,3000).
Figure 22-16 Table 22-10 Related Commands Group FT, Fill Type The Line and Fill Attributes Group LT, Line Type PW, Pen Width UL, User-Defined Line Type AA, Arc Absolute The Vector Group AR, Arc Relative AT, Absolute Arc Three Point BR, Bezier Relative BZ, Bezier Absolute CI, Circle RT, Relative Arc Three Point EA, Edge Rectangle Absolute The Polygon Group EP, Edge Polygon ER, Edge Rectangle Relative EW, Edge Wedge FP, Fill Polygon RA, Fill Rectangle Absolute RR, Fill Rectangle Relative WG, Fill Wedg
LT, Line Type This command specifies the line pattern to be used when drawing lines. Use LT to vary lines and enhance your plot. Note that the ends of dashed line segments in a line pattern are affected by current line attributes (refer to the LA command earlier in this chapter).
z Positive line types (1 - 8) are fixed line types and use the specified pattern length to draw lines. Any unused part of the pattern (the residue) is carried over into the next line. The residue is saved when any of the following commands are received: CI, EA, EP, ER, EW, FP, PM, RA, RR, or WG. The residue is restored when the current pen position is restored upon completion of these HP-GL/2 commands.
A zero line type (0) draws only a dot at the X,Y coordinates for AA, AR, AT, CI, PA, PD, PR, and RT commands. Zero pen down values and zero length lines also produce dots. A dot is a one plotter unit long vector, drawn using the current line end and pen width. (Dots within lines are drawn at the correct angle, but zero length vectors are drawn along the user’s current X-axis.) Negative line types (-1 - -8) are adaptive line types.
Table 22-12 Commands that Affect LT99 (continued) SP,Select Pen TR,Transparency Mode UL,User-Defined Line Type WU,Pen Width Unit Selection DF,Default Values The Configuration IN,Initialize and Status Group IP,Input P1 and P2 IR,Input Relative P1 and P2 IW,Input Window RO,Rotate Coordinate System SC,Scale Figure 22-17 first shows the line type patterns, then gives the pattern percentages. Note EN Do not use an adaptive line type when drawing circles, arcs, wedges, or polygons.
Figure 22-17Line Type Patterns and Pattern Percentages z Pattern Length- Specifies the length of one complete line pattern, either as a percentage of the diagonal distance between the scaling points P1 and P2 or in millimeters (see mode below). You must specify a length greater than zero or the printer ignores the command. If you do not specify a length, the printer uses the last value specified. z Mode- Specifies how the values of the pattern length parameter are interpreted.
z 1 - Absolute mode. Interprets the pattern length parameter in millimeters. z When specified in millimeters, fixed line-type patterns assume the specified length, but adaptive line-type pattern lengths are adjusted to fit an integral number of patterns per vector. (This is true for relative mode and absolute mode.) If you do not specify the pattern length and mode parameters, then the printer uses their current values.
Table 22-13 AA,Arc Absolute The Vector Group AR,Arc Relative AT,Absolute Arc Three Point CI,Circle PA,Plot Absolute PD,Pen Down PE,Polyline Encoded PR,Plot Relative RT,Relative Arc Three Point EA,Edge Rectangle Absolute The Polygon Group EP,Edge Polygon ER,Edge Rectangle Relative EW,Edge Wedge FP,Fill Polygon RA,Fill Rectangle Absolute RR,Fill Rectangle Relative WG,Fill Wedge 22-28 The Line and Fill Attributes Group EN
PW, Pen Width This command specifies a new width for the logical pen. Subsequent lines are drawn in this new width. Use PW to vary your lines and enhance your drawings. Pen width can be specified as a fixed value or relative to the distance between P1 and P2. The pen width units are selected via the WU command (the default is metric-millimeters). PW width[,pen;] or PW [;] Parameter Format Functional Range Default width clamped real -32768 to 32767 Dependent1 pen integer 0 or 1 1 (Black) 1.
z Note Pen- Specifies the pen number to which the new width applies. If the pen parameter is not specified, the printer applies the width to both pens. Specifying pen numbers other than 0 or 1 causes the printer to ignore the command. Pen width does not set the width of lines for drawing labels (unless the stroke weight value is set to 9999 [Stick/Arc fonts only]).
Table 22-14 Example: Using the PW Command (continued) ?%0A Enter the PCL mode. ?E Send a reset to end the job and eject the page.
RF, Raster Fill Definition This command defines a rectangular pattern that may be used as area fill and for screened vectors (see the SV command). Use RF to create your own fill types and screen patterns. RF index,width,height,pen number[,...
Note A pixel is equal to the size of one dot at the current printer resolution. z Pen Number - Represents a pixel in the pattern being defined and indicates its color (black or white). 0- White >0 - Black The pen number parameter defines pixels left to right, top to bottom. The total number of pen number parameters should be equal to the width times height parameters. For example, to define a pattern that is 8 x 16 pixels, you need 128 pen number parameters.
Table 22-16 Example: Creating and Printing a Fill Pattern RR4000,800;EP; Fill a rectangle with the fill pattern just specified, with a lower left corner of (3500,2500) and an upper right corner 4000 plu to the right and 800 plu up; edge the outline of the rectangle. ?%0A Enter the PCL mode. ?E Send a reset to end the job and eject the page.
SM, Symbol Mode This command draws the specified symbol at each X,Y coordinate point using the PA, PD, PE, PR, and PU commands. Use SM to create scattergrams, indicate points on geometric drawings, and differentiate data points on multiline graphs.
The following example shows several uses of symbol mode: with the pen down for a line graph, with the pen up for a scattergram, and with the pen down for geometric drawings. Note Symbol mode works only with the PA, PD, PE, PR, and PU commands. Notice that the circle and rectangle have symbols only for the PA command coordinate point. Table 22-18 Example: Using the Symbol Mode Command ?E Reset the printer. ?%0B Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1.
Table 22-18 Example: Using the Symbol Mode Command PA4600,1590;SMX; PA3300,1100;PU; Draw a line to (4600,1590) and print a “Z”; specify “X” as the next symbol, move to (3300,1100), and print an “X”; lift the pen. SMA;PA4000,400; CI400; Specify “A” as the new symbol and move to (4000,400); draw a circle with a radius of 400 plu and print an “A” in the center.
SP, Select Pen This command selects the printer’s ‘logical’ pen for subsequent plotting. An SP command must be included at the beginning of each command sequence to enable the printer to draw. SP pen number[;] or SP [;] Parameter Format Functional Range Default pen number integer 0 or 1 No pen Although your printer does not have physical pens, for the purpose of compatibility it has a ‘logical’ pen which you must select to print your drawing.
Table 22-20 Related Commands Group PW, Pen Width The Line and Fill Attributes Group WU, Pen Width Unit Selection TR, Transparency Mode SV, Screened Vectors This command selects the type of screening (area fill) to be applied to vectors. Options include lines, hatching patterns (fill types 3 and 4), arcs, circles, edges of polygons, rectangles, wedges and PCL user-defined patterns. SV does not affect solid fill types, stroked characters, or edges of characters.
z screen_type— Selects the types of screening as follows: • 0— No screening • 1— Shaded fill • 2— HP-GL/2 User-defined raster fill (RF command) • 21— Predefined PCL cross-hatch patterns • 22— PCL user-defined raster fill (RF command) • Option1, Option2— The definition of these optional parameters depends on the screen type selected. The following table lists the options available for each fill type.
For Type 22, the optional parameter selects the corresponding PCL user-defined pattern specified by way of the ?*c#W command. Option1 specifies the pattern associated with the user-defined fill pattern. Option2 is ignored if present. See “User-Defined Pattern Graphics” in Chapter 13 for a discussion of PCL user-defined patterns. All parameters are optional. If all parameters are omitted, screening is turned off (the vectors are solid).
TR, Transparency Mode This command defines how the white areas of the source graphics image affect the destination graphics image. TR [n][;] or TR [;] Parameter Format Functional Range Default n clamped integer 0 or 1 1 (on) z No Parameters— Defaults to transparency mode = on (TR1;). z n— Specifies whether transparency mode is on or off: z 0— Transparency mode = off. z 1— Transparency mode = on (default).
When transparency mode is off, all source pixels are written to the destination, obscuring any underlying images. Figure 22-23Transparency Mode = OFF The transparency mode is defaulted by the ?E Reset, IN, or DF commands. Note EN For more information on the transparency mode, see the discussion of the “Source Transparency Mode” in Chapter 13, The PCL Print Model.
UL, User-Defined Line Type This command creates line types by specifying gap patterns, which define the lengths of spaces and lines comprising a line type. UL index [,gap1,...,gap20;] or UL [;] Parameter Format Functional Range Default index clamped integer 1 through 8 — gaps clamped real 0 to 32767 default line types The UL command allows you to define and store your own line types. The command does not itself select a line type.
The following example demonstrates redefining and printing a line type. Table 22-24 Example: Using the UL Command ?E Reset the printer. ?%0B Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. PA4000,3000; Specify absolute plotting and move to (4000,3000).
Table 22-25 Related Commands Group LA, Line Attributes The Line and Fill Attributes Group LT, Line Type Table 22-26 POSSIBLE ERROR CONDITIONS: Condition Printer Response sum of gap parameters equals zero ignores command a gap is negative ignores command index = 0 or|index| > 8 ignores command WU, Pen Width Unit Selection This command specifies how the width parameter of the Pen Width (PW) command is interpreted (whether metric or relative units).
z Type — Specifies how the width parameter of the Pen Width (PW) command is interpreted. • 0 — Metric. Interprets the pen width parameter in millimeters. Specifying type 0 defaults all pen widths to 0.35mm. • 1 — Relative. Interprets the pen width parameter as a percentage of the diagonal distance between P1 and P2. Specifying type 1 defaults all pen widths to 0.1% of the diagonal distance from P1 to P2. If the specified type parameter is not 0 or 1, the printer ignores the command.
22-48 The Line and Fill Attributes Group EN
23 The Character Group Introduction When you create an HP-GL/2 graphic and want to add text, you can either enter PCL mode to add text to your image or you can print text from within HP-GL/2 mode. If this is your first experience with HP-GL/2, you should know that the term “label” is used throughout this chapter to indicate the printing of text. This chapter discusses the various ways you can “label” your images using the printer’s vector graphics commands.
Table 23-1 The Character Group Commands (continued) DR,Relative Direction Specifies the slope of labels relative to P1 and P2 locations. DT,Define Label Terminator Defines the character or code that ‘turns off’ labeling. DV,Define Variable Text Path Specifies the label path as right, left, up, or down. ES,Extra Space Increases or reduces space between label characters and lines. FI,Select Primary Font Selects as standard a font previously assigned a PCL font ID number.
Table 23-1 The Character Group Commands (continued) TD, Transparent Data Specifies whether control characters perform their function or are printed as characters when printing text. Printing Labels Use the Label command (LB) to create text charts or to emphasize areas of a diagram or graph that need special attention or explanation. You can control almost all aspects of the label’s appearance: its position, size, slant, spacing, and direction.
Note In the examples in this chapter, the left column identifies the command sequence data for the plot. If the label command text is too wide for the column width, is it continued on a second line (which might indicate a Carriage Return in the text). In actual use, the text should be presented on one line, with no carriage-returns. If a Carriage Return is required in the example, it is indicated as “CR-LF.” Table 23-2 Example: Printing Labels E CE Reset the printer. E C%0B Enter HP-GL/2 mode.
Figure 23-1 Moving to the Carriage Return Point When you begin labeling, the current pen location is the Carriage Return point (the beginning of your line of text is the point at which the pen is “returned” when a Carriage Return control code is sent to the printer). When the printer encounters a Character Plot (CP) command, or a Carriage Return control code within a Label command, the pen moves to the Carriage Return point, adjusted up or down by any line feeds.
Table 23-3 Commands Updating Carriage Return Point to Current Location (continued) DV Define Variable Text Path IN Initialize LO Label Origin PA Plot Absolute PE Polyline Encoded PR Plot Relative RO Rotate Coordinate System RT Relative Arc (Three Point) 1. A PD or PU command with parameters also updates the Carriage Return point. The CP command with a nonzero lines parameter updates the Carriage Return point’s vertical location.
Table 23-4 Commands Updating Carriage Return Point to Current Location (continued) Shift In2 15 Space 32 1. Equivalent to Select Alternate Font (SA) command. 2. Equivalent to Select Standard Font (SS) command. Default Label Conditions The following label default conditions are established when the printer is initialized, or set to default conditions. To change these settings, refer to the appropriate chapter or command. EN z Symbol Set (Character Set) — Roman-8. z Font Spacing — Fixed.
Enhancing Labels You can enhance your labels by changing such aspects as the character size and slant, the space between characters and lines, and the orientation and/or placement of the label on the page. To effectively use these enhancements you should understand the properties of the character cell. Refer to “Working with the Character Cell” later in this chapter.
You can use the Character Plot (CP) command to move the pen a specific number of lines or spaces (character cells) from the current pen location. Use the CP command, for example, to indent a label a certain number of spaces. Label Orientation and Placement You can place your labels anywhere on the page in any orientation. The Absolute Direction (DI) command specifies the angle at which you want to print the characters, independent of the location of P1 and P2.
The Define Variable Text Path (DV) command allows you to specify the text path (right, left, up, or down) and the direction of Line Feeds with respect to the text path. Figure 23-3 Define Variable Text Path Command The Label Origin (LO) command simplifies placing labels on a drawing. Normally, the first character origin is the current pen location when the Label command is issued. The LO command allows you to specify that the label be centered and/or right- or left-justified from the current pen location.
These lines use one (X,Y) coordinate pair, one LO command to center labels, and a Carriage Return and Line Feed after each line. Without this command, an alternative method would involve calculating the length of the line in CP (Character Plot) cells, dividing by two, and using the CP command to ‘Backspace’ the required number of cells.
Working with the Character Cell In each font, the basis for each character or space is the character cell. Think of the character cell as a rectangular area around a character that includes blank areas above and to the right of the character. Refer to the Figure 23-5. Figure 23-5 The Character Cell and HP-GL/2 Table 23-5 Term Description Baseline The imaginary line on which a line of text rests. A character’s descender (such as the bottom of a lowercase “g”) extends below the baseline.
Table 23-5 (continued) Cap Height The distance from the baseline to the top of a capital letter. Character Origin The point at which the baseline meets the left edge of the character cell. Character Width The lateral area allocated for character rendering. Character Plot (CP) Cell Width The distance from the left edge of one character to the beginning of the next character.
Figure 23-7 Stick Font Character Cell When you use the SI (Absolute Character Size) or SR (Relative Character Size) commands to change the size of the characters, or use the ES (Extra Space) command to add extra space around them, you alter the size of the CP (Character Plot) cell. You can control almost all aspects of the label’s appearance: its position, size, slant, spacing, and direction. This chapter explains the commands that control these features.
Using Fonts In HP-GL/2 mode, the printer uses three different types of fonts: z Scalable fonts — Characters can be displayed at any size. The characters are defined as a set of points on the outline of a character and corresponding mathematical relationships describing the interaction between these outline points. A scalable outline character can be resized (using SI and SR), rotated (using DI and DR), and distorted (using SL). z Bitmap fonts — Characters defined as an array of dots in a raster pattern.
Figure 23-8 and Figure 23-9 show the difference between fixed-spaced and proportional fonts. Figure 23-8 Fixed-Spaced Font With proportional fonts, the actual space occupied by each character varies according to the character’s width (Figure 23-9).
When printing proportional fonts, the Character Plot (CP) command uses the width of the Space control code to determine horizontal spaces and the Line Feed height for determining vertical spacing. The Extra Space (ES) command uses the horizontal escapement distance (a font metric) to compute horizontal spaces and the Line Feed height for determining vertical spacing. Both of the character size commands (SI and SR) use cap height and average character width in calculating character size.
AD, Alternate Font Definition This command is similar to the Standard Font Definition (SD) command that defines the primary HP-GL/2 font. In addition the AD command defines an alternate HP-GL/2 font and its characteristics: font spacing, pitch, height, posture, stroke weight, and typeface. It allows the font characteristics to be assigned to the secondary (alternate) font definition. Use AD to set up an alternate font that you can easily access when labeling. AD kind,value...
Table 23-6 (continued) 6 Stroke Weight 0 medium 7 Typeface 48 Stick (fixed vector) z Value — Defines the properties of the characteristic specified by the kind parameter. Note When selecting fonts, the different characteristics (symbol set, spacing, pitch, etc.) are prioritized as shown in the table above, with symbol set being the highest priority and typeface being the lowest. The font selection priority is the same for HP-GL/2 as for PCL font selection.
Table 23-7 (continued) SA, Select Alternate Font SB, Scalable or Bitmap Fonts SD, Standard Font Definition SI, Absolute Character Size SR, Relative Character Size SS, Select Standard Font TD, Transparent Data CF, Character Fill Mode The Character Fill Mode command specifies the way scalable fonts are filled and edged; bitmap and Stick fonts cannot be edged and can be filled only with raster fill, shading, or PCL cross-hatch patterns.
z Fill mode— Specifies how the printer renders filled characters according to the following parameter values. • 0— Specifies solid fill using the current pen and edging with the specified pen (or current pen if the edge pen parameter is not specified). • 1— Specifies edging with the specified pen (or current pen if the edge pen parameter is not specified). Characters are filled only if they cannot be edged (bitmap or stick characters), using the edge pen.
The thickness of fill lines for hatching and cross hatch is selected using the PW (Pen Width) command. Due to the way hatching and cross-hatch lines are drawn, they may extend beyond the character outline by up to 1/2 of the current pen width. When using a small pen width and specifying a black edge pen, the edging covers up hatching lines that extend outside the character outline.
Table 23-8 Example: Using the CF Command (continued) PW.1;CF3,1;LBB*; Set the pen width to .1 mm; select character fill mode 3 (fill & edge) and edge with pen number 1 (black); print the letter “B”. PW.5;LBC*; Set the pen width to .5 mm to change the thickness of the fill lines; print the letter “C”. E C%0A Enter the PCL mode. E CE Send a reset to end the job and eject the page.
CP, Character Plot This command moves the pen the specified number of spaces and lines from the current pen location. Use CP to position a label for indenting, centering, etc. CP spaces,lines [;] or CP [;] Parameter Format Functional Range Default spaces clamped real –32768 to 32767 no default lines clamped real –32768 to 32767 no default The CP (Character Plot) command includes an automatic pen up. When the command is completed, the original pen up/down status is restored.
z Lines — Specifies the number of lines the pen moves relative to the current pen location. Positive values specify the number of lines the pen moves up from the current pen position; negative values specify the number of lines the pen moves down (a value of –1 is equivalent to a Line Feed). Up and down are relative to the current label direction. The Line Feed distance is uniquely defined for each font; use the Extra Space (ES) command to adjust the height.
The following illustration shows the direction of labeling with a vertical text path (set by (DV1) or (DV1,0); refer to the Define Variable Text Path (DV) command for more information). Figure 23-13Labeling with a Vertical Text Path The following example produces lettering along a line (but not directly on top of it), and aligns labels along a left margin. Movement of the Carriage Return point is demonstrated, as well as different methods of placing the text.
Table 23-10 Example: Using the CP Command EN PA5000,2500; PD1500,2500; PU; Specify absolute plotting and move to (5000,2500); set the pen down and draw a line to (1500,2500); lift the pen. CP5,.35; Move the pen 5 spaces to the right and .35 lines up so that the label is placed just above the line. DT$,1; Define a label terminator ($) and specify that it does not print. SD1,21,2,1,4,14,5, 0,6,3,7,4148;SS; Designate a 14-point Univers Bold font and select it.
Figure 23-14 Table 23-11 Related Commands Group DI, Absolute Direction The Character Group DR, Relative Direction DV, Define Variable Text Path ES, Extra Space LB, Label LO, Label Origin SB, Scalable or Bitmap Fonts SI, Absolute Character Size SR, Relative Character Size 23-28 The Character Group EN
DI, Absolute Direction This command specifies the slope or direction at which characters are drawn, independent of P1 and P2 settings. Use DI to change labeling direction when you are labeling curves in line charts, schematic drawings, blueprints, and survey boundaries.
You can express the parameters in measured units as rise and run, or using the trigonometric functions cosine and sine according to the following relationship. Where: run and rise = number of measured units θ = the angle measured in degrees sin θ/cos θ = rise/run θ = tan–1(rise/run) and tan θ = sin θ/cos θ Note that the run and rise determine the slope or angle of an imaginary line under the base of each character in the label. Refer to the following illustration.
Figure 23-16Effect of Horizontal and Vertical Text Paths Note If an SB1; command has been sent, the printer draws the label along the nearest perpendicular. In the case of bisection, the angle is rounded down (e.g., 45° would round to 0°). Refer to the following illustration. Figure 23-17Scalable Versus Bitmap Variable Text Path Printing Suppose you want your label plotted in the direction shown in the following illustration.
Figure 23-18Label Print Direction Rise and Run To measure the run and rise, first draw a grid with the lines parallel to the X- and Y-axis. The grid units should be the same size on all sides, but their actual size is irrelevant. Then, draw a line parallel to the label and one parallel to the X-axis. The lines should intersect to form an angle. Select a point on the open end of your angle (where another line would create a triangle).
When using either method, at least one parameter must not be zero. The ratio of one parameter to the other is more important than the actual numbers. The following table lists three common label angles produced by using 1’s and 0’s. Table 23-13 DI Command Label Direction DI 1,0 horizontal DI 0,1 vertical DI 1,1 or DI 0.7,0.7 (or any parameters equal to each other) 45° angle The relative size and sign of the two parameters determine the amount of rotation.
Table 23-14 Example: Using the DI Command (continued) DI-1,-1;LB DIRECTIONCR*; Print the same word in the third quadrant and Carriage Return. DI-1,1;LB DIRECTIONCR*; Print the word in the fourth quadrant and Carriage Return. E C%0A Enter the PCL mode. E CE Send a reset to end the job and eject the page.
Table 23-15 Example: Another DI Example EN E CE Reset the printer. E C%0B Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. PA3500,2500; Specify absolute plotting and move to (3500,2500). DT#,1; Define the “#” character as the label terminator. DI0,1;LB__1990#; Set the label direction to print at 90° and print “__1990”.
Figure 23-20 Table 23-16 Related Commands Group CF, Character Fill Mode The Character Group CP, Character Plot DR, Relative Direction DV, Define Variable Text Path LB, Label SB, Scalable or Bitmap Fonts SI, Absolute Character Size SL, Character Slant SR, Relative Character Size Table 23-17 POSSIBLE ERROR CONDITIONS Error Condition Printer Response both parameters = 0 or number out of range ignores command 23-36 The Character Group EN
DR, Relative Direction This command specifies the direction in which labels are drawn, relative to the scaling points P1 and P2. Label direction is adjusted when P1 and P2 change so that labels maintain the same relationship to the scaled data. Use DR to change labeling direction when you are labeling curves.
You define the parameters of run and rise as shown in the following illustration: Figure 23-21Rise and Run Parameters With the DR command, the use of run and rise is somewhat different than with DI. Run is expressed as a percentage of the horizontal distance between P1 and P2; rise is expressed as a percentage of the vertical distance between P1 and P2.
The following illustration shows the effects of using three different sets of run/rise parameters. Notice how the text baseline varies as the run percentage is greater than, equal to, and less than the value for rise. Figure 23-22Effects of Different Rise/Run Parameters If the P1/P2 rectangle is square, the DR and DI commands have exactly the same effect.
Figure 23-23Effects of Scaling on Label Direction Labels begin at the current pen location and thus are drawn parallel to the directional line, not necessarily on it. Also, negative parameters have the same effect on direction as described for the DI command. At least one parameter must not be zero. The ratio of the parameters to each other is more important than the actual numbers. The table below lists three common label angles produced by using ones and zeros.
Figure 23-24Varying Print Direction with DR Command Parameter Sign A DR command remains in effect until another DR or DI command is executed, or until the printer is initialized or set to default conditions. Example:Using the DR Command This example illustrates the use of positive and negative parameters, how the LB command updates the current pen location, and how DR updates the Carriage Return point. Note that this is the same example shown with the DI command.
Table 23-20 Example: Using the DR Command E CE Reset the printer. E C%0B Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1 (black). PA3500,2500; Specify absolute plotting and move to (3500,2500). DT#,1; Define the “#” character as the label terminator. DR0,1;LB __1990#; Set the label direction and print “__1990”. DR1,1;LB __1991#; Set the label direction and print “__1991”. DR1,0;LB__1992#; Set the label direction and print “__1992”.
Figure 23-25 Table 23-21 Related Commands Group CF, Character Fill Mode The Character Group CP, Character Plot DI, Absolute Direction DV, Define Variable Text Path LB, Label SB, Scalable or Bitmap Fonts SI, Absolute Character Size SL, Character Slant SR, Relative Character Size IP, Input P1 and P2 The Configuration/Status Group IR, Input Relative P1 and P2 EN DR, Relative Direction 23-43
Table 23-22 POSSIBLE ERROR CONDITIONS: Error Condition Printer Response both parameters = 0 or number out of range ignores command DT, Define Label Terminator This command specifies the character to be used as the label terminator and whether it is printed. Use DT to define a new label terminator if you desire a different one or if your computer cannot use the default (ETX, decimal code 3).
z Mode— Specifies whether the label terminator is printed. 0— The label terminator prints if it is a printable character and performs its function if it is a control code. 1— (Default) The label terminator does not print if it is a printing character and does not perform its function if it is a control code. A DT command remains in effect until another DT command is executed, or the printer is initialized or set to default conditions.
DV, Define Variable Text Path This command specifies the text path for subsequent labels and the direction of Line Feeds as either right, left, up, or down. Use DV to “stack” characters in a column.
• 3 — –270 degrees.(Up) Within a label, each character begins above the previous character. This is a vertical text path (unless altered by DI or DR). The following illustration shows the four text paths. Figure 23-26Four Text Paths EN z Line— Specifies the location of each character with respect to the preceding character, relative to the labeling direction defined by the DI or DR commands. z 0 — –90 degrees.
Figure 23-27DV Command Character Position for Normal (0) Parameter z 0 — +90 degrees.(Reverse Line Feed) Sets the direction of Line Feeds +90 degrees with respect to the text path.
Example:Using theDV Command The following example illustrates how Line Feeds and Carriage Returns affect vertical labels. Horizontal labels are shown for comparison. Table 23-24 Example: Using the DV Command EN E CE Reset the printer. E C%0B Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. PA2000,3000;DV1; Specify absolute plotting and move to (2000,3000).
Table 23-24 Example: Using the DV Command (continued) E C%0A Enter the PCL mode. E CE Send a reset to end the job and eject the page. Figure 23-29 Table 23-25 Related Commands Group CP, Character Plot The Character Group DI, Absolute Direction DR, Relative Direction LB, Label LO, Label Origin Note Used with specific LO (Label Origin) settings, labels can be concatenated (see LO command description, later in this chapter).
ES, Extra Space This command adjusts space between characters and lines of labels without affecting character size. ES width[,height;] or ES [;] Parameter Format Functional Range Default width clamped real –32768 to 32767 0 height clamped real –32768 to 32767 0 The printer interprets the parameters as follows: z No Parameters— Defaults the spaces and lines between characters to no extra space. Equivalent to (ES0,0).
Table 23-26 Example: Using the ES Command (continued) PA2500,3200; SI.187,.269; Specify absolute plotting and move to (2500,3200); specify a relative character size of .187 cm wide by .269 cm high. DT#;ES; Define the “#” character as the label terminator and set the extra space setting to default (no extra space). LBES; CAUSES#; Print “ES; CAUSES”. CP;LBTHIS SPACING.#; Send a CP command as a CR-LF and print “THIS SPACING.” PA2500,2500; Move to (2500,2500). ES-.1,-.25; LBES-.1,-.
Table 23-27 Related Commands Group CP, Character Plot The Character Group LB, Label EN ES, Extra Space 23-53
FI, Select Primary Font This command allows any accessible font that has been assigned a font ID number to be selected as the primary (standard) font (the font characteristics are assigned to the standard font). As mentioned, the font must be accessible to the printer as either a resident font, a downloaded font, or a loaded cartridge font. To be selected, the font must have been previously assigned a font ID number in PCL mode.
Table 23-28 Example: Using the FI Command E CE Reset the printer. E C*c15D Specify a font ID number of 15. E C(s1p18v0s3b4148T Select an 18-point Univers Bold font as the primary font. E C*c6F Assign the currently selected font as a temporary font with the current ID number (15). E C%0B Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode. SP1; Select pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. PA1500,1500; Move to location (1500,1500).
Figure 23-30 Table 23-29 Related Commands Group AD, Alternate Font Definition The Character Group LB, Label SA, Select Alternate Font SD, Standard Font Definition SS, Select Standard Font E C(#X, Select Primary Font by ID # E C)#X, Select Secondary Font by ID # E C)*c#D, Assign Font ID E C)*c6F, Font Control, Copy Assign PCL Commands FN, Select Secondary Font This command allows any accessible font that has been assigned a font ID number to be selected as the secondary (alternate) font (the
When the printer receives this command and the requested font is present, the secondary font characteristics are set to those of the requested font. If the selected font is proportionally spaced, the pitch characteristic is not changed. Notes This command does not select the font for label printing if you are currently using the standard font. The FI and FN commands implicitly change the value of SB. For example, if SB = 0 and FI selects a bitmap font, SB is set to 1.
Table 23-30 Example: Using the FN Command LBLaserJetPrinters CR-LF#; Print “LaserJet Printers” in the currently selected font, which is the default Stick font; Carriage Return/Line Feed. AD4,18;FN28;SA; Use the AD command to designate an 18-point font from within HP-GL/2 mode; then assign the PCL font with font ID number of 28 as the secondary font. Then select the font. LBLaserJetPrinters#; Print “LaserJet Printers” in the newly selected font. E C%0A Enter the PCL mode.
Table 23-31 E C*c#D, Font ID (assign) E C*c6F, Font Control, Copy Assign E C(#X, Designate Font # as Primary E C)#X, Designate Font # as Secondary PCL Commands LB, Label This command prints text using the currently defined font. Use LB to annotate drawings or create text-only charts. LB text . . . text label terminator Parameter Format Functional Range Default text . . . text character any character(s) no default The LB command includes an automatic pen down function.
z Label Terminator— Terminates the LB command. You must use the special label terminator (refer to the DT command) to tell the printer to exit the label mode. If you do not use the label terminator, everything following the LB mnemonic is printed in the label, including other commands. The default label terminator is the non-printing end-of-text character ETX (decimal code 3). You can define a different terminator using the DT command.
Table 23-33 Related Commands Group AD, Alternate Font Definition The Character Group CP, Character Plot DI, Absolute Direction DR, Relative Direction DT, Define Label Terminator DV, Define Variable Text Path ES, Extra Space FI, Select Primary Font FN, Select Secondary Font LO, Label Origin SA, Select Alternate Font SB, Scalable or Bitmap Fonts SD, Standard Font Definition SI, Absolute Character Size SL, Character Slant SR, Relative Character Size SS, Select Standard Font TD, Transparent Data EN LB, La
LO, Label Origin This command positions labels relative to the current pen location. Use the LO command to center, left justify, or right justify labels. The label can be drawn above or below the current pen location and can also be offset by an amount equal to .25 times the point size (or 16 grid units [0.33 times the point size] for the Stick font).
Figure 23-33Label Origin Positioning Each time an LO command is sent, the Carriage Return point is updated to the location the pen was in when the LO command was received. The current pen location (but not the Carriage Return point) is updated after each character is drawn and the pen automatically moves to the next character origin. If you want to return a pen to its previous location prior to the next label command, you can send a Carriage Return after the label text but before the label terminator.
Table 23-34 Example: Using the LO Command (continued) SI.17,.26;PA0,500; Set the absolute character size to .17 cm wide by .26 cm high; move to (0,500). PD-500,0,0,-500, 500,0,0,500; Set the pen down and draw lines from (0,500) to (-500,0), to (0,-500), to (500,0), and then to (0,500). DT#; Define label terminator as “#” character. CI10;LO4; LBCentered on point#; Draw a small circle (radius – 10 plu) to represent the label origin point, specify a label origin of 4, and print “Centered on point.
The pen position at the end of the label string depends on whether two successive LB commands concatenate together as though only one label was given. The DV/LO combinations which permit concatenation are: Table 23-35 Text Path Label Origin DV0 (right) LO’s 1,2,3, and 11,12,13,21 DV1 (down) LO’s 3,6,9, and 13,16,19 DV2 (left) LO’s 7,8,9, and 17,18,19 DV3 (up) LO’s 1,4,7, and 11,14,17,21 The following two rules determine where the pen is positioned after a label string is drawn.
Table 23-36 Related Commands Group CP, Character Plot The Character Group DV, Define Variable Text Path LB, Label SA, Select Alternate Font This command selects the alternate font (already designated by the AD command) for subsequent labeling. Use the SA command to shift from the currently selected standard font to the designated alternate font.
SB, Scalable or Bitmap Fonts This command specifies which types of fonts are used for labeling commands. It allows you to restrict font selection to only scalable fonts and the Stick and Arc fonts, disregarding bitmap fonts. SB [n;] or SB [;] Parameter Format Functional Range Default n clamped integer 0 or 1 0 This command is defaulted by the Default Values (DF) command.
Table 23-38 AffectedCommands Command Limitation CF Bitmapped characters cannot be edged. DI,DR Bitmapped characters can be printed only with orthogonal directions (0°, 90°, 180°, or 270°). SI,SR Sizes of bitmapped fonts are approximate only. SL The Slant command is ignored for bitmapped fonts. AD,SD,CP,LB Note The FI and FN commands implicitly change the value of SB. For example, if SB = 0 and FI selects a bitmap font, SB is set to 1.
z No Parameters— Defaults the standard font characteristics. z Kind— Specifies the characteristic for which you are setting a value. Table 23-39 Kind z Note Characteristic Default Value Description 1 Symbol Set 277 Roman-8 2 Font Spacing 0 fixed spacing 3 Pitch 9 characters per inch 4 Height 11.
Note Stick font is available only in ASCII, Roman-8, and Roman Extension symbol sets. Kind 2: Font Spacing The font spacing characteristic defines whether the spacing is fixed (all characters occupying an equal horizontal space) or proportional (each character occupying a space proportional to its size). Refer to “Using Fonts” in the beginning of this chapter.
Kind 4: Height For proportional fonts, the height characteristic defines the font point size (the height of the character cell). (Fixed-spaced fonts ignore height; the point size is calculated using the font pitch.) There are approximately 72 points in an inch. Note that with the font definition command (SD or AD)., you cannot create tall, skinny characters or short, wide characters; the character aspect ratio is preserved. Table 23-42 Kind 4: Height Values Height Values Description 0 to 32 767.
Table 23-44 Kind 6: Stroke Weight Values Stroke WeightValue Description -7 Ultra Thin -6 Extra Thin -5 Thin -4 Extra Light -3 Light -2 Demi Light -1 Semi Light 0 Medium, Book or Text 1 Semi Bold 2 Demi Bold 3 Bold 4 Extra Bold 5 Black 6 Extra Black 7 Ultra Black 9999 Stick font only1 1. When the Stick font (typeface 48) is selected, the value 9999 renders it using the current pen width.
Example:Using the SD Command The following example shows the SD command used to designate a 25-point Univers Bold font in the ASCII symbol set (use the Select Standard Font (SS) command to select this font after it is designated): Note that the pitch parameter is missing in the above command because the designated font is proportionally spaced.
SI, Absolute Character Size This command specifies the size of labeling characters in centimeters. Use SI to establish character size independent of P1 and P2. SI width, height[;] or SI [;] Parameter Format Functional Range Default width clamped real –32768 to 32767 dependent* height clamped real –32768 to 32767 dependent* * Dependent on the current pitch and font height set by the AD or SD commands.
Notes If the (SB1;) command is in effect, an SI command may not be executed accurately. Labels are rendered using the bitmap font that most closely approximates the character height or width specified by SI (character size is determined by height for proportional fonts and by width for fixed-spaced fonts). When (SB1;) is in effect, characters cannot be mirrored with negative SI parameters.
Table 23-46 Example: Using the SI Command (continued) PA4000,3000; LBPrint#; Move to (4000,3000) and print “Print” in 12-point Univers. PA4000,2000; SI1,1.5;LBPrint#; Move the pen to (4000,2000) and specify a character size of 1 cm by 1.5 cm, then print “Print”. E C%0A Enter the PCL mode. E CE Send a reset to end the job and eject the page. Figure 23-34 The following are examples of negative parameters producing mirror-images of labels.
A negative height parameter mirrors labels in the top-to-bottom direction. SI.6,-.9;LBPrint#; Figure 23-36 Negative width and height parameters together mirror labels in both directions, causing the label to appear to be rotated 180 degrees. SI-.6,-.
SL, Character Slant This command specifies the slant at which labels are drawn. Use SL to create slanted text for emphasis, or to re-establish upright labeling after an SL command with parameters has been in effect. (Note that the SL command has no effect when an (SB1;) command is in effect.
The SL command only affects each character relative to an imaginary line beside the label. The direction or placement of the label on the drawing does not affect the SL command; neither do the settings of P1 and P2. The DI and DR commands, however, do affect the slant direction, since the base of a character always stays on the baseline of the label. You can specify the actual tangent value, or you can use the TAN function available in most computer languages.
Table 23-49 Example: Using the SL Command (continued) PA1000,300; SL-.36;LBSlant#; Move to (1000,300), change the slant angle to -20° from upright and print “Slant.” E C%0A Enter the PCL mode. E CE Send a reset to end the job and eject the page.
SR, Relative Character Size This command specifies the size of characters as a percentage of the distance between P1 and P2. Use SR to establish relative character size so that if the P1/P2 distance changes, the character size adjusts to occupy the same relative amount of space. SR width height[;] or SR [;] Functional Range Parameter Format Default width clamped real –32768 to 32767 0.75% of P2X–P1X height clamped real –32768 to 32767 1.
The character size you specify with SR is a percentage of (P2X – P1X) and (P2Y – P1Y). The printer calculates the actual character width and height from the specified parameters as follows: actual width = (width parameter/100) x (P2X – P1X) actual height = (height parameter/100) x (P2Y – P1Y) For example, suppose P1 and P2 are located at (–6956,–4388) and (6956,4388), respectively. If you establish relative sizing and specify a width of 2 and a height of 3.
Example:Using the SR Command The following example first shows a label with a character size relative to P1 and P2 (SR). Next, the locations of P1 and P2 are changed; then, the character size percentages are specified. Notice that the new character size has equal parameters of 2.5; because the P1/P2 area is square, the resulting characters are square. Table 23-51 Example: Using the SR Command EN E CE Reset the printer. E C%0B Enter HP-GL/2 mode. IN; Initialize HP-GL/2 mode.
Figure 23-40 Table 23-52 Related Commands Group CP, Character Plot The Character Group SB, Scalable or Bitmap Fonts DI, Absolute Direction DR, Relative Direction IP, Input P1 and P2 IR, Input Relative P1 and P2 SI, Absolute Character Size 23-84 The Character Group EN
SS, Select Standard Font This command selects the standard font (already designated by the Standard Font Definition (SD) command) for subsequent labeling. Use the SS command to shift from the currently selected alternate font to the designated standard font. SS [;] The SS command tells the printer to print subsequent labeling commands using characters from the standard symbol set designated by the SD command.
TD, Transparent Data This command specifies whether control characters perform their associated function or print as characters when labeling. Use the TD command to print characters that function only as control characters in normal mode. TD mode[;] or TD [;] Table 23-54 Parameter Format Functional Range Default mode clamped integer 0 or 1 0 (normal) The printer interprets the parameters as follows: z No Parameters– Defaults the labeling mode to normal. Equivalent to (TD0).
Table 23-55 Related Commands Group AD, Alternate Font Definition The Character Group DT, Define Label Terminator LB, Label SA, Select Alternate Font SD, Standard Font Definition SS, Select Standard Font EN TD, Transparent Data 23-87
23-88 The Character Group EN
24 Programming Hints Introduction This chapter provides information for use during the development of PCL software.
PCL Command Parsing A job stream may contain commands that are device specific. If these commands are not supported by the PCL device, they are ignored. For example, a Duplex Print command has no effect on the HP LaserJet III, IIIP or LaserJet 4 printers, since these are non-duplexing printers. However, on printers which support duplex printing (such as the HP LaserJet IIID and LaserJet IIISi), the job is printed in duplex mode.
Job Control Printer Reset Hewlett-Packard strongly recommends the use of both the ECE command and the EC%–12345X command (Universal Exit Language/Start of PJL — also referred to as the UEL Command) at the beginning and end of each job. (The order of these commands is critical; refer to Table 24-1 for an example.) This allows the next job to start with the default settings as a known base.
PCL Page Control 1 Paper Source The primary use for the paper source command is to allow access to “locked out” (secured) paper trays. Page Size This command specifies the exact size of the page (media) to be used. Text Area/Margins Avoid setting the top margin or text length to values outside of the printable area. This may cause data loss. Top Margin and Text Length commands use the current line spacing (the last VMI or lpi commands). Specifying the text length establishes the bottom margin.
PCL Cursor Positioning Horizontal (decipoint, dot and column) positioning ignores margins, and therefore can be used to move the cursor anywhere along the present line. When performing cursor positioning with decipoints, PCL Units, or rows and columns, do not use margins. Margins are intended for print and space (i.e., CR, LF, FF) applications. Vertical (decipoint, dot and row) positioning allows the cursor to be moved into the perforation region.
To ensure compatibility with future products, select fonts by specifying all of the font characteristics. If all of the characteristics are not designated, the primary and secondary font tables in the printer may not contain the correct information to select the requested font from those available in the printer. The shortcut method of font selection is not recommended (as documented in some previous font product literature) and may not result in the desired font change.
PCL Raster Graphics To minimize I/O transmission time and conserve memory, avoid sending unnecessary raster data to the printer that represents white space. This is accomplished using the raster compression modes and raster reduction techniques available with the raster picture area. Set resolution prior to the start raster graphics command. Once the start raster command is received, the resolution cannot be set until after a subsequent end raster graphics command.
Macros When a macro ID is specified for which no macro has been defined, the macro invocation, macro deletion, and make macro permanent or temporary commands are ignored. The macro enabled for auto macro overlay is executed on each page, until the macro is disabled or deleted, a reset occurs (“ECE” “UEL” or control panel), or the page length, page size or orientation is changed.
HP-GL/2 Vector Graphics There are different approaches (commands) and techniques that can be used to create an HP-GL/2 image.
Performance PCL Commands Since PCL printers are command driven devices and each command takes a finite amount of time to process, pages composed of a large number of commands may not print at maximum speed. Most commands can be used frequently on a page without adversely affecting the printer’s performance; however, certain commands take more time to process and therefore, if used frequently on a page, may decrease printer performance.
Note The page protection feature is available only with additional optional memory on many HP LaserJet printers. (One exception is the LaserJet 4 printer, which supports page protection for letter-size paper in 300 dpi mode with the standard 2 Mbytes memory.) Refer to the appropriate User’s Manual for specific memory requirements. The Page Protection feature can be used to prevent possible ERROR 21 conditions.
Troubleshooting Commands End-of-Line Wrap The End-of-Line Wrap command defines the action that occurs when a line of text reaches the right margin. E C&s#C # =0 - Enables End-of-Line Wrap 1 - Disables End-of-Line Wrap When end-of-line wrap is enabled, a character or space that moves the cursor to the right of the right margin executes a CR-LF (prior to the printing of the character or space).
When the printer is in display functions mode, all control codes and escape sequences are printed and not executed, with the following exceptions: z CR is printed and executed as CR-LF. z E CZ is printed and executed. Display functions mode instructs the printer to display rather than execute the data it receives. The data is printed using the current text area and selected font.
Auto Continue Mode Automatic error clearing (refer to the printer User’s Manual for a list of clearable errors) can be achieved by setting Auto-Continue Mode to ON, using the Operator Control Panel configuration menu. When “Auto-Cont” is set to ON, the device displays a message for 10 seconds, and then attempts to continue printing the job. When “Auto-Cont” mode is set to OFF, all errors cause the device to stop printing.
Common Errors 20 ERROR This error occurs when the printer runs out of memory during a font download, macro creation, raster graphic download, or page composition. To alleviate this error, the quantity of data sent to the printer must be reduced. This can be accomplished by eliminating unnecessary fonts or macros, reducing the raster graphics white space sent to the printer, or selecting a lower resolution for the raster graphics. An alternative solution is to install additional memory.
24-16 Programming Hints EN
Customer Support Support services are available to help you in case you have a question about your HP LaserJet printer. Following are some places to turn for this support. Help From Your Organization If you organization has many HP printers, the best source of assistance may be within your own company. Many organizations designate central support personnel to help when you have any problems with your computer system or when you need consumable items such as toner cartridges or paper.
If you are not a member of CompuServe, but would like to join, call CompuServe at 1-800-848-8199 (operator #51) and take advantage of the Free Introductory Membership, which includes: z A $15 introductory usage credit to CompuServe. z A private User ID number and Password. z A complimentary subscription to CompuServe’s monthly publication, CompuServe Magazine.
When you call the Personal Peripherals Assist Line, please have the following information available to help us answer your questions: EN z Identify which computer you are using. z Identify any special equipment or software you are using (for example, spoolers, networks, switch boxes, modems or special software drivers). z Identify the cable you are using and who sold it to you. z Identify any special interface, I/O, or RAM boards installed in your printer.
Customer Support-4 EN
Glossary Auto-Continue Auto-Continue mode can be configured using the printer’s control panel (refer to the printer User’s Manual). Aspect Ratio The ratio of the width to height of an image. Baud Rate Baud rate is the rate at which information is transferred between the computer and the printer. To communicate properly, the computer and printer must both be configured to the same baud rate.
Centronics I/O An industry standard parallel input/output (I/O) interface. (Also see Parallel I/O.) Character Descriptor The character descriptor is a block of data that identifies the characteristics for a specific character, such as its position, and the cursor position after printing. The character data which follows, defines the shape of the character. Chapter 11 describes the character definition and descriptor formats for PCL bitmap fonts, as well as Intellifont and TrueType scalable fonts.
Control Code A control code is a type of PCL language command that initiates a printer function, for example CR (Carriage Return), LF (Line Feed), and FF (Form Feed). Control Panel The combination of keys, LEDs, and a display that allows an operator to communicate with a device and allows the device to communicate with an operator. Current Active Position (CAP) See CAP.
Downloading The process of transferring soft fonts, macros, or raster data from a host computer to the printer’s user memory is called downloading. DTR Polarity The configuration of DTR polarity determines whether pin 20, on the serial interface connector, is high or low when the printer is ready. If DTR polarity is HI, pin 20 is high when the printer is ready. If DTR polarity is LO, pin 20 is low when the printer is ready.
Factory Default Environment A factory default is a setting programmed into the printer at the factory. The group of all the printer’s factory settings is referred to as the factory default environment. The factory default symbol set is selectable from the control panel configuration menu (refer to the printer User’s Manual). Font A font is a set of characters that have similar characteristics.
Horizontal Motion Index (HMI) HMI defines the distance between columns in 1/120 inch increments. When fixed pitch fonts are selected, all printable characters including the space and backspace characters are affected by HMI. When proportional fonts are selected, the HMI affects only the space character. HMI is defaulted when font orientation, symbol set, pitch, spacing or height is specified and when switching between primary and secondary fonts with Shift In and Shift Out.
Internal Fonts Internal fonts are the fonts resident in the printer when shipped. Landscape See Orientation. Logical Page The PCL logical page (also referred to as the addressable area) defines the area in which the cursor can be positioned. Although the printer does not actually have a cursor (like the blinking underline character used on most computer terminals), the cursor position refers to the currently active printing position (CAP).
MSL (Master Symbol List) This is a group of symbols (a symbol index). An unbound font has the capacity to be bound to a set of symbols selected from a complementary symbol index (such as the MSL or Unicode symbol indexes). Each symbol in the index is identified by a unique MSL number. Appendix D of the PCL 5 Comparison Guide contains the MSL symbol index. Negative angle of rotation An angle used to create a plot in HP-GL/2 which is rotated in the direction of the +X-axis to the –Y-axis.
Parallel I/O An input/output (I/O) interface that transmits more than one bit of information simultaneously (in a “parallel” mode). Centronics is an industry-wide parallel interface standard. (Also see Serial I/O.) PCL Commands PCL commands provide access to printer features. Once a PCL command sets a parameter, that parameter remains set until the same PCL command is repeated with a new value, or the printer is reset.
Pitch Pitch describes the number of characters printed in a horizontal inch. Pitch only applies to fixed-spaced fonts since the number of characters per inch varies for proportionally-spaced fonts. PJL PJL (Printer Job Language) commands provide job-level control, such as the ability to switch printer languages (or “personalities” such as PCL to PostScript) between jobs. PJL also provides two-way communications with the printer.
Portrait See Orientation. Print Environment The group of all the printer’s current feature settings, collectively, is referred to as the print environment. The printer identifies four levels of changes of this print environment: the factory default environment, the user default environment, the modified print environment and the overlay environment. Printer Commands See PCL Commands and HP-GL/2.
Resolution The high quality output achieved by HP LaserJet printers is due in part to the ability to lay down a fine grid of “dots” on the page. The density of this grid is referred to as the printer’s resolution. Resolution is expressed as a value of dots-per-inch. Until recently, all HP LaserJet family printers printed at a resolution of 300 dots-per-inch.
Serial I/O An input/output (I/O) interface that transmits information bit-by-bit (in “serial” mode). RS-232 is an industry-wide standard form of a serial interface. Soft Font Soft fonts are fonts stored on disks. These fonts can be transferred to the printer’s memory and used the same way as cartridge or resident fonts. Spacing Fonts have either fixed or proportional spacing. Fixed-spaced fonts are those for which the inter-character spacing is constant.
Symbol Set A symbol set is a unique ordering of the characters in a font. Each symbol set is defined with a unique set of applications in mind. Symbol sets are created for many purposes, for example, the PC-8 symbol set was designed to support US IBM-PC applications. Treatment Treatment is the combination of font style and/or weight. For example, some treatments of Times Roman font include: upright, or bold, or italic. Typeface Typeface is a generic name for graphics symbols having common design features.
Unit of Measure The number of units-per-inch used in PCL cursor moves is determined by the current setting of the Unit of Measure command. The current unit of measure setting affects all PCL Unit moves, horizontal and vertical rectangle size, bitmap and scalable font metrics (how the cursor moves after printing a character). See “Unit of Measure Command” in Chapter 4. User Default A default selectable through the printer’s control panel.
Vertical Motion Index (VMI) VMI (vertical motion index) VMI defines the distance between rows in 1/48th inch increments. This command affects the Line Feed and Half-Line Feed spacing. The factory default VMI is eight, which corresponds to six lines per inch. A user default VMI can be selected from the control panel using the FORM menu item.
Index Symbols !!PCL 5 Comparison Guide!! x !!Software Application Notes!! vi !!TrueType Font File Specification!! x #A - Page Size 5-2 #C - Vertical Motion Index 5-22 #D - Line Spacing 5-24 #E - Top Margin 5-16 #F - Text Length 5-18 #G - Output Bin Selection 4-12 #H - Paper Source 5-4 #L - Perforation Skip 5-19 #O - Page Orientation 5-5 #S - Simplex/Duplex Print 4-5 #U - Left Offset Registration 4-7 #X - Number of Copies 4-4 #Z - Top Offset Registration 4-8 %&minus 4-3 &&&ell 4-4, 4-5, 4-7, 4-8, 4-11, 4-12,
*c#V - Vertical Rectangle Size (Decipoints) 14-4 *c#W - User-Defined Pattern 13-16 *p#R - Set Pattern Reference Point 13-22 *p#X - Horizontal Cursor Positioning (PCL Units) 6-6 *p#Y - Vertical Cursor Positioning (PCL Units) 6-12 *r#A - Start Raster Graphics 15-14 *r#F - Raster Graphics Presentation 15-8 *r#T - Raster Height 15-11 *r#T - Raster Width 15-13 *rC - End Raster Graphics 15-30 *s#M - Free Space 16-21 *s#X - Echo 16-25 *t#R - Raster Graphics Resolution 15-6 *v#N - Source Transparency Mode 13-6 *v#O
character design data 11-57 coordinate system 11-4 header 11-7, 11-8 status readback 16-12 black fill 14-9 black rule 13-12 block size, adaptive compression 15-25 bold stroke weight 7-6 boolean (B), data type 10-5, 11-14, 11-51 bottom margin 24-4 bound font 9-8, Glossary-1 boundaries landscape page 2-8 limiting, HP-GL/2 17-19 PCL Picture Frame 19-6 portrait page 2-7 printable area 2-7, 2-8 boundaries, page 2-2 BR command 20-8, 20-19 BS, Backspace 6-7 buffer overflow, (``ERROR 22')' 24-15 byte counts 15-29 B
xy data offset 11-64 character design 7-7 Character Fill Mode command 23-20 Character Group (HP-GL/2) 23-1 commands list 17-5 commands summary 23-1 character orientation 7-8 character origin 23-63 Character Plot (CP) command 23-5, 23-8, 23-16, 23-24 character positioning 6-1 character requirement MSL 10-7 number 9-10 Unicode 10-9 user-defined symbol set header 10-7 character row height 5-22 character sets (fonts) 7-1 character size (HP-GL/2) 23-8, 23-74 Character Slant command 23-8, 23-78 character slope 23
FN (Select Secondary Font) 23-56 FP (Fill Polygon) 21-12, 21-31 FT (Fill Type) 22-9 Horizontal Picture Frame Size 18-8 HP-GL/2 Plot Horizontal Size 18-11 HP-GL/2 Plot Vertical Size 18-12 IN (Initialize) 19-3, 19-15, 19-21 IP (Input P1 and P2) 19-23, 19-36 IR (Input Relative P1 and P2) 19-26 IW (Input Window) 19-18, 19-29 LA (Line Attribute) 22-2 LA (Line Attributes) 22-15 LB (Label) 23-3, 23-59 LO (Label Origin) 23-10, 23-62 LT (Line Type) 22-2, 22-22 PA (Plot Absolute) 17-25, 20-30 PD (Pen Down) 17-21, 20-
Select Default Font 8-27 Set Pattern Reference Point 13-22 Set Raster Compression Method 15-16 set status readback location type 16-8 set status readback location unit 16-9 simplex/duplex print 4-5 Source Transparency Mode 13-6 spacing 8-9 stroke weight, font selection 8-16 Style, Font Selection 8-14 symbol set 8-6 symbol set control 10-12 symbol set ID code 10-2 Text Length 5-18 top margin 5-16 Top Offset Registration 4-8 transfer raster data 15-29 Transparent Print Data 8-28 typeface, font selection 8-18
control codes, horizontal 6-7 control codes, vertical 6-13 decipoints 6-6, 6-11 End-of-Line Wrap 24-12 half-line 6-13 hints 24-5 HP-GL 6-1 PCL Units 6-6, 6-12 printing characters 11-57 raster graphic 15-29 relative 6-2, 24-5 rows 6-9 saving 6-14 stack 6-14 top margins 5-16 units 6-3 vertical 5-16 customer support Customer Support-1 D data block, adaptive compression 15-25 data compression 15-2 bitmap character 11-53 class 2 character data 11-54 raster data 15-13 data offset, scalable character descriptor,
wedges 21-6 driver, design for status 16-2 DT command 23-11, 23-44 DTR polarity Glossary-4 Duplex Page Side Selection command 4-10 duplex printing 4-5 duplicate row, adaptive compression 15-25 DV command 23-9, 23-29, 23-30, 23-37, 23-46 example 23-49 E E - Printer Reset 4-2 EA command 21-3, 21-17 Echo command 16-25 edge pen 23-21 Edge Polygon command 21-21 Edge Rectangle Absolute command 21-17 Edge Rectangle Absolute command 21-3 Edge Rectangle Relative command 21-3, 21-23 Edge Wedge (EW) command 21-7, 21-
Fill Rectangular Area command 14-9 Fill Type command 22-9 fill types 22-4 Fill Wedge (WG) command 21-27, 21-45 filled rectangles 21-4 filling characters (HP-GL/2) 23-20 filling polygons 21-12 final font selection 9-11 first code font header 11-30 user-defined symbol set header 10-7 fixed underline 8-29 fixed-spaced fonts character spacing 5-20, 7-4, 8-9 font selection 8-23 printing 23-15 floating underline 8-29 Flush All Pages command 16-24 FN command 23-56 font 7-1 (defined) Glossary-5 alternate font defin
Font Control command 9-5 font header 11-1, Glossary-5 baseline position 11-18 bitmap 11-7 bitmap character cell 11-19 bitmap example 11-43 calculating symbol set value 11-20 cap height, formula 11-31 cell height 11-18 cell width 11-18 character complement 11-35 checksum 11-39, 11-42 command 11-6 copyright 11-39 examples 11-43, 11-44 first code 11-30 font naming (ASC16) 11-33 font number 11-32 font scaling technology 11-34 font type 11-15 format byte 11-15 formats 11-7 formats of data segments 11-41 global I
Free Space command, status readback 16-21 FT command 22-9 G gaps, in user-defined line types 22-44 GI (Global Intellifont Data) 11-35, 11-41 global italic angle, font header 11-35 glyph ID, TrueType 11-69 glyphs, TrueType, downloading 11-49 graphic patterns 13-8, 14-5 graphics cross-hatch patterns 14-1, 14-8 errors 24-15 limits (HP-GL/2) 17-19, 19-12 patterns 14-1 raster 15-1 resolution 14-2 shading 14-1, 14-6 special effects 13-1 transparency mode 13-1 user-defined patterns 13-13 vector Glossary-15 group
image creation hints 24-9 importing existing images 17-25 labels 23-1 Line and Fill Attributes Group 17-6, 22-1 line segments, four types 19-18 line types/patterns 22-22 listing of commands 17-3 macro overlay environment 12-4 matching coordinate system with PCL 19-15 omitting optional parameters 17-9 orientation 17-17 page size-independent image 18-3 parameter formats 17-10 PCL picture frame 18-1 pen location 17-23 picture frame 2-6 picture frame scaling 18-3 Plot Horizontal Size 18-11 Plot Vertical Size 18
direction 23-29 orientation and placement 23-9 terminator 23-11, 23-44 text 17-11 text (HP-GL/2) 23-1, 23-3, 23-8 Label (LB) command 23-3, 23-59 Label Origin (LO) command 23-10, 23-62 labeling, pen movement 23-24 landscape (defined) Glossary-8 character data example 11-73 orientation 5-5 print boundaries 2-8 LaserJet customer assistance Customer Support-1 printer features v last code 10-7 font header 11-30 layers, and transparency mode 22-42 LB command 23-3, 23-59 example 23-60 Left Margin command 5-13 Left
position field 11-34 thickness field 11-34 master x resolution, pattern descriptor 13-18 master y resolution, pattern descriptor 13-18 matching coordinates, HP-GL/2 and PCL 19-15 measure, unit of Glossary-15 medium stroke weight 7-6 memory available 16-21, 16-24 entity storage 16-3 font usage 7-8, 16-22 macro 12-3 overflow, avoiding 16-2, 24-15 RAM 8-3 raster graphics usage 15-6 ROM 8-3 status readback, free space 16-4 user 8-3 menu Glossary-7 metric data, Intellifont 11-63, 11-64 mirror-image 19-8 creating
parameters formats (HP-GL/2) 17-10 HP-GL/2 syntax 17-7 scaling 19-45 user-units in scaling 19-41 parentheses 17-9 parsing, PCL commands 24-2 Pattern 13-8, 14-5 pattern black fill 14-9 cross-hatch 14-8 cross-hatch fill 14-9 current 13-2 erase fill 14-9 fonts 7-11 line 13-11 raster fill 22-9 reference point 13-14 shaded fill 14-9 shading 13-9, 14-6 transparency mode 13-2 user-defined Glossary-15 user-defined - !!also see!! user-defined pattern 13-13 Pattern ID (Area Fill ID) command 13-8, 14-5 Pattern Transpa
HP-GL/2 2-6 size (vertical) 18-9 picture presentation directives 18-1 pie charts 21-27, 21-45 pitch 7-5, 23-70, 23-73, Glossary-10 computing 8-11 extended, font header 11-30 font header 11-21 font selection command 8-10 in font selection 8-23 selections, range of valid 8-10 pixel 22-33 pixel encoding, user-defined pattern descriptor 13-17 pixel level clipping 2-8 PJL Glossary-10 PJL commands 1-4 placement, font header 11-28 placing text 23-10 Plot Absolute command 17-25, 20-30 Plot Relative command 20-44 pl
characters 24-13 control codes 24-13 printed dots 2-3 printer commands (defined) Glossary-11 internal units 2-5 performance/speed 24-10 program language 1-1 resets 3-8 printer commands combining 1-8 shortening 1-8 Printer Job Language (PJL) commands 1-4 Printer Reset command 4-2 printing a character 9-13 control codes 8-28, 23-86, 24-12 different characters 7-1 duplex 4-5 fixed-spaced fonts 23-15 labels 23-3 menu (defined) Glossary-11 patterns/shading 7-11 processing time 24-10 proportional fonts 23-15 rast
real number 17-10 rectangle drawing (HP-GL/2 mode) 21-3 effect of transparency mode 14-11 fill 14-1 fill (examples) 14-13 fill (transparency mode) 14-11 Fill command 14-9 fill procedure 14-1 Horizontal Size command 14-3 pattern transparency mode 14-2 position 14-10 rectangular area definition 14-1 transparency mode 14-10 Vertical Size command 14-4 reducing/enlarging HP-GL/2 images 19-8 registration text 4-7 Top Offset command 4-8 related manuals x !!Intellifont Scalable Typeface Format!! x !!PCL 5 Compariso
user-units (pictured) 19-5 Screened Vectors command 22-39 screening (area fill) 22-39 SD command 23-68 example 23-73 secondary font 8-5, Glossary-10 HP-GL/2 23-56 HP-GL/2) 23-18 secured paper source 24-4 seed row 15-20, 15-22 adaptive compression 15-27 raster graphic termination 15-15 segment identifier, Format 15 11-40 segment size, Format 15 font header 11-41 segmented font data, Format 15 11-39 Select Alternate Font command 23-66 Select Current Pattern command 13-12 Select Default Font command 8-27 Selec
Error=INVALID UNIT 16-23 Error=NONE 16-20 Flush All Pages command 16-24 font extended 16-10 font status 16-10 Free Space command 16-21 IDLIST= 16-16, 16-17, 16-18 inquire entity command 16-10 LARGEST= 16-22 location type 16-3 location unit 16-3 LOCTYPE= 16-14, 16-17 LOCUNIT= 16-14, 16-17 macro status 16-10 memory 16-2 memory response 16-22 NAME= 16-16 response 16-5 response buffer 16-5 response syntax 16-6 response, font 16-11 response, font extended 16-15 response, macro 16-16 response, symbol set 16-18 re
status readback 16-8 temporary macros 12-5 terminating labels 23-11 termination character 1-6 terminator (HP-GL/2 syntax) 17-7 text angle, varying with DI 23-9 area 5-11, 5-18, 24-4 character positioning (HP-GL/2) 23-62 first line 5-16 height, font header 11-29 length 24-4 length, computing user default 5-18 orienting and placing 23-10 path 23-46 placing HP-GL/2 23-9 positioning 4-7, 4-8 printing 5-11 printing (HP-GL/2) 23-59 Text Length command 5-18 width, font header 11-29 thickness, character 8-16 TIFF a
units coordinate system 6-3 cursor positioning 6-3 design window 11-4 internal printer 2-5 of measure (HP-GL/2) 17-20 PCL coordinate system 2-5 Universal Exit Language (UEL) Glossary-14 Universal Exit Language command 4-3 unsigned byte (UB) 10-5, 11-14 character descriptor 11-51 unsigned integer (UI) 10-5, 11-14 character descriptor 11-51 unsigned long integer (ULI) 10-5, 11-14 upright style 7-6 user default Glossary-15 computing text length 5-18 environment 3-1, Glossary-15 environment (settings) 3-6 symbo
wedges and circles, filling (example) 21-8 WG command 21-6, 21-27, 21-45 white fill 14-9, 14-10 white rule 13-12 width character descriptor 11-57 lines 22-5 pixel, user-defined pattern descriptor 13-18 type (font header) 11-23 windowing 19-18 WU command 22-46 X X resolution, font header 11-33 X,Y axis ranges, user-units in scaling 19-41 coordinate pairs 17-16 X-axis 17-15 PCL coordinate system 2-5 units 6-3 EN xHeight, font header 11-22 XW (x-windows font name), format of data segment 11-42 XY coordinate
Index-40 EN