An HPGFL(Hewlett-Packard Graphics Language) file contains instruction set for plotter control by developed by HP. HP plotters use this file to draw and print vector and raster content on the paper.
An HPGL command consists of the following.
A command section of the alphabet of two characters
A parameter section
Each parameter in the file has to be devided with a separator in case of multiple parameters.
HPGL Command Example
Coordinates systems comprises of 2-dimensional measurement indicators to locate any specific location. The HPGL uses both Plotter coordinate and user coordinate system for this purpose.
Plotter Coordinate System
This coordindate system is used to plot drawings based on plotter movement. A typical XY unit of minimum plotter movement is 0.025mm. The possible range of drawing changes with plotter kinds.
User coordinate system
User specified coordinate system can be set up using the scale and origin. These are converted to plotter coordinates using the IP command and SC command. Plotter system coordinates are used by default if this conversion is not carried out.
HPGL File Format
HPGL files are in ASCII (text file) format and start with few setup commands. This sets up certain parameters for the plotter for plotting. A typical HPGL file looks as follow.
initialize, start a plotting job
set the scaling points (P1 and P2) to their default positions
select pen 1
lift Pen Up and move to starting point for next action
put Pen Down and move to the following locations (draw a box around the page)
Pen Up and move to X,Y coordinates 50,50
draw a circle with radius 25
select the standard character set
set the text delimiter to the asterisk, and do not print them (the 1, meaning “true”)