home *** CD-ROM | disk | FTP | other *** search
/ swCHIP 1991 January / swCHIP_95-1.bin / utility / gs333ini / gs3.33 / ps2ai.ps < prev    next >
Text File  |  1995-12-09  |  21KB  |  506 lines

  1. %!
  2. %    Copyright (C) 1994 Aladdin Enterprises.  All rights reserved.
  3. %
  4. % This file is part of Ghostscript.
  5. %
  6. % Ghostscript is distributed in the hope that it will be useful, but
  7. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. % to anyone for the consequences of using it or for whether it serves any
  9. % particular purpose or works at all, unless he says so in writing.  Refer
  10. % to the Ghostscript General Public License for full details.
  11. %
  12. % Everyone is granted permission to copy, modify and redistribute
  13. % Ghostscript, but only under the conditions described in the Ghostscript
  14. % General Public License.  A copy of this license is supposed to have been
  15. % given to you along with Ghostscript so you can know your rights and
  16. % responsibilities.  It should be in a file named COPYING.  Among other
  17. % things, the copyright notice and this notice must be preserved on all
  18. % copies.
  19.  
  20. %xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  21. %
  22. %   ps2ai.ps - a postscript to editable adobe illustrator file filter
  23. %
  24. /vers {1.81} def                   %                      Mar 14, 1994  
  25. %
  26. %xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  27. %
  28. % needs a postscript level 2 interpreter, like gnu ghostscript, to work
  29. %
  30. %      Usage:   gs -q -dNODISPLAY ps2ai.ps file.ps > file.aips
  31. %                              or (see below)
  32. %               gs -q -dNODISPLAY ps2ai.ps file.ps
  33. %                              or
  34. %               cat ps2ai.ps file.ps | lpr  (then look in log file)
  35. %xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  36. %                            Options
  37. %xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  38. %   Output Options: directly to a file or standard out
  39. %
  40. /jout false def            % true=file  false=stdout (default=false)
  41. /joutput (ps2ai.out.aips) def      % Name of Output file
  42. %
  43. %xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  44. %
  45. %              Other Options
  46. %
  47. /jtxt3 true def           % output text in AI3 form (false=ai88)
  48.                           % for coreldraw/photoshop readable output
  49. /jerr true def            % use error handling (ie die gracefully)
  50. /jbiterr false def         % attempt to handle bitmap fonts (kludge)
  51. /jMacGS false def         % true if using MacGS (not fully implemented yet)
  52. /jMacfix true def         % convert filled boxes to lines (only usefull with
  53.                           % laserwriter 8 postscript input)
  54. %
  55. %xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  56. %                    No options below here
  57. %xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  58. %
  59. %         - Notes -
  60. %  ai uses cmykcolor, so level 1 interpreters don't work
  61. %  ai doesn't use image/imagemask - so bitmaps don't work correctly
  62. %  the output file has a header so it is viewable/printable/reconvertable
  63. %
  64. % Comments, suggestions, bug-fixes, etc send to:
  65. %
  66. %        Jason Olszewski (olszewsk@splash.princeton.edu)
  67. %
  68. % anonymous ftp: toby.princeton.edu /pub/olszewsk/ps2ai.ps
  69. %       URL ftp://toby.princeton.edu/pub/olszewsk
  70. %
  71. %         - Fix History -
  72. %  1.81 added custom color/gray support to header (x/X, g/G)
  73. %  1.8 added newpath if clippath is not consumed correctly(amiga)
  74. %  1.79 eliminated scientific notation of numbers less than 0.0001
  75. %  1.78 fixed transposed h & H
  76. %  1.77 made laserwriter 8 fixes optional
  77. %  1.76 added margin fix for unix AI (brown@wi.extrel.com)
  78. %  1.75 added kludge to handle bitmap font errors (TeX, Windows.ps)
  79. %  1.74 made grestore a little smarter
  80. %  1.73 included header handle encoded fontname (/_fontname)
  81. %  1.72 fixed problem with restore/clip info - (not enough Qs problem)
  82. %  1.71 filter font names to remove previous encoding (|,_,etc)
  83. %  1.7  change text format to AI3, works better with PS & CD
  84. %  1.67 deal with weird makefonts 
  85. %  1.66 handle to many bad stroke/fills (s s s w/o paths)
  86. %  1.65 more useable with non-gs interpreters (defaultmatrix fix)
  87. %  1.64 fixed "smart grestore" repeat bug
  88. %  1.63 fixed ashow/awidthshow bug
  89. %  1.62 check if cmykcolor is understood otherwise rgb
  90. %  1.61 made grestore smarter (only print if different)
  91. %  1.6  add better compatibility to CorelDraw and PhotoShop
  92. %  1.53 make it more gs-backward compatible (clarke@lsl.co.uk)
  93. %  1.52 handle clipping paths a little better (Posted)
  94. %  1.51 improve mac lw8 output (lines instead of filled boxes)
  95. %  1.5 handle some level 2 stuff (mac lw8)
  96. %  1.4 fixed scaling of linewidth and dash
  97. %  1.31 made trailer more AI88 friendly
  98. %  1.3 add ablity to output to file directly
  99. %  1.21 print matrix cleaner
  100. %  1.2 fix rotated fonts, thanks to G.Cameron (g.cameron@biomed.abdn.ac.uk)
  101. %  1.1 fix stroke/fill color difference (k vs K)
  102. %  1.0 posted to comp.lang.postscript
  103. %
  104. %         - To Do List -
  105. %  find real %%BoundingBox: llx lly urx ury
  106. %  make MacGS friendly
  107. %  handle eps w/o showpage:(append to end)
  108. %  handle complex clipping/painted paths better
  109. %
  110. %xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  111. %                  Nothing of Interest below here
  112. %xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  113. matrix identmatrix setmatrix %   make ctm [1 0 0 1 0 0]
  114. /oldgsave {} def /oldgrestore {} def
  115. /initgraphics {} def /initmatrix {} def 
  116. /xdef {exch def} def
  117. /trx {transform exch} def
  118. /cbdef {cvx bind def} def
  119. /jltz {dup abs 0.0001 lt {pop 0} if} def % get rid of scientific notation bug
  120. /clstate false def        % closepath state
  121. /dpth false def           % destroy path (ie newpath)
  122. /fclp false def           % first paint after clip
  123. /kscl {1.0} def
  124. /gcnt {1} def             % graphics state counter
  125. /spth {1} def             % multiple paths on stack
  126. /jeol (\n) def            % default end-of-line
  127. /jx {0} def /jy {0} def /j_ax {0} def
  128. /j3ftxt true def
  129. /clarry 10 array def
  130. 0 1 9 {clarry exch false put} for % initilize no clipping path
  131. %
  132. % handle cmyk color on level 1 interpreters
  133. /setcmykcolor where {pop}
  134.  {/setcmykcolor {
  135.    /blk exch def /yel exch def /mag exch def /cyan exch def
  136.    /ccomp {add dup 1 gt {pop 1} if} def
  137.    /red {1 cyan blk ccomp sub} def
  138.    /green {1 mag blk ccomp sub} def
  139.    /blue {1 yel blk ccomp sub} def
  140.    red green blue setrgbcolor
  141.   } def
  142. } ifelse
  143. /currentcmykcolor where {pop}
  144.  {/currentcmykcolor {
  145.    currentrgbcolor /bval xdef /gval xdef /rval xdef
  146.    /rawC 1 rval sub def /rawM 1 gval sub def /rawY 1 bval sub def
  147.    rawC rawM ge { rawY rawM ge { /blk rawM def} if } if
  148.    rawC rawY ge { rawM rawY ge { /blk rawY def} if } if
  149.    rawY rawC ge { rawM rawC ge { /blk rawC def} if } if
  150.    rawY rawC eq { rawM rawC eq { /blk rawC def} if } if
  151.    /cyan  rawC blk sub  def
  152.    /mag  rawM blk sub  def
  153.    /yel  rawY blk sub  def
  154.    /blk blk def
  155.    cyan mag yel blk
  156.   } def
  157. } ifelse
  158. % If using Mac Ghostscript 
  159. jMacGS { 
  160. %        /jeol {(\r) jp} def
  161.         /jout true def
  162.         (%%Note: Loading ps2ai.ps\n) print
  163.        } if
  164. /jstr 40 string def
  165. jout {joutput (w) file /joutput xdef} if
  166. %
  167. %              Output
  168. %
  169. jout {/jp { joutput exch writestring } bind def }{/jp {print}bind def} ifelse
  170. /jpnum {jltz ( ) jp =string cvs jp } bind def
  171. /jpmat { dup /jarry exch def length 1 sub /j_num exch def
  172.  (\[) jp 0 1 j_num {jarry exch get jpnum} for (\]) jp } def
  173. %
  174. %              Stack to Paths converters
  175. %
  176. /jpm {dpth {  % if there are multiple paths on the stack
  177.   spth 0 eq {clstate {(n\n) jp }{(N\n) jp } ifelse} if
  178.   spth 1 eq {clstate {(s\n) jp }{(S\n) jp } ifelse} if
  179.   spth 2 eq {clstate {(f\n) jp }{(F\n) jp } ifelse} if
  180.   spth 3 eq {clstate {(h W n\n) jp }{(H W N\n) jp } ifelse} if} if 
  181.   /dpth true def
  182.   transform 2 copy /yst xdef /xst xdef exch jpnum jpnum ( m\n) jp } bind def
  183. /jpl { trx jpnum jpnum ( l\n) jp } bind def
  184. /jpc {  6 4 roll trx jpnum jpnum 4 2 roll trx jpnum jpnum trx
  185.     jpnum jpnum ( c\n) jp } bind def
  186. /jpp {xst jpnum yst jpnum ( l\n) jp /clstate true def} def
  187. /ppforall { {jpm}{jpl}{jpc}{jpp} pathforall } bind def
  188. %
  189. %              Painting Operators
  190. %
  191. /jckfclp {fclp {(*U\n) jp} if /fclp false def} def % check compound clip path
  192. /oldnewpath [/newpath load] cbdef
  193. /newpath {oldnewpath dpth {clstate {(n\n) jp }{(N\n) jp } ifelse} if
  194.  jckfclp  /clstate false def /dpth false def /spth 0 def} def
  195. /stroke { (\n) jp /spth 1 def ppforall  oldnewpath
  196.  dpth { clstate {(s\n) jp }{(S\n) jp } ifelse jckfclp 
  197.   /clstate false def /dpth false def} if oldnewpath } def
  198. /fill   {(\n) jp /spth 2 def ppforall  oldnewpath
  199.  dpth {clstate {(f\n) jp }{(F\n) jp } ifelse jckfclp 
  200.  /clstate false def /dpth false def} if oldnewpath} def
  201. /eofill {fill} def
  202. /clip   {clarry gcnt get {(Q\n*u\nq\n) jp}{(*u\nq\n) jp} ifelse /spth 3 def 
  203.  ppforall /fclp true def oldnewpath   
  204.  clstate {(h ) jp }{(H ) jp } ifelse (W\n) jp clarry gcnt true put} def
  205. /eoclip {clip} def
  206. %
  207. %               Text Operators
  208. %
  209. /oldshow [/show load] cbdef
  210. /curpt {stringwidth pop jx add jy} def 
  211. /jNN {dup 0 eq {pop oldgsave currentfont /FontMatrix get setmatrix kscl
  212.                 oldgrestore} if
  213. } def
  214. /curftmatrix {
  215.  currentfont /FontMatrix get dup 0 get jNN abs /norm exch def 
  216.  dup 0 get norm div exch dup
  217.  1 get norm div exch dup 2 get norm div exch dup 3 get norm div exch dup
  218.  4 get exch 5 get 6 array astore matrix currentmatrix matrix concatmatrix
  219. } def
  220. % AI does not support negitive font sizes
  221. /curftsize {currentfont /FontMatrix get 0 get jNN abs 1000 mul} def
  222. /hstr (X) def
  223. /vbar (|) 0 get def /undsc (_) 0 get def
  224. /ftnamefix { % handle font names with |,_ (previously encoded)
  225. jstr cvs
  226. { %forall
  227.         dup vbar eq {pop}{ %ifelse
  228.             dup undsc eq {pop}{ %ifelse
  229.                     hstr exch 0 exch put hstr jp
  230.             } ifelse
  231.         } ifelse
  232.    } forall   flush
  233. } bind def
  234. %/handleerror {pop pop (Times-Roman)} def
  235. /curftname {currentfont /FontName get ftnamefix}def
  236. /lftpar (\() 0 get def
  237. /rhtpar (\)) 0 get def
  238. /bckslsh (\\) 0 get def
  239. /handft { % handle strings with (,),\
  240.    (\() jp
  241.    { %forall
  242.         dup lftpar eq { (\\\() jp }{ %ifelse
  243.             dup rhtpar eq { (\\\)) jp }{ %ifelse
  244.                 dup bckslsh eq { (\\\\) jp }{ %ifelse
  245.                     hstr exch 0 exch put hstr jp
  246.                 } ifelse
  247.             } ifelse
  248.         } ifelse
  249.    } forall (\)) jp flush
  250. } bind def
  251. % AI 3 text format pieces
  252. jtxt3 {
  253. /j3txt { j3ftxt {(0 Ts 100 Tz 0 Tt 0 TA 0 0 5 TC 100 100 200 TW 0 0 0 Ti\n) jp
  254.                 (0 Ta 0 Tq 0 0 TI 0 Tc 0 Tw\n) jp} if } def
  255. /show {oldgsave (0 To\n) jp 
  256.   currentpoint 2 copy /jy exch def /jx exch def translate 
  257.   curftmatrix /jitm exch def
  258.   0 1 5 {jitm exch get jpnum} for ( 0 Tp\n) jp (TP\n) jp
  259.   (0 Tr\n) jp (\/_) jp curftname  curftsize jpnum ( Tf\n) jp
  260.   (0) jp j_ax  curftsize div 100 mul jpnum ( 100 TC\n) jp %  percent(?)
  261.   dup curpt moveto handft ( Tx\n) jp (TO\n) jp /j3ftxt false def
  262.   currentpoint oldgrestore moveto
  263. } def  
  264. /ashow {exch pop exch /j_ax exch def show /j_ax {0} def } def
  265.  {
  266. /show {oldgsave (u\n) jp currentpoint 2 copy /jy exch def /jx exch def translate
  267.   (\/) jp curftname jstr cvs jp
  268.   curftsize dup jpnum  jpnum ( 0 0 z\n) jp
  269.   curftmatrix jpmat ( e\n) jp
  270.   dup curpt moveto handft ( t T U\n) jp
  271.   currentpoint oldgrestore moveto} def
  272. /ashow {oldgsave (u\n) jp currentpoint translate (\/) jp curftname jstr cvs jp
  273.   curftsize dup jpnum jpnum  exch kscl mul jpnum ( 0 z\n) jp
  274.   curftmatrix jpmat ( e\n) jp dup curpt moveto handft
  275.   ( t T U\n) jp currentpoint oldgrestore moveto} def
  276. } ifelse
  277. /widthshow { show pop pop pop} def
  278. /awidthshow {ashow pop pop pop} def
  279. /kshow {show pop} def
  280. %/show {true charpath fill} bind def   % get outline of charactor
  281. %/show {oldshow} def    % do nothing different
  282. %
  283. %               Color Operators
  284. %
  285. /oldsetcmykcolor [/setcmykcolor load] cbdef
  286. /setcmykcolor {oldsetcmykcolor 
  287. currentcmykcolor 4 -1 roll jpnum 3 -1 roll jpnum 2 -1 roll jpnum jpnum ( k\n) jp
  288. currentcmykcolor 4 -1 roll jpnum 3 -1 roll jpnum 2 -1 roll jpnum jpnum ( K\n) jp
  289.  } def
  290. /oldsetgray [/setgray load] cbdef
  291. /setgray {0 0 0 4 -1 roll 1 exch sub setcmykcolor} def
  292. /oldsethsbcolor [/sethsbcolor load] cbdef
  293. /sethsbcolor {oldsethsbcolor currentcmykcolor setcmykcolor} def
  294. /setrgbcolor {/bval xdef /gval xdef /rval xdef
  295.  /rawC 1 rval sub def /rawM 1 gval sub def /rawY 1 bval sub def
  296.  rawC rawM ge { rawY rawM ge { /blk rawM def} if } if
  297.  rawC rawY ge { rawM rawY ge { /blk rawY def} if } if
  298.  rawY rawC ge { rawM rawC ge { /blk rawC def} if } if
  299.  rawY rawC eq { rawM rawC eq { /blk rawC def} if } if
  300.  /cyan  rawC blk sub  def
  301.  /mag  rawM blk sub  def
  302.  /yel  rawY blk sub  def
  303.  /blk blk def
  304.  cyan mag yel blk setcmykcolor } def
  305. %
  306. %                State Operators
  307. %
  308. /oldsetlinewidth [/setlinewidth load] cbdef
  309. /setlinewidth {kscl abs mul jltz  oldsetlinewidth
  310.  currentlinewidth jpnum ( w\n) jp } def
  311. /oldsetlinecap [/setlinecap load] cbdef
  312. /setlinecap {dup oldsetlinecap jpnum ( J\n) jp} def
  313. /oldsetlinejoin [/setlinejoin load] cbdef
  314. /setlinejoin {dup oldsetlinejoin jpnum ( j\n) jp} def
  315. /oldsetmiterlimit [/setmiterlimit load] cbdef
  316. /setmiterlimit {dup oldsetmiterlimit jpnum ( M\n) jp}def
  317. /oldsetdash [/setdash load] cbdef
  318. /setdash {exch [ exch {kscl abs mul} forall ] exch kscl abs mul oldsetdash
  319.   currentdash exch jpmat jpnum ( d\n) jp } def
  320. /oldsetflat [/setflat load] cbdef
  321. /setflat {dup oldsetflat jpnum ( i\n) jp } def
  322. %
  323. %                More State Operators
  324. %
  325. /kscl { % use just the x scale factor
  326.  oldgsave
  327.  matrix currentmatrix /jctm exch def
  328.  jctm 4 0 put jctm 5 0 put jctm setmatrix
  329.  1 0 moveto currentpoint transform
  330.  dup mul exch dup mul add sqrt 10000 mul round 10000 div
  331.  oldgrestore
  332. } def
  333. /currentstate {currentcmykcolor setcmykcolor
  334.  currentflat jpnum ( i) jp currentlinecap jpnum ( J) jp
  335.  currentlinejoin jpnum ( j) jp currentlinewidth jpnum ( w) jp
  336.  currentmiterlimit jpnum ( M ) jp currentdash exch jpmat jpnum ( d\n) jp 
  337. } def
  338. /jdifG {
  339.  currentcmykcolor /jok xdef /joy xdef /jom xdef /joc xdef
  340.  currentflat /jof xdef currentlinecap /jolc xdef currentlinejoin /jolj xdef
  341.  currentlinewidth /jolw xdef currentmiterlimit /joml xdef
  342.  currentdash /jood xdef /joad xdef
  343.  oldgrestore
  344.  currentcmykcolor /jnk xdef /jny xdef /jnm xdef /jnc xdef
  345.  currentflat /jnf xdef currentlinecap /jnlc xdef currentlinejoin /jnlj xdef
  346.  currentlinewidth /jnlw xdef currentmiterlimit /jnml xdef
  347.  currentdash /jnod xdef /jnad xdef
  348.  % compare old gstate to new gstate
  349.  joc jnc ne jom jnm ne joy jny ne jok jnk ne
  350.  jof jnf ne jolc jnlc ne jolj jnlj ne jolw jnlw ne joml jnml ne 
  351.  false joad {true exit} forall {pop pop true}{false} ifelse
  352.  false jnad {true exit} forall {pop pop true}{false} ifelse ne
  353.  jood jnod ne 10 {or} repeat {currentstate} if
  354. } def
  355. /oldgsave [/gsave load] cbdef
  356. /gsave {oldgsave /gcnt gcnt 1 add def } def % clarry gcnt false put} def
  357. %  (%%Note:gsave ) jp gcnt jpnum (\n) jp} def
  358. /oldgrestore [/grestore load] cbdef
  359. /grestore {dpth {newpath} if clarry gcnt get {(Q\n) jp clarry gcnt false put} if 
  360.  jdifG /gcnt gcnt 1 sub def } def
  361. % oldgrestore currentstate } def
  362. % (%%Note:grestore ) jp gcnt 1 add jpnum (\n) jp} def
  363. /oldrestore [/restore load] cbdef
  364. %/restore { 0 1 9 {clarry exch get {showpage} if } for oldrestore} def
  365. /showpage {  0 1 9 {clarry exch get {(Q\n) jp} if } for
  366.  (%%Note: If Error, make sure there are matched pairs of 'q's and 'Q's\n) jp
  367.  (%%Note: in the file. Add 'Q's before '%%Trailer' until equal\n) jp
  368.  (%%Trailer\n) jp
  369.  jtxt3 {(Adobe_IllustratorA_AI3 /terminate get exec\n) jp
  370.         (Adobe_typography_AI3 /terminate get exec\n) jp
  371.         (Adobe_customcolor /terminate get exec\n) jp
  372.         (Adobe_cshow /terminate get exec\n) jp
  373.         (Adobe_cmykcolor /terminate get exec\n) jp
  374.         (Adobe_packedarray /terminate get exec\n) jp
  375. }{
  376.         (Adobe_Illustrator881 /terminate get exec\n) jp
  377.         (Adobe_customcolor /terminate get exec\n) jp
  378.         (Adobe_cshow /terminate get exec\n) jp
  379.         (Adobe_cmykcolor /terminate get exec\n) jp
  380.         (Adobe_packedarray /terminate get exec\n) jp 
  381.        } ifelse
  382. ( showpage\n%EOF\n%%EndDocument\n) jp
  383.  jout {joutput closefile} if jMacGS not {quit} if /j3ftxt true def } def 
  384. %
  385. %                Error handling
  386. %
  387. errordict begin
  388. % Attempt to handle the error caused by bitmap fonts (TeX,Windows.ps,etc)
  389. % this is a big-time kludge
  390. jbiterr {
  391.  /undefined {pop pop (Times-Roman)} def
  392.  /typecheck {pop pop} def
  393. } if
  394. jerr {
  395.  /handleerror {
  396.   (%%Note: ps2ai error, aborting rest of conversion\n) jp showpage
  397.  } def
  398. } if
  399. end
  400. %
  401. %                Mac LW 8 improvements
  402. %
  403. /jmacimp { % stroked line instead of thin filled boxes
  404.  /@a {  3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll add exch moveto
  405.       3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll exch sub exch lineto
  406.       abs setlinewidth  stroke pop pop} def
  407.  /@b { 3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll add exch moveto
  408.       pop
  409.       3 -1 roll 2 div dup 3 -1 roll add exch 3 -1 roll add exch lineto
  410.       abs setlinewidth  stroke} def
  411.  /endp {showpage pm restore} def % because the restore stops clean up
  412. } def
  413. %
  414. %                Handle (some) PS Level 2
  415. %
  416. /rectstroke { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
  417.   closepath stroke} def
  418. /rectfill { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
  419.   fill } def
  420. /rectclip { 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto
  421.   closepath clip newpath jMacfix {jmacimp} if } def
  422. %
  423. % Add a header prolog to the output file so it is still view/print-able
  424. %
  425. (%!PS-Adobe-2.0 EPSF-1.2\n%%BoundingBox: 0 0 612 792\n) jp
  426. (%%Title: Adobe Illustator 3 Editable Document\n) jp
  427. (%%Creator: ps2ai.ps vers.) jp vers jpnum ( \(C\) 1993-94 Jason Olszewski\n) jp
  428. (%%TemplateBox: 0 0 612 792\n) jp
  429. jtxt3 {(%%AI3_Margin:0 0 0 0\n) jp } if
  430. (%%EndComments\n) jp
  431. (%%BeginProlog\n) jp
  432. (/m {moveto} def /l {lineto} def /c {curveto} def\n) jp
  433. (/S {stroke} def /F {fill} def\n) jp
  434. (/s {closepath S} def /f {closepath F} def\n) jp
  435. (/q {gsave} def /Q {grestore} def /W {clip} def /k {setcmykcolor} def\n) jp
  436. (/i {setflat} def /J {setlinecap} def /j {setlinejoin} def\n) jp
  437. (/w {setlinewidth} def /M {setmiterlimit} def /d {setdash} def\n) jp
  438. (/u {gsave} def /U {grestore} def /K {k} def\n) jp
  439. (/N {newpath} def /n {closepath N} def\n) jp
  440. (/g {setgray} def /G {g} def\n) jp
  441. (/x {pop pop k} def /X {x} def\n) jp
  442. (/H {} def /h {H closepath} def\n) jp
  443. (/*u {} def /*U {} def\n) jp
  444. %(\n) jp
  445. jtxt3 {
  446.  (/TC {pop pop pop} def /Tr {pop} def\n) jp
  447.  (/To {pop gsave} def /TO {grestore} def\n) jp
  448.  (/Tp {pop matrix astore concat} def  /TP {0 0 moveto} def\n) jp
  449.  (/a_str 40 string def /cnt 0 def /h_str (X) def /undsc (_) 0 get def\n) jp
  450.  (/fntfix {a_str cvs dup length 1 sub /f_str exch string def\n) jp
  451.  (  {dup undsc eq {pop}{f_str cnt 3 -1 roll put /cnt cnt 1 add def\n) jp
  452.  (  } ifelse } forall flush /cnt 0 def f_str cvn } bind def\n) jp
  453.  
  454.  (/Tf {exch fntfix findfont exch scalefont setfont} def /Tx {show} def\n) jp
  455. }{
  456.  (/z {pop pop pop exch findfont exch scalefont setfont} def\n) jp
  457.  (/e {concat 0 0 m} def /t {show} def /T {} def\n) jp
  458. } ifelse
  459. (\n) jp
  460. jtxt3 {
  461.  (userdict /Adobe_packedarray 2 dict dup begin put\n) jp
  462.  (/initialize {} def /terminate {} def\n) jp
  463.  (userdict /Adobe_cmykcolor 2 dict dup begin put\n) jp
  464.  (/initialize {} def /terminate {} def\n) jp
  465.  (userdict /Adobe_cshow 2 dict dup begin put\n) jp
  466.  (/initialize {} def /terminate {} def\n) jp
  467.  (userdict /Adobe_customcolor 2 dict dup begin put\n) jp
  468.  (/initialize {} def /terminate {} def\n) jp
  469.  (userdict /Adobe_typography_AI3 2 dict dup begin put\n) jp
  470.  (/initialize {} def /terminate {} def\n) jp
  471.  (userdict /Adobe_IllustratorA_AI3 2 dict dup begin put\n) jp
  472.  (/initialize {} def /terminate {} def\n) jp
  473. }{
  474.  (userdict /Adobe_packedarray 2 dict dup begin put\n) jp
  475.  (/initialize {} def /terminate {} def\n) jp
  476.  (userdict /Adobe_cmykcolor 2 dict dup begin put\n) jp
  477.  (/initialize {} def /terminate {} def\n) jp
  478.  (userdict /Adobe_cshow 2 dict dup begin put\n) jp
  479.  (/initialize {} def /terminate {} def\n) jp
  480.  (userdict /Adobe_customcolor 2 dict dup begin put\n) jp
  481.  (/initialize {} def /terminate {} def\n) jp
  482.  (userdict /Adobe_Illustrator881 2 dict dup begin put\n) jp
  483.  (/initialize {} def /terminate {} def\n) jp
  484. } ifelse
  485. (%%EndProlog\n) jp
  486. (%%BeginSetup\n) jp
  487. jtxt3 {
  488.  (Adobe_packedarray /initialize get exec\n) jp
  489.  (Adobe_cmykcolor /initialize get exec\n) jp
  490.  (Adobe_cshow /initialize get exec\n) jp
  491.  (Adobe_customcolor /initialize get exec\n) jp
  492.  (Adobe_typography_AI3 /initialize get exec\n) jp
  493.  (Adobe_IllustratorA_AI3 /initialize get exec\n) jp
  494. }{
  495.  (Adobe_packedarray /initialize get exec\n) jp
  496.  (Adobe_cmykcolor /initialize get exec\n) jp
  497.  (Adobe_cshow /initialize get exec\n) jp
  498.  (Adobe_customcolor /initialize get exec\n) jp
  499.  (Adobe_Illustrator881 /initialize get exec\n) jp
  500. } ifelse
  501. (%%EndSetup\n) jp
  502. 0 0 0 1 oldsetcmykcolor
  503. currentstate
  504. jout {(%%Note: Load Postscript file to be converted now\n) print} if
  505.