home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 212.img / PW220.ZIP / PW.PS < prev    next >
Text File  |  1990-06-01  |  12KB  |  419 lines

  1. % Professional Write PostScript prologue file
  2. % version 1.02
  3. % Copyright 1988 Software Publishing Corporation
  4.  
  5.  
  6. /PWdict 75 dict def        % define the Professional Write dictionary
  7. PWdict begin
  8.  
  9. /bd {bind def} bind def
  10.  
  11.  
  12.  
  13.  
  14.  
  15. /Linefont            % recreate IBM's line drawing chars
  16. 10 dict dup begin
  17. /FontType 3 def
  18. /FontMatrix [.001 0 0 .001 0 0] def
  19. /FontBBox [0 -300 600 700] def
  20. /Encoding 256 array def
  21. 0 1 255 {Encoding exch /.notdef put} for
  22. Encoding 176 [
  23. /onequarter /onehalf /threequarters
  24. /tb /tbl /tbl2 /t2b2l /b2l /bl2 /t2b2l2 /t2b2 /b2l2 /t2l2 /t2l 
  25. /tl2 /bl /tr /trl /rbl /trb /rl /trbl /tr2b /t2rb2 /t2r2 /r2b2 
  26. /t2r2l2 /r2b2l2 /t2r2b2 /r2l2 /t2r2b2l2 /tr2l2 /t2rl /r2bl2 
  27. /rb2l /t2r /tr2 /r2b /rb2 /t2rb2l /tr2bl2 /tl /rb
  28. /block /bblock /lblock /rblock /tblock
  29. ] putinterval
  30. Encoding 32 /space put
  31. Encoding 254 /squarebullet put
  32.  
  33. /CharDefs 80 dict def CharDefs begin
  34. /.notdef {} def
  35.  
  36. /lx 0 def
  37. /rx 600 def
  38. /by -300 def
  39. /ty 700 def
  40. /cx 300 def
  41. /cy 350 def
  42. /c1x 245 def
  43. /c2x 355 def
  44. /c1y 295 def
  45. /c2y 405 def
  46. /sqblx 150 def
  47. /sqbrx 450 def
  48. /sqbty 500 def
  49. /sqbby 200 def
  50.  
  51. /l {gsave lx currentpoint exch pop lineto stroke grestore} bd
  52. /r {gsave rx currentpoint exch pop lineto stroke grestore} bd
  53. /t {gsave currentpoint pop ty lineto stroke grestore} bd
  54. /b {gsave currentpoint pop by lineto stroke grestore} bd
  55. /box {3 index 3 index moveto 3 index 1 index lineto 
  56.       1 index 1 index lineto 1 index 3 index lineto 
  57.       closepath fill pop pop pop pop} bd
  58.  
  59. /tb {cx ty moveto b} bd
  60. /tbl {cx cy moveto t b l} bd
  61. /bl {cx cy moveto b l} bd
  62. /tr {cx cy moveto t r} bd
  63. /trl {cx cy moveto t r l} bd
  64. /rbl {cx cy moveto r b l} bd
  65. /trb {cx cy moveto t r b} bd
  66. /rl {lx cy moveto r} bd
  67. /trbl {cx cy moveto t r b l} bd
  68. /tl {cx cy moveto t l} bd
  69. /rb {cx cy moveto r b} bd
  70. /tbl2 {cx c1y moveto t b l cx c2y moveto l} bd
  71. /t2b2l {c1x cy moveto t b l c2x ty moveto b} bd
  72. /b2l {c2x cy moveto b l c1x cy moveto b} bd
  73. /bl2 {cx c2y moveto b l cx c1y moveto l} bd
  74. /t2b2l2 {c1x c1y moveto b l c1x c2y moveto t l c2x ty moveto b} bd
  75. /t2b2 {c1x ty moveto b c2x ty moveto b} bd
  76. /b2l2 {c1x c1y moveto b l c2x c2y moveto b l} bd
  77. /t2l2 {c1x c2y moveto t l c2x c1y moveto t l} bd
  78. /t2l {c2x cy moveto t l c1x cy moveto t} bd
  79. /tl2 {cx c1y moveto t l cx c2y moveto l} bd
  80. /tr2b {cx c1y moveto t r b cx c2y moveto r} bd
  81. /t2rb2 {c2x cy moveto t r b c1x ty moveto b} bd
  82. /t2r2 {c1x c1y moveto t r c2x c2y moveto t r} bd
  83. /r2b2 {c1x c2y moveto r b c2x c1y moveto r b} bd
  84. /t2r2l2 {c1x c2y moveto t l c2x c2y moveto t r lx c1y moveto r} bd
  85. /r2b2l2 {lx c2y moveto r c1x c1y moveto b l c2x c1y moveto r b} bd
  86. /t2r2b2 {c2x c2y moveto t r c2x c1y moveto r b c1x ty moveto b} bd
  87. /r2l2 {lx c1y moveto r lx c2y moveto r} bd
  88. /t2r2b2l2 {c1x c1y moveto b l c1x c2y moveto t l c2x c2y moveto t r c2x c1y moveto r b} bd
  89. /tr2l2 {cx c2y moveto t r l lx c1y moveto r} bd
  90. /t2rl {c1x cy moveto t r l c2x cy moveto t} bd
  91. /r2bl2 {lx c2y moveto r cx c1y moveto r b l} bd
  92. /rb2l {c1x cy moveto r b l c2x cy moveto b} bd
  93. /t2r {c1x cy moveto t r c2x cy moveto t} bd
  94. /tr2 {cx c1y moveto t r cx c2y moveto r} bd
  95. /r2b {cx c2y moveto r b cx c1y moveto r} bd
  96. /rb2 {c1x cy moveto r b c2x cy moveto b} bd
  97. /t2rb2l {c1x cy moveto t r b l c2x ty moveto b} bd
  98. /tr2bl2 {cx c1y moveto t r b l lx c2y moveto r} bd
  99. /block  {lx by rx ty box} bd
  100. /bblock {lx by rx cy box} bd
  101. /lblock {lx by cx ty box} bd
  102. /rblock {cx by rx ty box} bd
  103. /tblock {lx cy rx ty box} bd
  104. /onequarter {lx by rx ty box} bd
  105. /onehalf {lx by rx ty box} bd
  106. /threequarters {lx by rx ty box} bd
  107. /space {} bd
  108. /squarebullet {sqblx sqbby sqbrx sqbty box} bd
  109. end
  110.  
  111. /BuildChar
  112. {
  113.     20 setlinewidth
  114.     600 0 0 -300 600 700 setcachedevice
  115.     exch begin
  116.     Encoding exch get
  117.     CharDefs begin load exec end
  118.     end
  119. } bd
  120.  
  121. /FontInfo 10 dict def FontInfo begin
  122. /Notice (Copyright 1988 Software Publishing Corporation) def
  123. /FullName (Line-Light) def
  124. /FamilyName (Line) def
  125. /Weight (Light) def
  126. /version (001.000) def
  127. /UnderlinePosition -80 def
  128. /UnderlineThickness 40 def
  129. /isFixedPitch true def
  130. /ItalicAngle 0 def
  131. end
  132. end
  133. def
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. /SPCEncoding 256 array def            % access foreign chars
  141. StandardEncoding SPCEncoding copy pop
  142.  
  143. SPCEncoding 128 [
  144. /Ccedilla /udieresis /eacute /acircumflex /adieresis /agrave /aring 
  145. /ccedilla /ecircumflex /edieresis /egrave /idieresis /icircumflex 
  146. /igrave /Adieresis /Aring /Eacute /ae /AE /ocircumflex /odieresis /ograve 
  147. /ucircumflex /ugrave /ydieresis /Odieresis /Udieresis /cent /sterling
  148. /yen /.notdef /florin /aacute /iacute /oacute /uacute /ntilde /Ntilde 
  149. /ordfeminine /ordmasculine /questiondown /.notdef /.notdef /.notdef
  150. /.notdef /exclamdown /guillemotleft /guillemotright
  151. ] putinterval
  152. SPCEncoding 20 [/paragraph /section] putinterval
  153. SPCEncoding 225 [/germandbls /dagger /daggerdbl 
  154.                  /quotedblleft /quotedblright] putinterval
  155.  
  156.  
  157.  
  158. /MakeSPCFont            % make fonts with foreign chars in 'em
  159. {
  160.    FontDirectory 1 index known not FontDirectory 3 index known and
  161.    {
  162.       exch findfont dup length dict exch
  163.       {  1 index /FID eq
  164.          { pop pop }
  165.          { 1 index /Encoding eq { pop SPCEncoding } if
  166.            2 index 3 1 roll put
  167.          } ifelse
  168.       } forall
  169.       definefont pop
  170.    }
  171.    {pop pop} ifelse
  172. } bd
  173.  
  174. /cstr 100 string def
  175. /sstr (-SPC) def
  176.  
  177. /setSPCfonts
  178. {
  179.     fonts
  180.     {
  181.     dup cstr cvs sstr search
  182.     {exch pop exch pop cvn exch MakeSPCFont}
  183.     {pop pop} ifelse
  184.     } forall
  185. } bd
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193. /family 0 def                    % state variables
  194. /bold false def
  195. /italic false def
  196. /underline false def
  197. /superscript false def
  198. /subscript false def
  199. /sideways false def
  200. /lineheight 12 def
  201. /fontsize 10 def
  202. /linedrawing false def
  203.  
  204. /dirty false def
  205.  
  206.  
  207.  
  208. /leftmargin 0 def                % some useful numbers
  209. /scriptfactor .8 def
  210. /line1 {11 72 mul lineheight sub} bd
  211. /line1sw {8.5 72 mul lineheight sub} bd
  212. /superoffset {fontsize .3 mul} bd
  213. /suboffset   {fontsize .25 mul neg} bd
  214.  
  215.  
  216.  
  217.  
  218. /savestate            % be able to save and restore state
  219. {
  220.     family bold italic underline superscript subscript
  221.     sideways lineheight fontsize linedrawing
  222.     manualfeedOK {statusdict begin manualfeed end} if
  223. } bd
  224.  
  225. /getstate            % restoring state, set orientation and font
  226. {
  227.     manualfeedOK {statusdict begin /manualfeed exch def end} if
  228.     /linedrawing exch def
  229.     /fontsize exch def
  230.     /lineheight exch def
  231.     /sideways exch def
  232.     /subscript exch def
  233.     /superscript exch def
  234.     /underline exch def
  235.     /italic exch def
  236.     /bold exch def
  237.     /family exch def
  238.     leftmargin line1 moveto
  239.     sideways {612 0 translate 90 rotate leftmargin line1sw moveto} if
  240.     setfontnstyle
  241. } bd
  242.  
  243.  
  244.  
  245.  
  246.  
  247. /fonts                % all fonts accessible from Professional Write
  248. [
  249. /Courier-SPC /Courier-Bold-SPC /Courier-Oblique-SPC /Courier-BoldOblique-SPC
  250. /Times-Roman-SPC /Times-Bold-SPC /Times-Italic-SPC /Times-BoldItalic-SPC
  251. /Helvetica-SPC /Helvetica-Bold-SPC /Helvetica-Oblique-SPC /Helvetica-BoldOblique-SPC
  252. /Helvetica-Narrow-SPC /Helvetica-Narrow-Bold-SPC /Helvetica-Narrow-Oblique-SPC /Helvetica-Narrow-BoldOblique-SPC
  253. /Palatino-Roman-SPC /Palatino-Bold-SPC /Palatino-Italic-SPC /Palatino-BoldItalic-SPC
  254. /AvantGarde-Book-SPC /AvantGarde-Demi-SPC /AvantGarde-BookOblique-SPC /AvantGarde-DemiOblique-SPC
  255. /Bookman-Light-SPC /Bookman-Demi-SPC /Bookman-LightItalic-SPC /Bookman-DemiItalic-SPC
  256. /NewCenturySchlbk-Roman-SPC /NewCenturySchlbk-Bold-SPC /NewCenturySchlbk-Italic-SPC /NewCenturySchlbk-BoldItalic-SPC
  257. /ZapfChancery-MediumItalic-SPC /ZapfChancery-MediumItalic-SPC /ZapfChancery-MediumItalic-SPC /ZapfChancery-MediumItalic-SPC
  258. ] def
  259.  
  260. /fontlength fonts length def        % length of fonts array
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267. /bounds                    % bounds-checking algorithm
  268. {
  269.     3 index 3 index lt 4 index 3 index gt or
  270.     { {exch} if pop exch pop}
  271.     {pop pop pop} ifelse
  272. } bd
  273.  
  274.  
  275.  
  276.  
  277.  
  278. /init        % initialization - install fonts, start page 1
  279. {
  280.     /Linefont Linefont definefont pop
  281.     setSPCfonts startpage setfontnstyle
  282. } bd
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290. % the following routines are called from other routines
  291. % routines include start new page, eject page, set font and style
  292. % (style includes bold, italic, underline, super/subscript, line drawing),
  293. % import graph from HG, draw an underline
  294.  
  295.  
  296. /startpage {/s1 save def leftmargin line1 moveto} bd
  297.  
  298. /endpage {showpage s1 restore} bd
  299.  
  300. /setfontnstyle
  301. {
  302.     linedrawing
  303.     {/Linefont findfont [fontsize 0 0 lineheight 0 0] makefont setfont}
  304.     {
  305.     fonts family 4 mul bold {1 add} if italic {2 add} if 
  306.     0 fontlength false bounds get
  307.     findfont fontsize scalefont
  308.     superscript subscript or {scriptfactor scalefont} if
  309.     setfont
  310.     } ifelse
  311. } bd
  312.  
  313.  
  314. /doHGgraph
  315. {
  316.     0 currentpoint exch pop lineheight add 792 exch sub neg
  317.     currentfile cstr readline pop length
  318.     0 66 true bounds {nl} repeat
  319.     /s2 save def
  320.     /initgraphics {} def
  321.     /HGdict 50 dict def HGdict begin
  322.     translate {currentfile cvx exec} stopped pop
  323.     end
  324.     s2 restore
  325.     dirty not {/dirty true def} if
  326. } bd
  327.  
  328. /markdict 1 dict def markdict begin
  329. /cleartomarkdict
  330. { {currentdict end /cleartomarkdict known {exit} if} loop} bd
  331. end
  332.  
  333. /showunderline
  334. {
  335.     dup stringwidth pop exch show
  336.     gsave markdict begin mark exch
  337.     {
  338.     currentfont begin
  339.     FontMatrix
  340.     FontInfo begin
  341.     0 UnderlinePosition 2 index transform rmoveto
  342.     UnderlineThickness 0 3 -1 roll transform pop setlinewidth
  343.     end
  344.     end
  345.     neg 0 rlineto stroke
  346.     } stopped
  347.     pop cleartomarkdict cleartomark grestore
  348. } bd
  349.  
  350.  
  351.  
  352.  
  353.  
  354. /manualfeedOK
  355.  markdict begin mark
  356.  {
  357.     statusdict begin
  358.     currentdict /manualfeed known
  359.     {/manualfeed load type /booleantype eq} {false} ifelse
  360. } stopped cleartomarkdict {cleartomark false} {exch pop} ifelse
  361. def
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368. % these routines are called from the script
  369. % included are turning all enhancements on and off,
  370. % (enhancements are bold, italic, underline, super/subscript, and line drawing)
  371. % horizontal pen movement (absolute and relative), changing font,
  372. % font size, line height, orientation (portrait or landscape),
  373. % showing a string, going to a new line, ejecting a page
  374.  
  375. /U {/underline true def} bd
  376. /u {/underline false def} bd
  377. /B {/bold true def setfontnstyle} bd
  378. /b {/bold false def setfontnstyle} bd
  379. /I {/italic true def setfontnstyle} bd
  380. /i {/italic false def setfontnstyle} bd
  381. /SP {/superscript true def setfontnstyle} bd
  382. /sp {/superscript false def setfontnstyle} bd
  383. /SB {/subscript true def setfontnstyle} bd
  384. /sb {/subscript false def setfontnstyle} bd
  385. /F {/family exch def setfontnstyle}  bd
  386. /L {/linedrawing true def setfontnstyle} bd
  387. /l {/linedrawing false def setfontnstyle} bd
  388. /M {10.0 div currentpoint exch pop moveto} bd
  389. /MR {10.0 div 0 rmoveto} bd
  390. /ML {10.0 div neg 0 rmoveto} bd
  391. /HG {doHGgraph} bd
  392. /SZ {/fontsize exch def setfontnstyle} bd
  393. /LH {/lineheight exch def} bd
  394. /SW {sideways not {/sideways true def dirty {ff} {fakeff} ifelse} if} bd
  395. /sw {sideways {/sideways false def dirty {ff} {fakeff} ifelse} if} bd
  396. /MF {manualfeedOK {statusdict begin /manualfeed true def end} if} bd
  397. /mf {manualfeedOK {statusdict begin /manualfeed false def end} if} bd
  398.  
  399. /nl {currentpoint lineheight sub exch pop leftmargin exch moveto} bd
  400.  
  401. /ff {savestate endpage startpage getstate} bd
  402.  
  403. /fakeff {savestate s1 restore startpage getstate} bd    % ff without the showpage
  404.  
  405.  
  406. /s
  407. {
  408.     superscript {0 superoffset rmoveto} if
  409.     subscript {0 suboffset rmoveto} if
  410.     underline {showunderline} {show} ifelse
  411.     superscript {0 superoffset neg rmoveto} if
  412.     subscript {0 suboffset neg rmoveto} if
  413.     dirty not {/dirty true def} if
  414. } bd
  415.  
  416.  
  417. end
  418.  
  419.