home *** CD-ROM | disk | FTP | other *** search
/ The AGA Experience 2 / agavol2.iso / l / init.ps < prev    next >
Text File  |  1993-01-26  |  6KB  |  209 lines

  1. %! Post V1.7 initialisation file
  2. % (C) Adrian Aylward 1989, 1991
  3. %
  4. % You may freely copy, use, and modify this file
  5. %
  6. % This file should be run before most programs
  7.  
  8. % Version string, real number for programs that check it
  9.  
  10. /version (48.0) def
  11.  
  12. % Ignore CTRL/D
  13.  
  14. <04> cvn {} def
  15.  
  16. % A dummy status dictionary
  17.  
  18. /statusdict 10 dict dup begin
  19. /waittimeout 0 def
  20. /checkpassword { 0 eq } bind def
  21. /product (Post V1.7) def
  22. end def
  23.  
  24. % A dummy server dictionary
  25.  
  26. /serverdict 5 dict dup begin
  27. /exitserver { pop } bind def
  28. end def
  29.  
  30. % The internal dictionary
  31.  
  32. %/internaldict { pop null } dup 1 5 dict put def
  33. %1183615869 internaldict begin
  34. %/StemSnapLength 12 def
  35. %end
  36.  
  37. % A scratch string
  38.  
  39. /=string 256 string def
  40.  
  41. % ISO Latin 1 encoding vector (omitting accents 90 - 9f)
  42.  
  43. systemdict
  44. /ISOLatin1Encoding [
  45. StandardEncoding 0 160 getinterval
  46. /space/exclamdown/cent/sterling
  47. /currency/yen/brokenbar/section
  48. /dieresis/copyright/ordfeminine/guillemotleft
  49. /logicalnot/hyphen/registered/macron
  50. /degree/plusminus/twosuperior/threesuperior
  51. /acute/mu/paragraph/periodcentered
  52. /cedilla/onesuperior/ordmasculine/guillemotright
  53. /onequarter/onehalf/threequarters/questiondown
  54. /Agrave/Aacute/Acircumflex/Atilde
  55. /Adieresis/Aring/AE/Ccedilla
  56. /Egrave/Eacute/Ecircumflex/Edieresis
  57. /Igrave/Iacute/Icircumflex/Idieresis
  58. /Eth/Ntilde/Ograve/Oacute
  59. /Ocircumflex/Otilde/Odieresis/multiply
  60. /Oslash/Ugrave/Uacute/Ucircumflex
  61. /Udieresis/Yacute/Thorn/germandbls
  62. /agrave/aacute/acircumflex/atilde
  63. /adieresis/aring/ae/ccedilla
  64. /egrave/eacute/ecircumflex/edieresis
  65. /igrave/iacute/icircumflex/idieresis
  66. /eth/ntilde/ograve/oacute
  67. /ocircumflex/otilde/odieresis/divide
  68. /oslash/ugrave/uacute/ucircumflex
  69. /udieresis/yacute/thorn/ydieresis
  70. ] put
  71.  
  72. % Run a program with save and restore
  73.  
  74. /runsave
  75. { /saveobject save def
  76.   run
  77.   saveobject restore
  78. } bind def
  79.  
  80. % Run a program displaying its name
  81.  
  82. /runprog
  83. { dup print (\n) print
  84.   runsave
  85. } bind def
  86.  
  87. % New cache parameters ops
  88.  
  89. systemdict
  90. /setcacheparams
  91. { counttomark 1 ge { dup setcachelimit } if
  92.   cleartomark
  93. } bind put
  94.  
  95. systemdict
  96. /currentcacheparams
  97. { mark cachestatus 6 { exch pop} repeat dup
  98. } bind put
  99.  
  100. % Load a font file.  Build the file name string from the font name, prefix
  101. % and suffix strings.  We pop the dictionary stack first, so that the
  102. % contents of any additional entries on it can't interfere with the font
  103. % definition - e.g. if it uses the bind operator.  Then we try to open the
  104. % file.  If it opens OK we execute it; if the open fails we return without
  105. % error: presumabaly we don't have the font.  Before returning we restore the
  106. % dictionary stack.
  107.  
  108. systemdict
  109. /loadfont
  110. { 1 index =string copy                         % Prefix:
  111.   length                                       % length
  112.   3 index =string 2 index 100 getinterval cvs  % Prefix:name
  113.   length add                                   % length
  114.   1 index =string 2 index 100 getinterval copy % Prefix:name.suffix
  115.   length add                                   % length
  116.   =string exch 0 exch getinterval              % Truncate to length
  117.   mark countdictstack 2 sub
  118.       { currentdict end } repeat               % Pop dict stack
  119.   counttomark 1 add index                      % Get the file name
  120.   { fontfile } stopped                         % Try to open the file
  121.   { pop }                                      % Can't open it, ignore
  122.   { cvx exec }                                 % Opened OK, execute it
  123.   ifelse
  124.   counttomark { begin } repeat pop             % Restore dictionary stack
  125.   pop pop pop pop                              % Pop file name and arguments
  126. } bind put
  127.  
  128. % Find a font.  If it is not there we try in order:
  129. %
  130. %    Load       PSFonts:name
  131. %    Load       CGFonts:PS/name.psfont
  132. %    Load       PSFonts:OtherFonts/name
  133. %    Substitute DefaultFont
  134. %
  135. % If none of these succeeds, the result will an invalidfont error.
  136.  
  137. systemdict /.findfont systemdict /findfont get put
  138.  
  139. systemdict
  140. /findfont
  141. {
  142. % Comment out the next 3 lines if you don't have a PSFonts: directory
  143.   dup FontDirectory exch known not             % Not in FontDirectory?
  144.   { dup (PSFonts:) () loadfont                 % Try to load from PSFonts:
  145.   } if
  146. % Comment out the next 3 lines if you don't have the Gold Disk CG fonts
  147. % dup FontDirectory exch known not             % Not in FontDirectory?
  148. % { dup (CGFonts:PS/) (.psfont) loadfont       % Try CGFonts:PS
  149. % } if
  150. % Comment out the next 3 lines if you don't have a PSFonts:OtherFonts
  151.   dup FontDirectory exch known not             % Not in FontDirectory?
  152.   { dup (PSFonts:OtherFonts/) () loadfont      % Try PSFonts:OtherFonts
  153.   } if
  154. % Substitute DefaultFont
  155.   dup FontDirectory exch known not             % Not in FontDirectory?
  156.   { dup userdict /DefaultFontName get ne       % Not the DefaultFont
  157.     { pop userdict /DefaultFontName get        % Substitue DefaultFont
  158.       dup systemdict /findfont get exec pop    % Recurse so it gets loaded
  159.     }
  160.     if
  161.   }
  162.   if
  163.   dup FontDirectory exch known not             % Not in FontDirectory?
  164.   { pop /DummyFont } if                        % Fall back on DummyFont
  165.   .findfont                                    % If errors, will fail now
  166. } bind put
  167.  
  168. % Select a font
  169.  
  170. systemdict
  171. /selectfont
  172. { exch findfont exch
  173.   dup type /arraytype eq
  174.   { makefont }
  175.   { scalefont }
  176.   ifelse
  177.   setfont
  178. } bind put
  179.  
  180. % Define a dummy font - prints out big dots ...
  181.  
  182. /DummyFont 10 dict dup begin
  183. /FontName /DummyFont def
  184. /FontMatrix [0.001 0 0 0.001 0 0] def
  185. /FontType 3 def
  186. /FontBBox [0 -300 500 700] def
  187. /Encoding StandardEncoding def
  188. /BuildChar
  189. { pop pop
  190.   500 0 50 0 450 400 setcachedevice
  191.   250 200 200 0 360 arc fill
  192. } bind def
  193. /Painttype 0 def
  194. end definefont pop
  195.  
  196. % Establish the dummy font as the default, as some fonts need it to
  197. % define themselves.
  198.  
  199. /DefaultFontName /DummyFont def
  200.  
  201. % Uncomment the following line to use FunkyFont as the default font
  202.  
  203. /DefaultFontName /FunkyFont def
  204.  
  205. % Uncomment the following line to use Courier as the default font
  206.  
  207. %/DefaultFontName /Courier def
  208.  
  209.