home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d5xx
/
d572
/
multiplot.lha
/
Multiplot
/
Docs
/
HPGL2PS.doc
< prev
next >
Wrap
Text File
|
1991-12-22
|
8KB
|
231 lines
HPGL2PS
A HP (Hewlet Packard) plot command filter to PostScript
for the Commodore Amiga
Ported 7/8/1990 by Dr Alan G Baxter
Walter & Eliza Hall Institute,
Parkville 3053, AUSTRALIA
Not all the commands of HPGL are implemented (approx 95% are) and
those commands that are not are skipped and a warning given.
It is very easy to add to this filter if a particular unimplemented
command is desired.
SYNOPSIS
hpgl2ps
[-A | B | 4 | 3]
[-m]
[-r]
[-l line sizes]
[-s scale]
[-x offset]
[-y offset]
[-h font height multiplier]
[-w font width multiplier]
[plotfile]
DESCRIPTION
This filter is used to convert Hewlet Packard Graphic Language (HP-GL)
7550A plotter commands to PostScript. The HP-GL commands are a subset of the
Roland plotter command set (RD-GL).
The default conditions for hpgl2ps are:
A. The plot translation is from an ANSI A (8.5 x 11inch) plot to ANSI A
paper on the LaserWriter. See below for other paper sizes.
B. Line thicknesses are in millimeters and are for lines (pens) 1 to 9:
( 0.4, 0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2 )
C. The default font is Helvetica, 14 point on the Laserwriter.
D. The default font height and width multipliers are 1.2 and 3.6 respectively.
Note:
If the ouput is not redirected then standard output is assumed.
ARGUMENTS
-A Draw for an ANSI A (11 x 8.5inch) plot.
-B Draw for an ANSI B (17 x 11inch) plot.
-4 Draw for an A4 ISO (297mm x 210mm) plot. This will give an
aproximate 1:1 translation to the LaserWriter.
-3 Draw for an A3 ISO (420mm x 297mm) plot.
-l line sizes
This option allows the default line sizes to be replaced with different
sizes starting from line (pen) one through nine. The new sizes (real or
integer) are entered in a comma seperated string (line size) and
are in millimeters. Only the sizes entered in the string will be
changed with respect to lines (pens) one to nine while nonentered line
(pen) sizes will retain the default sizes.
In the following example only the first three sizes will be changed.
eg: hpgl2ps -l0.4,0.3,1 file
-m Enable the manual feed on the LaserWriter (cutoff time 3 minutes).
-r Rotate plot(s) through 90 degrees. (Aspect ratio distorted)
-s scale
Scale the plot from 0.1 to 3 times its original size.
-w relative font width multiplier
When the SR command exists in the HP-GL file, the size of
characters is scaled to be a proportion of the paper dimensions.
The HP7550 plotter character sizes are larger than the scaling suggests.
The default value of the font width multiplier scales the characters in the
postscript file to appear roughly the same width as the original.
Setting to 1.0 reverts to the original scaling.
-w relative font height multiplier
When the SR command exists in the HP-GL file, the size of characters
is scaled to be a proportion of the paper dimensions. The HP7550 plotter
character sizes are larger than the scaling suggests. The default
value of the font height multiplier scales the characters in the
postscript file to appear roughly the same width as the original.
Setting to 1.0 reverts to the original scaling.
-x offset
Place an X offset (in mm) in the plot.
-y offset
Place an Y offset (in mm) in the plot.
Note: Offsets are with respect to the 0, 0 (origin) of the HP-GL
/ RD-GL plotting commands, thus if the minimum plotting coordinates are
below either the X and/or Y zero axis then a positive offset is
applied. Similarly if the minimum plot coordinates are above the X
and/or Y zero axis then a negative offset is applied.
AUTHOR
Don McCormick
CSIRO
Division of Applied Physics
PO 218, Lindfield, N.S.W., 2070
Australia
Scaling, Tick Marks, and other modifications by:
Gordon Jacobs, University of California, Berkeley
Amiga port, RO command support, by:
Alan Baxter, Walter & Eliza Hall Institute, Melbourne
BUGS
Some of the graphics commands are unimplemented and a warning will be
displayed. If this command is vital then it must be written into the code.
No interactive command is suported.
-------------------------
Notes on first enhancement:
Support for user defined characters added by
Gerald William Kokodyniak B.A.Sc. M.A.Sc.
University of Toronto, Department of Mechanical Engineering
-------------------------
Notes on second enhancement:
Support for Scaling, tickmarks, and better user defined characters
added by Gordon Jacobs, (Ph.D., since we're into titles above)
University of California, Berkeley in July 1989.
Mods were made ONLY for the hpgl2ps program and are not guaranteed
to work for dxy2ps. HP-GL code from the Tektronix DSA 602
Digitizing Signal Analyzer (scope) were used as a test.
Laserwriter output was compared directly with plots from a
HP7550A plotter reading the same HP-GL file.
Support for scaling was added.
The Scaling involves re-setting the coordinate
system by re-calculating the XSCALE and YSCALE numbers and adding
an offset to the origin. The offset had to be added to all files
that make use of the scaling parameters.
Tick marks were added with tick.c. Uses relative draw commands
to make the tick marks and adds two global variables which are
the tick length as a percentage of the overall dimensions.
The parser was changed. The SIGNED_NUMERIC macro recognized a comma
as a valid character which does not make sense. The HP-GL code from
the DSA 602 often contains a mnemonic followed by a comma, but with
no parameters. This is valid code although most sources will not
place a comma unless optional parameters actually follow. The comma
was removed as a valid SIGNED_NUMERIC character and the function
getval() was modified to read all trailing commas and spaces. In
this way the parser works for both the standard and odd case
mentioned above.
The user defined character routine was modified heavily. Original
function did not take into account the angle of characters. The
new function reads the current angle of characters and orients
the user defined character in the same way. The scaling, which was
originally huge for some reason now is dynamically set to a
proportion of the size of regular text character. The linewidth
of the user defined character is arbitrarily set to 0.25mm and
then the restored to the previous value. This width seems to fit
the "linewidth" of the characters in the postscript helvetica
font sized for the DSA 602 output.
The default paper size is changed to be 8.5 x 11 inch paper with
command line options added to support all others.
The command line options -w and -h were added because the relative
scaling of fonts with the "SR" HP-GL command, while implemented
correctly, gives much smaller character sizes than the HP7550A plotter.
The defaults were set empirically to match plotter output.
The sizes in viewport.c were modified to get correct positioning
on the 8.5 x 11 paper when compared to a plot directly from the
HP7550A on the same type of paper.
The textps() routine was modified to move the position pointers to
the end of a string when a string is drawn. This was commented out
in the code that I received, but needed to be restored for the
user defined character to be in the correct place. The results
match the HP plotter for the same code.
--------------------------
Notes on third enhancement:
I have written some test procedures for the testing of each filter they
are "test1.hpgl" for hpgl2ps and "test1.dxy" for dxy2ps.
Don McCormick.
----------------------------
Notes on Amiga Port:
Due to the vagarities of the CLI, the argument flag '-' must be
immediately followed by the argument, unlike the UNIX version in
which a space is allowed.
The line types have been made to repeat their pattern every 3.25mm to
more closely represent the HPGL output of Multiplot.
The line widths have been changed to suit Multiplot.
The stderr output has been redirected to NIL: to avoid unwanted error
messages in Multiplot. Delete main.c and link without main.o to
return stderr to the current CLI.
The automatic scaling with maintainence of aspect ratio in portrait mode
has been removed. It was very nice, but not right!
Support for the RO90; and RO0; commands has been added. This required
major changes in hpglcom.c, viewport.c and plotcoords.c.
Alan Baxter