home *** CD-ROM | disk | FTP | other *** search
/ Merciful 3 / Merciful_Release_3.bin / software / f / finalwriter / finalwriterv5.04ukver.lha / FinalWriter_B / FWFiles / init.ps < prev    next >
Text File  |  1996-05-01  |  6KB  |  210 lines

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