Using HPGL as a drawing interchange media

This document is also
available in Russian,
thanks to Sergey Paramonov.
(You will need the Russian font set!)

Introduction

HPGL is the HP graphics language designed for specifying 2D graphical
information for the HP range of plotters. It was not intended as an
interchange format but some software suppliers use it as such. At least
it is efficient and easy to write and read. This short note describes
those aspects of the format which may be used to describe geometry. The
language itself has a large number of instructions, most of the ones not
touched on here relate directly to plotter devices, for a full description
of the language the HPGL description is normally provided with an HPGL
compatable plotter.

Basics

HPGL commands are basically two uppercase character instructions followed
by any arguments, and finally ending in the separator character which
is a semicolon by default. The arguments are normally separated by commas.
String arguments are normally terminated by carriage return.

In what follows, all the standard HPGL commands are listed, those which
are likely to be useful for data interchange will be discussed at the end
of this document.
Optional arguments for any command are shown in brackets.

Output Instructions

The following instructions don't have any arguments but rather generate
output from the plotting device. They are of no use for interchanging
geometric data and therefore the form of the output is not discussed.
See an HPGL reference book.

Escape sequnces

The following escape sequences are generally only applicable when
connected through a serial interface to a physical plotter, they have
nothing to do with data interchange and so their arguments will not
be listed nor will the form of the output most of them create .