home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / GV2-3.ZIP / POST.INI < prev    next >
Encoding:
Text File  |  1990-02-15  |  6.5 KB  |  196 lines

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