home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GV20D-5.ZIP / PDV / POST.INI < prev    next >
Encoding:
Text File  |  1990-11-18  |  6.5 KB  |  197 lines

  1. %!PS-Adobe-1.0
  2. % Postscript Initialization Prologue
  3. % Copyright SoftWorks Development, 1990
  4. % All Rights Reserved
  5. % Version 1.00
  6.  
  7. /GVstate save def        % save original state
  8. /GVdict 75 dict def        % create dictionary with a name
  9. GVdict begin            % push it on the stack, make it current
  10.  
  11. % Constants
  12. /linespace 12 def
  13. /leftmargin 0 def
  14. /supoffset {fontsize .3 mul} def
  15. /suboffset {fontsize .3 mul neg} def
  16. /underlinewidth {fontsize 24 div} def
  17. /underlinepos {underlinewidth 2 mul} def
  18. /toppage 792 def
  19.  
  20. % Shortcuts
  21. /bd {bind def} bind def
  22.  
  23. % Do foreign language encoding
  24. /MyEncoding StandardEncoding 256 array copy def    % init MyEncoding
  25. MyEncoding 127 [/.notdef /Ccedilla /udieresis /eacute /acircumflex /adieresis 
  26. /agrave /aring /ccedilla /ecircumflex /edieresis /egrave /idieresis 
  27. /icircumflex /igrave /Adieresis /Aring /Eacute /ae /AE /ocircumflex 
  28. /odieresis /ograve /ucircumflex /ugrave /ydieresis /Odieresis /Udieresis 
  29. /cent /sterling /yen /.notdef /florin /aacute /iacute /oacute /uacute 
  30. /ntilde /Ntilde /ordfeminine /ordmasculine /questiondown /.notdef 
  31. /.notdef /.notdef /.notdef /exclamdown /guillemotleft /guillemotright
  32. % 176
  33. /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
  34. % 186
  35. /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
  36. % 196
  37. /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
  38. % 206
  39. /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
  40. % 216
  41. /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
  42. % 224
  43. /a /germandbls /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
  44. /.notdef /.notdef /.notdef /.notdef /.notdef 
  45. % 237
  46. /oslash /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 
  47. /.notdef /.notdef /.notdef 
  48. % 248
  49. /ring /periodcentered /periodcentered /.notdef /.notdef /.notdef
  50. % 254
  51. /bullet /.notdef
  52. ] putinterval
  53. MyEncoding 20 [ /paragraph /section ] putinterval
  54.  
  55. /MakeForeignFont    % P:/newfontname /oldfontname, R:nothing
  56.   {
  57.   % ** first find out if it's known **
  58.   FontDirectory        % get a directory: /newname, /oldfontname, directorydict
  59.   1 index        % make copy of /oldfontname: /newname, /oldfontname, dict, /oldfontname
  60.   known            % is /oldfontname present: /newname, /oldfontname, boolean
  61.   FontDirectory        % another directory:/newname, /oldfontname, boolean, directorydict
  62.   3 index        % make copy of /newfontname: /newname, /oldfontname, boolean, directorydict, /newfontname
  63.   known    not        % is /newfontname already present: /newname, /oldfontname, boolean, boolean
  64.   and            % /newfontname, /oldfontname, boolean
  65.   {mf} {pop pop} ifelse
  66.   } bd
  67.  
  68. /mf
  69.   {
  70.   findfont         % get the old dict: /newname, olddict
  71.   dup length        % get it's length: /newname, olddict length
  72.   dict            % make a blank dict: /newname, olddict newdict
  73.   exch            % swap them: /newname, newdict, olddict
  74.   {cycledict} forall      % cycle thru olddict: /newname, newdict
  75.   definefont pop
  76.   } bd
  77.  
  78. /cycledict
  79.   {
  80.     1 index /FID eq {pop pop} {checkencoding} ifelse
  81.   } bd
  82.  
  83. /checkencoding
  84.   {
  85.   1 index /Encoding eq {pop MyEncoding} if    % if /Encoding, swap to MyEncoding
  86.   2 index 3 1 roll put                % 
  87.   } bd
  88.  
  89. % Do the foreign encoding now
  90. /InitForeign        % P:nothing, R:nothing
  91.   {
  92.   /Courier-SW /Courier MakeForeignFont
  93.   /Courier-Bold-SW /Courier-Bold MakeForeignFont
  94.   /Courier-Oblique-SW /Courier-Oblique MakeForeignFont
  95.   /Courier-BoldOblique-SW /Courier-BoldOblique MakeForeignFont
  96.   /Times-Roman-SW /Times-Roman MakeForeignFont
  97.   /Times-Bold-SW /Times-Bold MakeForeignFont
  98.   /Times-Italic-SW /Times-Italic MakeForeignFont
  99.   /Times-BoldItalic-SW /Times-BoldItalic MakeForeignFont
  100.   /Helvetica-SW /Helvetica MakeForeignFont
  101.   /Helvetica-Bold-SW /Helvetica-Bold MakeForeignFont
  102.   /Helvetica-Oblique-SW /Helvetica-Oblique MakeForeignFont
  103.   /Helvetica-BoldOblique-SW /Helvetica-BoldOblique MakeForeignFont
  104.   } bd
  105.  
  106. % State Variables
  107. /boldface false def
  108. /underline false def
  109. /subscript false def
  110. /superscript false def
  111. /italics false def
  112. /fontsize 12 def
  113.  
  114. % Procedures
  115. /cpx {currentfont /FontMatrix get 0 get 1000 mul} def    % get x scaling for current font
  116. /cpy {currentfont /FontMatrix get 3 get 1000 mul} def    % get x scaling for current font
  117. /supon {/superscript true def} def
  118. /supoff {/superscript false def} def
  119. /subon {/subscript true def} def
  120. /suboff {/subscript false def} def
  121. /boldon {/boldface true def} def
  122. /boldoff {/boldface false def} def
  123. /undon {/underline true def} def
  124. /undoff {/underline false def} def
  125. /italon {/italics true def} def
  126. /italoff {/italics false def} def
  127. /currenty {currentpoint exch pop} def
  128. /currentx {currentpoint pop} def
  129. /nl {leftmargin currenty linespace sub moveto} def
  130. /nl2 {leftmargin currenty linespace 2 div sub moveto} def
  131. /np {save showpage restore newpath 0 toppage moveto} def
  132. /m             % P:720ths of an inch, R:nothing
  133.   {
  134.   10.0 div                 % convert to 72ths of an inch
  135.   underline {dup showunderline} if    % underline spaces too
  136.   0 rmoveto                % move
  137.   } def
  138. /nf            % P:fontname, size on stack, R:nothing
  139.   {
  140.   exch            % get fontname to bottom
  141.   findfont        % find this font
  142.   exch            % get size to bottom
  143.   scalefont
  144.   setfont
  145.   } def
  146. /initpath {currentpoint newpath moveto} def
  147. /init {InitForeign /Courier-SW 12 nf newpath} def
  148. /underlinestring    % P:string on stack, R:string still on stack
  149.   {
  150.   dup stringwidth pop showunderline
  151.   } def
  152. /showunderline         % P:length on stack, R:nothing, currentpoint unchanged
  153.   {
  154.   currentpoint        % original x,y
  155.   3 -1 roll        % push x,y up, bring length to bottom
  156.   0 underlinepos neg rmoveto  % move to underline position
  157.   initpath        % clear path for stroke
  158.   0 rlineto        % draw the line
  159.   underlinewidth setlinewidth    % set width of underline
  160.   stroke        % paint the underline
  161.   moveto        % restore currentpoint
  162.   } def
  163. /boldstring        % P:string on stack, R:string on stack
  164.   {
  165.   dup
  166.   gsave
  167.   cpx .05 mul 0 rmoveto 
  168.   show
  169.   grestore  
  170.   } def
  171. /setitalics        % P:string on stack, R:string on stack
  172.   {
  173.   gsave
  174.   currentfont[1 0 .3 1 0 0] makefont setfont
  175.   } def
  176. /clearitalics
  177.   {
  178.   currentpoint
  179.   grestore
  180.   moveto
  181.   } def
  182. %/s {show} def
  183. /s
  184.   {
  185.   currenty exch            % put currenty above string on the stack
  186.   underline {underlinestring} if
  187.   superscript {0 supoffset rmoveto} if
  188.   subscript {0 suboffset rmoveto} if
  189.   italics {setitalics} if
  190.   boldface {boldstring} if
  191.   show
  192.   italics {clearitalics} if
  193.   currentx exch moveto            % put currentx on stack, swap x,y, moveto original position
  194.   } def
  195.  
  196. init 
  197.