home *** CD-ROM | disk | FTP | other *** search
- %! Post V0.2 initialisation file
- % This file should be run before most programs
-
- % Ignore CTRL/D
-
- <04> cvn {} def
-
- % A dummy status dictionary
-
- /statusdict 10 dict dup begin
- /waittimeout 0 def
- end def
-
- % A scratch string
-
- /=string 256 string def
-
- % The standard input and output files
-
- /standardinput (%stdin) (r) file def
- /standardoutput (%stdout) (w) file def
-
- % Replace showpage for screen viewing
-
- /showon % standard showpage
- { userdict /showpage { systemdict /showpage get exec } put
- } bind def
-
- /showoff % just reinitialise the graphics
- { userdict /showpage { initgraphics } put
- } bind def
-
- /showwait % wait, then showpage
- { userdict /showpage { wait systemdict /showpage get exec } put
- } bind def
-
- % Wait for the user to view the screen
-
- /wait
- { standardoutput (Hit Return to continue:) writestring
- standardinput =string readline pop pop
- } bind def
-
- % Run a program with save and restore
-
- /runsave
- { /saveobject save def
- run
- saveobject restore
- } bind def
-
- % Run a program displaying its name
-
- /runprog
- { dup print (\n) print
- runsave
- } bind def
-
- % Find a font. If it is not there we attempt to download it from the
- % "PSFonts:" directory; if that fails we substitute DefaultFont if it has
- % been defined
-
- /findfont
- { dup FontDirectory exch known not % Not in FontDirectory?
- { mark countdictstack 2 sub
- { currentdict end } repeat % Pop dict stack
- counttomark 1 add index % Get the font name
- { (PSFonts:) =string copy pop % PSFonts:
- =string 8 248 getinterval cvs length 8 add % PSFonts:name
- =string exch 0 exch getinterval % Truncate to length
- run % Load the font
- } stopped { pop } if % Ignore errors for now
- counttomark { begin } repeat pop % Restore dictionary stack
- } if
- dup FontDirectory exch known not % Still not there?
- { FontDirectory /DefaultFont known % DefaultFont defined?
- { pop /DefaultFont } if % Substitute DefaultFont
- } if
- systemdict /findfont get exec % If errors, will fail
- } bind def
-
- % Define a dummy font
-
- /DummyFont 10 dict dup begin
- /FontName /DummyFont def
- /FontMatrix [0.001 0 0 0.0001 0 0] def
- /FontType 3 def
- /FontBBox [0 0 0 0] def
- /Encoding StandardEncoding def
- /BuildChar { pop pop 0 0 0 0 0 0 setcachedevice } def
- /Painttype 0 def
- end definefont pop
-
-
- % Define a default font
-
- FontDirectory /DefaultFont /DummyFont findfont put
- %FontDirectory /DefaultFont /Courier findfont put
- %FontDirectory /DefaultFont /Times-Roman findfont put
-
-