% PostScript Prologue (initialization) for Manuscript
% Copyright (c) 1985,1986,1987,1988 Lotus Development Corporation
% There is no user servicable code in this file.

% set timeouts to infinite
statusdict begin
0 setjobtimeout
/manualfeedtimeout 3600 def
/waittimeout 0 def
end

% correct bug correction in rev 41.0
/idiv{div cvi}bind def

% define User Dictionary
/msdict 300 dict def msdict begin
/bd{bind def}bind def

% Define commonly used things
/delay{usertime 5000 add{dup usertime lt{pop exit}if}loop}bd
/mfeed{statusdict begin /manualfeed true def end}bd
/afeed{statusdict begin /manualfeed false def end}bd
/bfeed{ afeed statusdict begin /setpapertray where 
 {pop setpapertray}{pop} ifelse end}bd

/dpi{0.24 dup scale}bd

% These two are called for each page
/inpage false def
/begpage{save dpi /inpage true def}bd
/endpage{inpage {restore showpage}if }bd

% for possible banner
/fileinfo {pop pop pop}bd
/enddocument {end} bd

% these are also used by eqn & gmf
/ld{load def}bd
/x/exch ld
/cu{300 mul 72 div}bd
/m/moveto ld
/t/translate ld
/rm/rmoveto ld
/cp/currentpoint ld
/st/stroke ld
/ln/lineto ld
/rlt/rlineto ld
/slw/setlinewidth ld

/ff/findfont ld
/scf/scalefont ld
/sf/setfont ld
/fs{x /pt x def ff pt cu scf sf}bd

% linedraw
/li{4 2 roll setlinewidth 3 1 roll moveto 0.0 rlineto st}bd

% outline factor
/olwid 40.0 def
% stroke width for outline
/uoslw {pt cu x div slw}bd
% relative horizontal move
/xm{x currentpoint pop sub 0.0 rmoveto}bd

% The basic show
/s/show ld
% move horizontal and show
/ms{xm s}bd

% variations
% outline show - first printer attribute
/ppss{dup cp 3 -1 roll false charpath st
x 3 -1 roll stringwidth pop add x moveto}bd
/pss{olwid uoslw { ( ) dup 0 4 -1 roll put ppss}forall}bd
/ps{pss}bd
/mps{xm ps}bd

% graybox show - second printer attribute
/gb{cp 3 -1 roll pt cu dup 4 div neg 0 x rm dup 0 x rlt x 0 rlt 
neg 0 x rlt closepath currentgray .9 setgray fill setgray m}bd
/usi{dup stringwidth pop gb}bd
/us{usi s}bd
/xum{x cp pop sub dup gb 0 rmoveto}bd

% combinations of PD1 and PD2
/ups{usi pss}bd
/mups{xm ups}bd
/mus{xm us}bd

% define a new encoding vector (code page 850 based)
/PC 256 array def
StandardEncoding PC copy pop

/dotaccent/bullet
/quotesingle/quotedblleft/quotedblright/quotesinglbase
/quotedblbase/guilsinglleft/guilsinglright/.notdef
/ellipsis/perthousand/.notdef/.notdef/paragraph/section/dagger/daggerdbl
/OE/oe/fi/fl/endash/emdash/fraction/Ydieresis
PC 6 26 getinterval astore pop

/Ccedilla/udieresis/eacute/acircumflex/adieresis/agrave/aring/ccedilla
/ecircumflex/edieresis/egrave/idieresis/icircumflex/igrave/Adieresis/Aring
/Eacute/ae/AE/ocircumflex/odieresis/ograve/ucircumflex/ugrave
/ydieresis/Odieresis/Udieresis/oslash/sterling/Oslash/.notdef/florin
/aacute/iacute/oacute/uacute/ntilde/Ntilde/ordfeminine/ordmasculine
/questiondown/.notdef/.notdef/onehalf/onequarter/exclamdown/guillemotleft/guillemotright
/.notdef/.notdef/.notdef/.notdef/.notdef/Aacute/Acircumflex/Agrave
/.notdef/.notdef/.notdef/.notdef/.notdef/cent/yen/.notdef
/.notdef/grave/.notdef/circumflex/tilde/.notdef/atilde/Atilde
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/currency
/eth/Eth/Ecircumflex/Edieresis/Egrave/dotlessi/Iacute/Icircumflex
/Idieresis/.notdef/.notdef/.notdef/.notdef/brokenbar/Igrave/.notdef
/Oacute/germandbls/Ocircumflex/Ograve/otilde/Otilde/.notdef/thorn
/Thorn/Uacute/Ucircumflex/Ugrave/yacute/Yacute/.notdef/acute
/.notdef/.notdef/.notdef/threequarters/paragraph/section/.notdef/cedilla
/ring/dieresis/periodcentered/onesuperior/threesuperior/twosuperior/.notdef/.notdef

PC 128 128 getinterval astore pop

% duplicate fonts with a new encoding vector
/recd 5 dict def
/pcft
{recd begin
/ncs PC def /nfn x def
/bfn x def /bfd bfn findfont def
/nf bfd maxlength dict def
bfd{x dup dup /FID ne x /Encoding ne and
{x nf 3 1 roll put}{pop pop}ifelse
}forall
nf/FontName nfn put
nf/Encoding ncs put
nfn nf definefont pop
end}bd

/fs{x /pt x def ff pt cu scf sf}bd

% used by eqn
/Times-Roman/TR pcft /Times-Bold/TRB pcft
/Times-Italic/TRI pcft /Times-BoldItalic/TRBI pcft
/Helvetica/HV pcft /Helvetica-Bold/HVB pcft
/Helvetica-Oblique/HVO pcft /Helvetica-BoldOblique/HVBO pcft
/Courier/CR pcft /Courier-Bold/CRB pcft
/Sym{/Symbol fs}bd

% Bit map image data decompression code
/xx 0 def /yy 0 def
/xbytes 0 def
/lbuf 1200 string def /obuf 600 string def
/bval <FFFEFCF8F0E0C080000103070F1F3F7F> def
/blacks 96 string def /whites 96 string def
0 1 95 {whites x 255 put} for

/dispatch [
{
dup 47 le {32 sub 4 bitshift x pop 1}{
dup 63 le {x pop 48 sub bval x get 
3 copy put x 1 add x 0} {
dup 79 le {62 sub} {
80 sub { 3 copy put x 1 add x } repeat 0
}ifelse }ifelse }ifelse
}bind 
{
32 sub add
3 copy put
x 1 add x 0  
} bind
{
32 sub x pop add 255 0
}bind
{
32 sub x pop
3 copy getinterval
whites 0 3 index getinterval
x copy pop add 255 0
}bind
{
32 sub x pop
3 copy getinterval
blacks 0 3 index getinterval
x copy pop add 0 0
}bind
]def

% read a raster line and unpack
/readx{ 
obuf 0 255 0
currentfile lbuf readline pop
{x dispatch x get exec} forall
pop pop pop 0 xbytes getinterval}bd

/mspic{
/yy x def/xx x def
/xbytes xx 8 idiv def
xx yy 1 [xx 0 0 0 yy sub 0 yy]{readx}image}bd

