home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2002 February / INTERNET88.ISO / pc / software / windows / bits / pdf995 / data1.cab / Program_Executable_Files / res / markpath.ps < prev    next >
Encoding:
Text File  |  2001-12-08  |  2.1 KB  |  63 lines

  1. %    Copyright (C) 1993 Aladdin Enterprises.  All rights reserved.
  2. % This file is part of GNU Ghostscript.
  3. % GNU Ghostscript is distributed in the hope that it will be useful, but
  4. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  5. % to anyone for the consequences of using it or for whether it serves any
  6. % particular purpose or works at all, unless he says so in writing.  Refer
  7. % to the GNU General Public License for full details.
  8. % Everyone is granted permission to copy, modify and redistribute GNU
  9. % Ghostscript, but only under the conditions described in the GNU General
  10. % Public License.  A copy of this license is supposed to have been given
  11. % to you along with GNU Ghostscript so you can know your rights and
  12. % responsibilities.  It should be in a file named COPYING.  Among other
  13. % things, the copyright notice and this notice must be preserved on all
  14. % copies.
  15.  
  16. % $RCSfile: markpath.ps,v $ $Revision: 1.2.2.1 $
  17. % markpath.ps
  18. % Mark the corners of a path, drawing it slowly if desired.
  19.  
  20. /Delay where { pop } { /Delay 0 def } ifelse
  21. /setxy0
  22.  { currentpoint /y0 exch def /x0 exch def
  23.  } def
  24. /bip
  25.  { epsx epsy idtransform /ey exch def /ex exch def
  26.    currentpoint ex 2 div ey 2 div rlineto currentpoint 0 ey neg rlineto
  27.    ex neg 0 rlineto 0 ey rlineto lineto lineto
  28.    stroke
  29.  } def
  30. /dally
  31.  { Delay { } repeat
  32.    Delay 0 ne { flushpage } if
  33.  } def
  34. /movebip
  35.  { /xs 2 index def /ys 1 index def
  36.    gsave newpath mpmx transform moveto setxy0 bip grestore
  37.  } def
  38. /linebip
  39.  { gsave newpath x0 y0 moveto mpmx transform lineto setxy0 bip dally grestore
  40.  } def
  41. /curvebip
  42.  { gsave newpath x0 y0 moveto 5 index 5 index mpmx transform lineto bip
  43.    2 copy mpmx transform moveto 3 index 3 index mpmx transform lineto bip
  44.    x0 y0 moveto
  45.    3 { mpmx transform 6 2 roll } repeat
  46.    curveto setxy0 bip dally grestore
  47.  } def
  48. /closebip
  49.  { xs ys linebip
  50.  } def
  51.  
  52. /markpath        % <matrix> markpath -
  53.  { /mpmx exch def 
  54.    gsave initgraphics 9 dup dtransform grestore
  55.      /epsy exch def   /epsx exch def
  56.    gsave 0 setlinewidth
  57.     { movebip } { linebip } { curvebip } { closebip } pathforall
  58.    grestore
  59.  } def
  60.