home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / GhostScript / !GhostScr / 6_01 / lib / markpath.ps < prev    next >
Text File  |  2000-03-09  |  2KB  |  62 lines

  1. %    Copyright (C) 1993 Aladdin Enterprises.  All rights reserved.
  2. % This file is part of Aladdin Ghostscript.
  3. % Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  4. % or distributor accepts any responsibility for the consequences of using it,
  5. % or for whether it serves any particular purpose or works at all, unless he
  6. % or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  7. % License (the "License") for full details.
  8. % Every copy of Aladdin Ghostscript must include a copy of the License,
  9. % normally in a plain ASCII text file named PUBLIC.  The License grants you
  10. % the right to copy, modify and redistribute Aladdin Ghostscript, but only
  11. % under certain conditions described in the License.  Among other things, the
  12. % License requires that the copyright notice and this notice be preserved on
  13. % all copies.
  14.  
  15. % $Id: markpath.ps,v 1.1 2000/03/09 08:40:40 lpd Exp $
  16. % markpath.ps
  17. % Mark the corners of a path, drawing it slowly if desired.
  18.  
  19. /Delay where { pop } { /Delay 0 def } ifelse
  20. /setxy0
  21.  { currentpoint /y0 exch def /x0 exch def
  22.  } def
  23. /bip
  24.  { epsx epsy idtransform /ey exch def /ex exch def
  25.    currentpoint ex 2 div ey 2 div rlineto currentpoint 0 ey neg rlineto
  26.    ex neg 0 rlineto 0 ey rlineto lineto lineto
  27.    stroke
  28.  } def
  29. /dally
  30.  { Delay { } repeat
  31.    Delay 0 ne { flushpage } if
  32.  } def
  33. /movebip
  34.  { /xs 2 index def /ys 1 index def
  35.    gsave newpath mpmx transform moveto setxy0 bip grestore
  36.  } def
  37. /linebip
  38.  { gsave newpath x0 y0 moveto mpmx transform lineto setxy0 bip dally grestore
  39.  } def
  40. /curvebip
  41.  { gsave newpath x0 y0 moveto 5 index 5 index mpmx transform lineto bip
  42.    2 copy mpmx transform moveto 3 index 3 index mpmx transform lineto bip
  43.    x0 y0 moveto
  44.    3 { mpmx transform 6 2 roll } repeat
  45.    curveto setxy0 bip dally grestore
  46.  } def
  47. /closebip
  48.  { xs ys linebip
  49.  } def
  50.  
  51. /markpath        % <matrix> markpath -
  52.  { /mpmx exch def 
  53.    gsave initgraphics 9 dup dtransform grestore
  54.      /epsy exch def   /epsx exch def
  55.    gsave 0 setlinewidth
  56.     { movebip } { linebip } { curvebip } { closebip } pathforall
  57.    grestore
  58.  } def
  59.