home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / WordProcessors / DAT-WW5C.DMS / in.adf / Archive / EpsInit.lha / eps_init.ps
Encoding:
Text File  |  1996-02-09  |  6.4 KB  |  220 lines

  1. %! Post V1.7 initialisation file
  2. % (C) Adrian Aylward 1989, 1991
  3. %
  4. %  Modified by Digita International for use with Wordworth
  5. %
  6. %  This file is used when interpreting imported EPS files
  7. %
  8.  
  9. % PostScript software version
  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. % Uncomment the next 3 lines if you have a PSFonts: assignment
  143. % dup FontDirectory exch known not             % Not in FontDirectory?
  144. % { dup (PSFonts:) () loadfont                 % Try to load from PSFonts:
  145. % } if
  146.  
  147. % Uncomment the next 3 lines if you have the Gold Disk CG fonts
  148. % dup FontDirectory exch known not             % Not in FontDirectory?
  149. % { dup (CGFonts:PS/) (.psfont) loadfont       % Try CGFonts:PS
  150. % } if
  151.  
  152. % Duplicate the following 3 lines if you want to search additional
  153. % directories for PostScript Type-1 fonts
  154. % dup FontDirectory exch known not             % Not in FontDirectory?
  155. % { dup (PSFonts:OtherFonts/) () loadfont      % Try PSFonts:OtherFonts
  156. % } if
  157.  
  158. % Substitute DefaultFont
  159.   dup FontDirectory exch known not             % Not in FontDirectory?
  160.   { dup userdict /DefaultFontName get ne       % Not the DefaultFont
  161.     { pop userdict /DefaultFontName get        % Substitue DefaultFont
  162.       dup systemdict /findfont get exec pop    % Recurse so it gets loaded
  163.     }
  164.     if
  165.   }
  166.   if
  167.   dup FontDirectory exch known not             % Not in FontDirectory?
  168.   { pop /DummyFont } if                        % Fall back on DummyFont
  169.   .findfont                                    % If errors, will fail now
  170. } bind put
  171.  
  172. % Select a font
  173.  
  174. systemdict
  175. /selectfont
  176. { exch findfont exch
  177.   dup type /arraytype eq
  178.   { makefont }
  179.   { scalefont }
  180.   ifelse
  181.   setfont
  182. } bind put
  183.  
  184. % Define a dummy font - prints out big dots ...
  185.  
  186. /DummyFont 10 dict dup begin
  187. /FontName /DummyFont def
  188. /FontMatrix [0.001 0 0 0.001 0 0] def
  189. /FontType 3 def
  190. /FontBBox [0 -300 500 700] def
  191. /Encoding StandardEncoding def
  192. /BuildChar
  193. { pop pop
  194.   500 0 50 0 450 400 setcachedevice
  195. % 250 200 200 0 360 arc fill
  196. } bind def
  197. /Painttype 0 def
  198. end definefont pop
  199.  
  200. % Establish the dummy font as the default, as some fonts need it to
  201. % define themselves.
  202.  
  203. /DefaultFontName /DummyFont def
  204.  
  205. % Uncomment the following line to use Courier as the default font
  206. %/DefaultFontName /Courier def
  207.  
  208. % Prevent showpage commands from clearing the image
  209. systemdict /showpage {} put
  210.  
  211. % The following line sets up the halftone dither pattern used for printing
  212. % EPS images. The first number specifies the density of this pattern in
  213. % lines per printed inch. You can vary this to suit your printer and the
  214. % density of the printout. Larger numbers give a finer resolution but fewer
  215. % shades whilst smaller numbers produce a grainier image but are able to
  216. % display a greater number of shades. Note that setting resolutions too
  217. % close to the actual printer DPI may give poor quality results.
  218.  
  219. 75 45 {180 mul cos exch 180 mul cos add 2 div} setscreen
  220.