home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / fish / applications / xlispstat / man.lzh / Manual / Mac / figtex.pro next >
Encoding:
Text File  |  1990-10-12  |  1.7 KB  |  81 lines

  1. %!
  2. % All software, documentation, and related files in this distribution of
  3. % psfig/tex are Copyright (c) 1987 Trevor J. Darrell
  4. %
  5. % Permission is granted for use and non-profit distribution of psfig/tex 
  6. % providing that this notice be clearly maintained, but the right to
  7. % distribute any portion of psfig/tex for profit or as part of any commercial
  8. % product is specifically reserved for the author.
  9. %
  10. %
  11. % psfigTeX PostScript Prolog
  12. % $Header: figtex.pro,v 1.3 87/01/19 00:56:36 trevor Exp $
  13. %
  14. /TeXscale { 65536 div } def
  15.  
  16. /startTexFig {
  17. % usage :  x y bb-llx bb-lly bb-urx bb-ury startFig
  18.     /SavedState save def
  19.     userdict maxlength dict begin
  20.     currentpoint transform
  21.     initgraphics
  22.     itransform moveto
  23.  
  24.     /ury exch TeXscale def
  25.     /urx exch TeXscale def
  26.     /lly exch TeXscale def
  27.     /llx exch TeXscale def
  28.     /y exch TeXscale def
  29.     /x exch TeXscale def
  30.     
  31.     currentpoint /cy exch def /cx exch def
  32.  
  33.     /sx x urx llx sub div def     % scaling for x
  34.     /sy y ury lly sub div def    % scaling for y
  35.  
  36.     sx sy scale            % scale by (sx,sy)
  37.  
  38.     cx sx div llx sub
  39.     cy sy div ury sub translate
  40.     
  41.     /DefFigCTM matrix currentmatrix def
  42.     /initmatrix {
  43.         DefFigCTM setmatrix
  44.     } def
  45.     /defaultmatrix {
  46.         DefFigCTM exch copy
  47.     } def
  48.     /exval {
  49.         load dup
  50.         dup xcheck exch
  51.         type /arraytype eq and {
  52.             aload pop
  53.         } if
  54.     } def
  55.     /initgraphics [
  56.         /initgraphics exval
  57.         DefFigCTM /setmatrix exval
  58.     ] cvx def
  59.  
  60.     /showpage {
  61.         initgraphics
  62.     } def
  63.  
  64. } def
  65. % Args are llx lly urx ury (in figure coordinates)
  66. /clipFig {
  67.     currentpoint 6 2 roll
  68.     newpath 4 copy
  69.     4 2 roll moveto
  70.     6 -1 roll exch lineto
  71.     exch lineto
  72.     exch lineto
  73.     closepath clip
  74.     moveto
  75. } def
  76. % doclip, if called, will always be just after a `startfig'
  77. /doclip { llx lly urx ury clipFig } def
  78. /endTexFig {
  79.     end SavedState restore
  80. } def
  81.