Missing file in the HPGL to PostScript converter

Federico Heinz federico at actisb.UUCP
Wed Jan 25 20:56:08 AEST 1989


  The HPGL to PostScript translation program I wrote about some time ago
has finally showed up in comp.sources.misc, so please look there and
help yourself if you want it.

  Of course, Murphy stroke again, and the only thing I could think about
going wrong did go wrong:  I forgot including the prelude file in the
posting.  Since it's not long I've decided to include it here. Cut along
the dashed line, don't forget to eliminate my signature, and save the
remainings in the file 'yahp2ps.pre' in the source directory of yahp2ps
before doing 'make install'.

- - - - - - - - - - - - - - CUT HERE - - - - - - - - - - - - - - - - - -
%!

% initialization

.072 .072 scale
/RTM matrix currentmatrix def
newpath clippath pathbbox 3 1 roll pop pop translate -90 rotate
newpath
/NTM matrix currentmatrix def
/SM matrix currentmatrix def
1 setlinecap 1 setlinejoin
gsave

% procedure definition

% shorthand notation for commonly used commands

/A   { arc } def
/C   { closepath } def
/CD  { currentpoint lineto } def
/D   { 0 setdash } def
/G   { setgray } def
/L   { lineto } def
/M   { moveto } def
/R   { rotate } def
/S   { stroke } def
/SC  { closepath clip newpath } def
/SSM { SM setmatrix } def
/T   { pathbbox pop pop translate pathbbox newpath } def
/TB  { gsave newpath [] 0 setdash } def
/TE  { lineto stroke grestore } def
/TS  { translate scale } def
/W   { setlinewidth } def

% Reset the clipping path

/RC
{ currentdash
  currentlinewidth
  currentgray
  grestore
  gsave
  setgray
  setlinewidth
  setdash
} def

% Set portrait format

/POR
{ RTM dup /SM exch def setmatrix } def


% Set landscape format

/LND
{ NTM dup /SM exch def setmatrix } def


% Hatch a surface.
% rubbish rubbish x y spacing cross -> H -> -

/H
{ /cross exch def
  /spacing exch def
  /endy exch def
  /endx exch def
  pop pop
  [] 0 setdash
  0 spacing endy
  { dup 0 exch moveto
    endx exch lineto
  } for
  cross
  { 0 spacing endx
    { dup 0 moveto
      endy lineto
    } for
  } if
  stroke grestore newpath
} def
- - - - - - - - - - - - - - CUT HERE - - - - - - - - - - - - - - - - - -



More information about the Comp.sources.bugs mailing list