HP-GL

Last updated
Hewlett-Packard Graphics Language
Internet media type
application/vnd.hp-HPGL

HP-GL, short for Hewlett-Packard Graphics Language and often written as HPGL, is a printer control language created by Hewlett-Packard (HP). HP-GL was the primary printer control language used by HP plotters. [1] It was introduced with the plotter HP-9872 in 1977 and became a standard for almost all plotters. Hewlett-Packard's printers also usually support HP-GL/2 in addition to PCL. [2]

Contents

Design

The language is formed from a series of two letter codes (mnemonics), followed by optional parameters. For instance an arc can be drawn on a page by sending the string:

AA100,100,50;

This means Arc Absolute, and the parameters place the center of the arc at absolute coordinates 100,100 on the page, with a starting angle of 50 degrees measured counter-clockwise. A fourth optional parameter (not used here) specifies how far the arc continues, and defaults to 5 degrees.

When first introduced, HP-GL contained the following commands:

CommandMeaning
Vector Group
PA x,y{,x,y{...}}Plot absolute [i]
PR x,y{,x,y{....}}Plot relative [i]
PDPen down
PUPen up
Character Group
CA nDesignate alternate character set n [i]
CP spaces, linesCharacter plot [d]
CS mDesignate standard set m [i]
DI run, riseAbsolute direction [d]
DR run, riseRelative direction [d]
LB c, ..., cLabel ASCII string [c]
SASelect alternate character set
SI wide, highAbsolute character size [d]
SL tan θAbsolute character slant (from vertical) [d]
SR wide, highRelative character size [d]
SSSelect standard character set
UC x, y, pen{, ...}User defined character [i]
Line Type Group
LT t{,l}Designate line type t and length l [d]
SM cSymbol mode [c]
SP nSelect pen [i]
VAAdaptive velocity
VNNormal velocity
VS v{,n}Select velocity v for pen n [i]
Digitize Group
DCDigitize clear
DPDigitize point
OCOutput current position and pen status
ODOutput digitized point and pen status
Axes
TL tp{,tn}Tick length [d]
XTX axis tick
YTY axis tick
Set-Up Group
IP p1x,p1y,p2x,p2yInput p1 and p2 [i]
IW xlo,ylo,xhi,yhiInput window [i]
OPOutput p1 and p2 [i]
Configuration Status
APAutomatic pen pickup [i]
DFSet default values
IM e{,s{,p}}Input e, s and p masks [i]
INInitialize
OEOutput error [i]
OSOutput status [i]
Commands added (when?)
SI w,hset character width and height

Formats:

Examples

Typical HP-GL files start with a few setup commands, followed by a long string of graphics commands. The file was in ASCII (text file) format, for instance:

An example HP-GL file
CommandMeaning
IN;initialize, start a plotting job
IP;set the scaling points (P1 and P2) to their default positions
SP1;select pen 1
PU0,0;lift Pen Up and move to starting point for next action
PD100,0,100,100,0,100,0,0;put Pen Down and move to the following locations (draw a box around the page)
PU50,50;Pen Up and move to X,Y coordinates 50,50
CI25;draw a circle with radius 25
SS;select the standard character set
DT*,1;set the text delimiter to the asterisk, and do not print them (the 1, meaning "true")
PU20,80;lift the pen and move to 20,80
LBHello World*;draw a label

The coordinate system was based on the smallest units one of the HP plotters could support, and was set to 25 µm (i.e. 40 units per millimeter, 1016 per inch). The coordinate space was positive or negative floating point numbers, specifically ±230.

HP-GL/2

The original HP-GL language did not support definition of line width, as this parameter was determined by the pens loaded into the plotter. With the advent of the first inkjet plotters, line width for the "pens" specified within the HP-GL files had to be set at the printer so it would know what line width to print for each pen, a cumbersome and error-prone process. With Hewlett-Packard Graphics Language/2 aka HP-GL/2, definition of line width was introduced into the language and allowed for elimination of this step. Also, among other improvements a binary file format was defined that allowed for smaller files and shorter file transfer times, and the minimal resolution was reduced.

Examples of HP-GL/2 commands
CommandMeaning
NPxnumber of pens; x=1..256
PCx,r,g,bpen color; x=pen, r=red, g=green, b=blue, 0..255
PWw,xpen width; w=pen width in mm with decimal point, x=pen

AGL

HP-GL is related to AGL (A Graphics Language), an extension of the BASIC programming language. AGL was implemented on Hewlett-Packard minicomputers to simplify controlling a plotter. AGL commands describe the desired graphics plotting function, which the computer relays as several HP-GL instructions to the plotter.

See also

Related Research Articles

<span class="mw-page-title-main">Plotter</span> Computer output device that draws lines on paper by moving a pen

A plotter is a machine that produces vector graphics drawings. Plotters draw lines on paper using a pen, or in some applications, use a knife to cut a material like vinyl or leather. In the latter case, they are sometimes known as a cutting plotter.

<span class="mw-page-title-main">PostScript</span> File format and programming language

PostScript (PS) is a page description language in the electronic publishing and desktop publishing realm. It is a dynamically typed, concatenative programming language. It was created at Adobe Systems by John Warnock, Charles Geschke, Doug Brotz, Ed Taft and Bill Paxton from 1982 to 1984.

In digital printing, a page description language (PDL) is a computer language that describes the appearance of a printed page in a higher level than an actual output bitmap. An overlapping term is printer control language, which includes Hewlett-Packard's Printer Command Language (PCL). PostScript is one of the most noted page description languages. The markup language adaptation of the PDL is the page description markup language.

