Utilities.ps
Doug Wyatt, June 1, 1987 3:12:33 pm PDT
/kdir { { pop = } forall } def
/dir { { exch =print (: ) print == } forall } def
/== load 0 get begin
/rmargin 72 def
/NL (\n) def
/tprint { print } def
/typeprint { dup type exec ( ) tprint } def
/cvsprint { =string cvs tprint } def
/arraytype { dup rcheck { dup xcheck { ({ ) tprint { typeprint } forall (}) tprint }{([ ) tprint { typeprint } forall (]) tprint } ifelse } { pop (-array-) tprint } ifelse } def
/packedarraytype { dup rcheck { dup xcheck { ({ ) tprint { typeprint } forall (}) tprint }{([ ) tprint { typeprint } forall (]) tprint } ifelse } { pop (-packedarray-) tprint } ifelse } def
/booleantype { cvsprint } def
/dicttype { pop (-dict-) tprint } def
/filetype { pop (-file-) tprint } def
/fonttype { pop (-font-) tprint } def
/integertype { cvsprint } def
/marktype { pop (-mark-) tprint } def
/nametype { dup xcheck not { (/) tprint } if cvsprint } def
/nulltype { pop (-null-) tprint } def
/operatortype { =string cvs tprint (^) tprint } def
/realtype { cvsprint } def
/savetype { pop (-save-) tprint } def
/stringtype { dup rcheck { (\() tprint tprint (\)) tprint } { pop (-string-) tprint } ifelse } def
end
/estackarray 100 array def
/pestack {
/estack estackarray execstack def
estack length 2 sub -1 19 { (! ) print estack exch get == } for
} def
/pnum { =print ( ) print } def
/pvec { exch pnum pnum } def
/pmove { pvec (moveto) = } def
/pline { pvec (lineto) = } def
/pcurve { 6 4 roll pvec 4 2 roll pvec pvec (curveto) = } def
/pclose { (closepath) = } def
/ppath {
/pmove load /pline load /pcurve load /pclose load pathforall
} def
/fshow {
dup findfont 9 scalefont setfont
0 11 moveto (This font is ) show =string cvs show (...) show
11 0 moveto (ABCDEFGHIJKLMNOPQRSTUVWXYZ) show (abcdefghijklmnopqrstuvwxyz) show
} def
/fshowall {
gsave
72 10 translate
FontDirectory { pop fshow 0 25 translate } forall
grestore
} def