Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

HP-GL

From Wikipedia, the free encyclopedia
Printer control language created by Hewlett-Packard (HP)
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "HP-GL" – news ·newspapers ·books ·scholar ·JSTOR
(September 2016) (Learn how and when to remove this message)
Hewlett-Packard Graphics Language
Internet media type
application/vnd.hp-HPGL

HP-GL, short forHewlett-Packard Graphics Language and often written asHPGL, is aprinter control language created byHewlett-Packard (HP). HP-GL was the primary printer control language used by HPplotters.[1] It was introduced with the plotterHP-9872 in 1977 and became a standard for almost all plotters. Hewlett-Packard'sprinters also usually support HP-GL/2 in addition toPCL.[2]

Design

[edit]

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

AA100,100,50;

This meansArc Absolute, and the parameters place the center of the arc at absolutecoordinates 100,100 on the page, with a starting angle of 50degrees 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, ..., cLabelASCII 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:

  • [i]: integer formats between -32767 and 32768. No decimal point.
  • [d]: decimal format between +/- 127.9999. Optional decimal point.
  • [c]: ASCII character

Examples

[edit]

Typical HP-GL files start with a few setup commands, followed by a long string of graphics commands. The file was inASCII (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 negativefloating point numbers, specifically ±230.

HP-GL/2

[edit]

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 firstinkjet 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. WithHewlett-Packard Graphics Language/2 akaHP-GL/2, definition of line width was introduced into the language and allowed for elimination of this step. Also, among other improvements abinary 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

[edit]

HP-GL is related toAGL (A Graphics Language), an extension of theBASIC programming language. AGL was implemented on Hewlett-Packardminicomputers 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

[edit]
  • DMPL, another plotter language by Houston Instruments
  • Gerber format is another plot-description format
  • Logo, a computer language with drawing commands similar to HP-GL

References

[edit]
  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. Retrieved2016-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

[edit]

External links

[edit]
Applications and utilities
Database
File systems and formats
Operating systems and environments
Protocols and languages
  • Asterisk (*) denotes software continued byHP Inc.
  • Double asterisk (**) denotes software continued byHewlett Packard Enterprise
  • Dagger (†) denotes software divested and sold off
  • Double dagger (‡) denotes third-party software
Authority control databases: NationalEdit this at Wikidata
Retrieved from "https://en.wikipedia.org/w/index.php?title=HP-GL&oldid=1325656627"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp