home *** CD-ROM | disk | FTP | other *** search
/ The SelectWare System Volume 2 #3 / The_SelectWare_System_Series_1_Volume_2_Number_3_Selectware.iso / sof10020 / pf.ps < prev    next >
Text File  |  1988-05-25  |  9KB  |  318 lines

  1. % Professional File PostScript prologue file
  2. % version 2.00
  3. % Copyright 1988 Software Publishing Corporation
  4.  
  5. /PWdict 75 dict def             % define the Professional Write dictionary
  6. PWdict begin
  7.  
  8. /bd {bind def} bind def
  9.  
  10. /Linefont            % recreate IBM's line drawing chars
  11. 10 dict dup begin
  12. /FontType 3 def
  13. /FontMatrix [.001 0 0 .001 0 0] def
  14. /FontBBox [0 -300 600 700] def
  15. /Encoding 256 array def
  16. 0 1 255 {Encoding exch /.notdef put} for
  17. Encoding 176 [
  18. /onequarter /onehalf /threequarters
  19. /tb /tbl /tbl2 /t2b2l /b2l /bl2 /t2b2l2 /t2b2 /b2l2 /t2l2 /t2l 
  20. /tl2 /bl /tr /trl /rbl /trb /rl /trbl /tr2b /t2rb2 /t2r2 /r2b2 
  21. /t2r2l2 /r2b2l2 /t2r2b2 /r2l2 /t2r2b2l2 /tr2l2 /t2rl /r2bl2 
  22. /rb2l /t2r /tr2 /r2b /rb2 /t2rb2l /tr2bl2 /tl /rb
  23. /block /bblock /lblock /rblock /tblock
  24. ] putinterval
  25. Encoding 32 /space put
  26. Encoding 254 /squarebullet put
  27.  
  28.  
  29. /CharDefs 80 dict def CharDefs begin
  30. /.notdef {} def
  31.  
  32. /lx 0 def
  33. /rx 600 def
  34. /by -300 def
  35. /ty 700 def
  36. /cx 300 def
  37. /cy 350 def
  38. /c1x 245 def
  39. /c2x 355 def
  40. /c1y 295 def
  41. /c2y 405 def
  42. /sqblx 150 def
  43. /sqbrx 450 def
  44. /sqbty 500 def
  45. /sqbby 200 def
  46.  
  47. /l {gsave lx currentpoint exch pop lineto stroke grestore} bd
  48. /r {gsave rx currentpoint exch pop lineto stroke grestore} bd
  49. /t {gsave currentpoint pop ty lineto stroke grestore} bd
  50. /b {gsave currentpoint pop by lineto stroke grestore} bd
  51. /box {3 index 3 index moveto 3 index 1 index lineto 
  52.       1 index 1 index lineto 1 index 3 index lineto 
  53.       closepath fill pop pop pop pop} bd
  54.  
  55. /tb {cx ty moveto b} bd
  56. /tbl {cx cy moveto t b l} bd
  57. /bl {cx cy moveto b l} bd
  58. /tr {cx cy moveto t r} bd
  59. /trl {cx cy moveto t r l} bd
  60. /rbl {cx cy moveto r b l} bd
  61. /trb {cx cy moveto t r b} bd
  62. /rl {lx cy moveto r} bd
  63. /trbl {cx cy moveto t r b l} bd
  64. /tl {cx cy moveto t l} bd
  65. /rb {cx cy moveto r b} bd
  66. /tbl2 {cx c1y moveto t b l cx c2y moveto l} bd
  67. /t2b2l {c1x cy moveto t b l c2x ty moveto b} bd
  68. /b2l {c2x cy moveto b l c1x cy moveto b} bd
  69. /bl2 {cx c2y moveto b l cx c1y moveto l} bd
  70. /t2b2l2 {c1x c1y moveto b l c1x c2y moveto t l c2x ty moveto b} bd
  71. /t2b2 {c1x ty moveto b c2x ty moveto b} bd
  72. /b2l2 {c1x c1y moveto b l c2x c2y moveto b l} bd
  73. /t2l2 {c1x c2y moveto t l c2x c1y moveto t l} bd
  74. /t2l {c2x cy moveto t l c1x cy moveto t} bd
  75. /tl2 {cx c1y moveto t l cx c2y moveto l} bd
  76. /tr2b {cx c1y moveto t r b cx c2y moveto r} bd
  77. /t2rb2 {c2x cy moveto t r b c1x ty moveto b} bd
  78. /t2r2 {c1x c1y moveto t r c2x c2y moveto t r} bd
  79. /r2b2 {c1x c2y moveto r b c2x c1y moveto r b} bd
  80. /t2r2l2 {c1x c2y moveto t l c2x c2y moveto t r lx c1y moveto r} bd
  81. /r2b2l2 {lx c2y moveto r c1x c1y moveto b l c2x c1y moveto r b} bd
  82. /t2r2b2 {c2x c2y moveto t r c2x c1y moveto r b c1x ty moveto b} bd
  83. /r2l2 {lx c1y moveto r lx c2y moveto r} bd
  84. /t2r2b2l2 {c1x c1y moveto b l c1x c2y moveto t l c2x c2y moveto t r c2x c1y moveto r b} bd
  85. /tr2l2 {cx c2y moveto t r l lx c1y moveto r} bd
  86. /t2rl {c1x cy moveto t r l c2x cy moveto t} bd
  87. /r2bl2 {lx c2y moveto r cx c1y moveto r b l} bd
  88. /rb2l {c1x cy moveto r b l c2x cy moveto b} bd
  89. /t2r {c1x cy moveto t r c2x cy moveto t} bd
  90. /tr2 {cx c1y moveto t r cx c2y moveto r} bd
  91. /r2b {cx c2y moveto r b cx c1y moveto r} bd
  92. /rb2 {c1x cy moveto r b c2x cy moveto b} bd
  93. /t2rb2l {c1x cy moveto t r b l c2x ty moveto b} bd
  94. /tr2bl2 {cx c1y moveto t r b l lx c2y moveto r} bd
  95. /block  {lx by rx ty box} bd
  96. /bblock {lx by rx cy box} bd
  97. /lblock {lx by cx ty box} bd
  98. /rblock {cx by rx ty box} bd
  99. /tblock {lx cy rx ty box} bd
  100. /onequarter {lx by rx ty box} bd
  101. /onehalf {lx by rx ty box} bd
  102. /threequarters {lx by rx ty box} bd
  103. /space {} bd
  104. /squarebullet {sqblx sqbby sqbrx sqbty box} bd
  105. end
  106.  
  107. /FontInfo 10 dict def FontInfo begin
  108. /Notice (Copyright 1988 Software Publishing Corporation) def
  109. /FullName (Line-Light) def
  110. /FamilyName (Line) def
  111. /Weight (Light) def
  112. /version (001.000) def
  113. /UnderlinePosition -80 def
  114. /UnderlineThickness 40 def
  115. /isFixedPitch true def
  116. /ItalicAngle 0 def
  117. end
  118. end
  119. def
  120.  
  121.  
  122. /SPCEncoding 256 array def            % access foreign chars
  123. StandardEncoding SPCEncoding copy pop
  124.  
  125. SPCEncoding 128 [
  126. /Ccedilla /udieresis /eacute /acircumflex /adieresis /agrave /aring 
  127. /ccedilla /ecircumflex /edieresis /egrave /idieresis /icircumflex 
  128. /igrave /Adieresis /Aring /Eacute /ae /AE /ocircumflex /odieresis /ograve 
  129. /ucircumflex /ugrave /ydieresis /Odieresis /Udieresis /cent /sterling
  130. /yen /.notdef /florin /aacute /iacute /oacute /uacute /ntilde /Ntilde 
  131. /ordfeminine /ordmasculine /questiondown /.notdef /.notdef /.notdef
  132. /.notdef /exclamdown /guillemotleft /guillemotright
  133. ] putinterval
  134. SPCEncoding 20 [/paragraph /section] putinterval
  135. SPCEncoding 225 [/germandbls /dagger /daggerdbl 
  136.                  /quotedblleft /quotedblright] putinterval
  137.  
  138. SPCEncoding 249 [/bullet /periodcentered] putinterval  % print grid chars.
  139.  
  140. /MakeSPCFont            % make fonts with foreign chars in 'em
  141. {
  142.    FontDirectory 1 index known not FontDirectory 3 index known and
  143.    {
  144.       exch findfont dup length dict exch
  145.       {  1 index /FID eq
  146.          { pop pop }
  147.          { 1 index /Encoding eq { pop SPCEncoding } if
  148.            2 index 3 1 roll put
  149.          } ifelse
  150.       } forall
  151.       definefont pop
  152.    }
  153.    {pop pop} ifelse
  154. } bd
  155.  
  156. /cstr 100 string def
  157. /sstr (-SPC) def
  158.  
  159. /setSPCfonts
  160. {
  161.     fonts
  162.     {
  163.     dup cstr cvs sstr search
  164.     {exch pop exch pop cvn exch MakeSPCFont}
  165.     {pop pop} ifelse
  166.     } forall
  167. } bd
  168.  
  169.  
  170. /family 0 def                    % state variables
  171. /bold false def
  172. /underline false def
  173. /lineheight 11.75 def
  174. /fontsize 12 def
  175. /linedrawing false def
  176. /dirty false def
  177.  
  178.  
  179. /leftmargin 18 def                              % some useful numbers
  180. /line1 {11 72 mul lineheight sub 6 sub} bd
  181. /bottom 0 def
  182.  
  183.  
  184. /savestate            % be able to save and restore state
  185. {
  186.     family bold underline
  187.     lineheight fontsize linedrawing
  188.     manualfeedOK {statusdict begin manualfeed end} if
  189. } bd
  190.  
  191. /getstate            % restoring state, set orientation and font
  192. {
  193.     manualfeedOK {statusdict begin /manualfeed exch def end} if
  194.     /linedrawing exch def
  195.     /fontsize exch def
  196.     /lineheight exch def
  197.     /underline exch def
  198.     /bold exch def
  199.     /family exch def
  200.     leftmargin line1 moveto
  201.     setfontnstyle
  202. } bd
  203.  
  204. /fonts                          % all fonts accessible from Professional File
  205. [
  206. /Courier-SPC /Courier-Bold-SPC /Courier-Oblique-SPC /Courier-BoldOblique-SPC
  207. ] def
  208.  
  209. /fontlength fonts length def        % length of fonts array
  210.  
  211. /bounds                                 % bounds-checking algorithm
  212. {
  213.     3 index 3 index lt 4 index 3 index gt or
  214.     { {exch} if pop exch pop}
  215.     {pop pop pop} ifelse
  216. } bd
  217.  
  218. /init           % initialization - install fonts, start page 1
  219. {
  220.     /Linefont Linefont definefont pop
  221.     setSPCfonts startpage setfontnstyle
  222. } bd
  223.  
  224.  
  225. % the following routines are called from other routines
  226. % routines include start new page, eject page, set font and style
  227. % (style includes bold, italic, underline, super/subscript, line drawing),
  228. % draw an underline
  229.  
  230. /startpage {/s1 save def leftmargin line1 moveto} bd
  231.  
  232. /endpage {showpage s1 restore} bd
  233.  
  234. /setfontnstyle
  235. {
  236.     linedrawing
  237.     {/Linefont findfont [fontsize 0 0 lineheight 0 0] makefont setfont}
  238.     {
  239.         fonts family 4 mul bold {1 add} if
  240.     0 fontlength false bounds get
  241.     findfont fontsize scalefont
  242.         setfont
  243.     } ifelse
  244. } bd
  245.  
  246. /markdict 1 dict def markdict begin
  247. /cleartomarkdict
  248. { {currentdict end /cleartomarkdict known {exit} if} loop} bd
  249. end
  250.  
  251. /showunderline
  252. {
  253.     dup stringwidth pop exch show
  254.     gsave markdict begin mark exch
  255.     {
  256.     currentfont begin
  257.     FontMatrix
  258.     FontInfo begin
  259.     0 UnderlinePosition 2 index transform rmoveto
  260.     UnderlineThickness 0 3 -1 roll transform pop setlinewidth
  261.     end
  262.     end
  263.     neg 0 rlineto stroke
  264.     } stopped
  265.     pop cleartomarkdict cleartomark grestore
  266. } bd
  267.  
  268. /manualfeedOK
  269.  markdict begin mark
  270.  {
  271.     statusdict begin
  272.     currentdict /manualfeed known
  273.     {/manualfeed load type /booleantype eq} {false} ifelse
  274. } stopped cleartomarkdict {cleartomark false} {exch pop} ifelse
  275. def
  276.  
  277.  
  278. % these routines are called from the script
  279. % included are turning all enhancements on and off,
  280. % (enhancements are bold and underline)
  281. % changin font size, showing a string, going to a new line, ejecting a page
  282. /U {/underline true def} bd
  283. /u {/underline false def} bd
  284. /B {/bold true def setfontnstyle} bd
  285. /b {/bold false def setfontnstyle} bd
  286. /SZ {/fontsize exch def setfontnstyle} bd
  287.  
  288. /nl {
  289.         currentpoint lineheight sub exch pop   % new y on top of stack
  290.         dup bottom le                          % do a form feed if below bottom
  291.         {
  292.             ff
  293.             pop                                % get rid of dup y
  294.         }
  295.         {
  296.             leftmargin exch moveto
  297.         } ifelse
  298.     } bd
  299.  
  300. /done {  % need a form feed when the document is done and we are not at the
  301.          % first line of the page (i.e. didn't just do a form feed)
  302.           currentpoint round exch pop     % y on top of stack
  303.           line1 truncate ne               % do a form feed if not on line1
  304.           {
  305.               ff
  306.           } if
  307.       } bd
  308.  
  309. /ff {savestate endpage startpage getstate} bd
  310.  
  311. /s
  312. {
  313.     underline {showunderline} {show} ifelse
  314.     dirty not {/dirty true def} if
  315. } bd
  316.  
  317. end
  318.