home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / inne / gs300ini / markpath.ps < prev    next >
Encoding:
Text File  |  1994-08-02  |  2.0 KB  |  60 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. % markpath.ps
  16. % Mark the corners of a path, drawing it slowly if desired.
  17.  
  18. /Delay where { pop } { /Delay 0 def } ifelse
  19. /setxy0
  20.  { currentpoint /y0 exch def /x0 exch def
  21.  } def
  22. /bip
  23.  { epsx epsy idtransform /ey exch def /ex exch def
  24.    currentpoint ex 2 div ey 2 div rlineto currentpoint 0 ey neg rlineto
  25.    ex neg 0 rlineto 0 ey rlineto lineto lineto
  26.    stroke
  27.  } def
  28. /dally
  29.  { Delay { } repeat
  30.  } def
  31. /movebip
  32.  { /xs 2 index def /ys 1 index def
  33.    gsave newpath mpmx transform moveto setxy0 bip grestore
  34.  } def
  35. /linebip
  36.  { gsave newpath x0 y0 moveto mpmx transform lineto setxy0 bip dally grestore
  37.  } def
  38. /curvebip
  39.  { gsave newpath x0 y0 moveto 5 index 5 index mpmx transform lineto bip
  40.    2 copy mpmx transform moveto 3 index 3 index mpmx transform lineto bip
  41.    x0 y0 moveto
  42.    3 { mpmx transform 6 2 roll } repeat
  43.    curveto setxy0 bip dally grestore
  44.  } def
  45. /closebip
  46.  { xs ys linebip
  47.  } def
  48.  
  49. /markpath        % <matrix> markpath -
  50.  { /mpmx exch def 
  51.    gsave initgraphics 9 dup dtransform grestore
  52.      /epsy exch def   /epsx exch def
  53.    gsave 0 setlinewidth
  54.     { movebip } { linebip } { curvebip } { closebip } pathforall
  55.    grestore
  56.  } def
  57.