In computer science, an escape sequence is a combination of characters that has a meaning other than the literal characters contained therein; it is marked by one or more preceding characters.

In computers, a printer driver or a print processor is a piece of software on a computer that converts the data to be printed to a format that a printer can understand. The purpose of printer drivers is to allow applications to do printing without being aware of the technical details of each printer model.

<span class="mw-page-title-main">Xfig</span> Vector graphics editor for UNIX-like systems

Xfig is a free and open-source vector graphics editor which runs under the X Window System on most UNIX-compatible platforms.

<span class="mw-page-title-main">HP-IL</span>

The HP-IL, was a short-range interconnection bus or network introduced by Hewlett-Packard in the early 1980s. It enabled many devices such as printers, plotters, displays, storage devices, test equipment, etc. to be connected to programmable calculators such as the HP-41C, HP-71B and HP-75C/D, the 80-series and HP-110 computers, as well as generic ISA bus based PCs.

<span class="mw-page-title-main">HP 2640</span> Serial computer terminal

The HP 2640A and other HP 264X models were block-mode "smart" and intelligent ASCII standard serial terminals produced by Hewlett-Packard using the Intel 8008 and 8080 microprocessors.

HP Time-Shared BASIC is a BASIC programming language interpreter for Hewlett-Packard's HP 2000 line of minicomputer-based time-sharing computer systems. TSB is historically notable as the platform that released the first public versions of the game Star Trek.

Printer Command Language, more commonly referred to as PCL, is a page description language (PDL) developed by Hewlett-Packard as a printer protocol and has become a de facto industry standard. Originally developed for early inkjet printers in 1984, PCL has been released in varying levels for thermal, matrix, and page printers. HP-GL/2 and PJL are supported by later versions of PCL.

<span class="mw-page-title-main">HP 9800 series</span>

The HP 9800 is a family of what were initially called programmable calculators and later desktop computers that were made by Hewlett-Packard, replacing their first HP 9100 calculator. It is also named "98 line". The 9830 and its successors were true computers in the modern sense of the term, complete with a powerful BASIC language interpreter.

An image file format is a file format for a digital image. There are many formats that can be used, such as JPEG, PNG, and GIF. Most formats up until 2022 were for storing 2D images, not 3D ones. The data stored in an image file format may be compressed or uncompressed. If the data is compressed, it may be done so using lossy compression or lossless compression. For graphic design applications, vector formats are often used. Some image file formats support transparency.

Printer Job Language (PJL) is a method developed by Hewlett-Packard for switching printer languages at the job level, and for status readback between the printer and the host computer. PJL adds job level controls, such as printer language switching, job separation, environment, status readback, device attendance and file system commands.

<span class="mw-page-title-main">HP series 80</span> 1980 Hewlett-Packard small scientific desktop computer

The Hewlett-Packard series 80 of small scientific desktop computers was introduced in 1980, beginning with the popular HP-85 targeted at engineering and control applications. They provided the capability of the HP 9800 series desktop computers with an integrated monitor in a smaller package including storage and printer, at half the price.

UniDrv is a GDI-based Microsoft Windows universal printer driver and architecture for non-PostScript printers. It is used to simplify driver development of non-PostScript printers for printer manufacturers. Unidrv allows the creation of a printer-specific minidriver in the form of a GPD file, similar to a PPD file, which is much simpler than kernel mode driver development. Unidrv was introduced in Windows 2000 and replaced the Raster Device Driver (RASDD) interface used in Windows NT 4.0 and earlier versions.

The HP 7470 was a small low-cost desktop pen plotter introduced by Hewlett-Packard's San Diego division in 1982. It was the first small-format plot that moved the paper, rather than the pens. It used a revolutionary "grit wheel" design which moved the paper held in place by a wheel with embedded grit and a pinch roller.

The Hewlett-Packard Raster Transfer Language is a subset of the Printer Command Language (PCL) language. It is used to embed true raster images (bitmaps) into plotter files. Modern plotters are raster devices, so they need a raster-based language. For backward compatibility they also support the HP-GL/2 vector language, so the HP RTL language is designed for mixing with the HP-GL/2 language.

<span class="mw-page-title-main">WinFIG</span>

WinFIG is a proprietary shareware vector graphics editor application. The file format and rendering are as close to Xfig as possible, but the program takes advantage of Windows features like clipboard, printer preview, multiple documents etc.

In computing HP Roman is a family of character sets consisting of HP Roman Extension, HP Roman-8, HP Roman-9 and several variants. Originally introduced by Hewlett-Packard around 1978, revisions and adaptations were published several times up to 1999. The 1985 revisions were later standardized as IBM codepages 1050 and 1051. Supporting many European languages, the character sets were used by various HP workstations, terminals, calculators as well as many printers, also from third-parties.

The Lotus International Character Set (LICS) is a proprietary single-byte character encoding introduced in 1985 by Lotus Development Corporation. It is based on the 1983 DEC Multinational Character Set (MCS) for VT220 terminals. As such, LICS is also similar to two other descendants of MCS, the ECMA-94 character set of 1985 and the ISO 8859-1 (Latin-1) character set of 1987.

References

  1. Daniels, Thomas H.; Hennessee, Larry W. (September 1977). "Easy-to-Use Interface Language Controls HP-IB Plotter" (PDF). Hewlett-Packard Journal . 29 (1): 5. Archived (PDF) from the original on 2017-02-27. Retrieved 2016-09-12.
  2. PCL 5 Printer Language Technical Reference Manual (1st ed.). Hewlett-Packard Company. September 1990. HP Part No. 33459-90903. (NB. Chapter 15-21 also contain a description of HP-GL/2.)

Further reading