home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / inne / gs300ini / ppath.ps < prev    next >
Encoding:
Text File  |  1994-08-02  |  1.8 KB  |  50 lines

  1. %    Copyright (C) 1989, 1992, 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. % Redefine pathforall for tracing.
  16. % Can't be used recursively.
  17.  
  18. /# {( )print} def
  19.  
  20. /-pathforall /pathforall load def
  21. /-p2 { ( ) print exch =only ( ) print =only } bind def
  22. /-tp2 { transform -p2 } bind def
  23. /-dict 5 dict def
  24.  
  25. /pathforall
  26.  { -dict begin
  27.    /-close exch def  /-curve exch def  /-line exch def  /-move exch def
  28.    end
  29.    {2 copy -p2 ( moveto\t%)print
  30.     2 copy -tp2 (\n)print
  31.     flush  -dict /-move get exec}
  32.    {2 copy -p2 ( lineto\t%)print
  33.     2 copy -tp2 (\n)print
  34.     flush  -dict /-line get exec}
  35.    {5 index 5 index -p2 3 index 3 index -p2 2 copy -p2 ( curveto\t%)print
  36.     5 index 5 index -tp2 3 index 3 index -tp2 2 copy -tp2 (\n)print
  37.     flush  -dict /-curve get exec}
  38.    {(closepath\n)print flush   -dict /-close get exec}
  39.    -pathforall
  40.   }
  41.  def
  42.  
  43. % Just print the current path
  44.  
  45. /printpath
  46.  { {pop pop} {pop pop} {pop pop pop pop pop pop} {} pathforall } def
  47.