HPGL
Encyclopedia
HPGL, sometimes hyphenated as HP-GL, was the primary printer control language used by Hewlett-Packard
Hewlett-Packard
Hewlett-Packard Company or HP is an American multinational information technology corporation headquartered in Palo Alto, California, USA that provides products, technologies, softwares, solutions and services to consumers, small- and medium-sized businesses and large enterprises, including...

 plotter
Plotter
A plotter is a computer printing device for printing vector graphics. In the past, plotters were widely used in applications such as computer-aided design, though they have generally been replaced with wide-format conventional printers...

s. The name is an initialism for Hewlett-Packard Graphics Language. It later became a standard for almost all plotters. Hewlett-Packard's printers
Computer printer
In computing, a printer is a peripheral which produces a text or graphics of documents stored in electronic form, usually on physical print media such as paper or transparencies. Many printers are primarily used as local peripherals, and are attached by a printer cable or, in most new printers, a...

 also usually support HPGL in addition to PCL
Printer Command Language
Printer Command Language, more commonly referred to as PCL, is a page description language 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,...

.

The language is formed from a series of two letter codes, followed by optional parameters. For instance an arc
Arc (geometry)
In geometry, an arc is a closed segment of a differentiable curve in the two-dimensional plane; for example, a circular arc is a segment of the circumference of a circle...

 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
Cartesian coordinate system
A Cartesian coordinate system specifies each point uniquely in a plane by a pair of numerical coordinates, which are the signed distances from the point to two fixed perpendicular directed lines, measured in the same unit of length...

 100,100 on the page, with a starting angle of 50 degrees
Degree (angle)
A degree , usually denoted by ° , is a measurement of plane angle, representing 1⁄360 of a full rotation; one degree is equivalent to π/180 radians...

 measured counter-clockwise. A fourth optional parameter (not used here) specifies how far the arc continues, and defaults to 5 degrees.

Typical HPGL files start with a few setup commands, followed by a long string of graphics commands. The file was in ASCII
ASCII
The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...

 (text file
Text file
A text file is a kind of computer file that is structured as a sequence of lines of electronic text. A text file exists within a computer file system...

) format
File format
A file format is a particular way that information is encoded for storage in a computer file.Since a disk drive, or indeed any computer storage, can store only bits, the computer must have some way of converting information to 0s and 1s and vice-versa. There are different kinds of formats for...

, for instance:
An example HPGL file
Command Meaning
IN; initialize, start a plotting job
IP; set the initial point (origin), in this case the default 0,0
SC0,40,0,40; allows scaling in millimeters since 1 mm = 40 plotter units. Each user-unit is 1 millimeter, in both X and Y directions
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 (in this case mm, after the SC command)
CI25; draw a circle with radius 25 (mm)
SS; select the standard font
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
LTlinetype,length set line type and its repetition length
CSxx set character set (e.g. 33 is German)
DIx,y set direction of text given as the catheti
SIww,hh set character width and height


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
Floating point
In computing, floating point describes a method of representing real numbers in a way that can support a wide range of values. Numbers are, in general, represented approximately to a fixed number of significant digits and scaled using an exponent. The base for the scaling is normally 2, 10 or 16...

 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 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
Binary file
A binary file is a computer file which may contain any type of data, encoded in binary form for computer storage and processing purposes; for example, computer document files containing formatted text...

format was defined that allowed for smaller files and shorter file transfer times, and the minimal resolution was reduced.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK