home *** CD-ROM | disk | FTP | other *** search
- % $Header: slide.pro,v 0.0 88/06/22 05:22:44 on Rel $
- % General macros
- /curx { currentpoint pop } def
- /cury { currentpoint exch pop } def
- /min { 2 copy gt { exch } if pop } def
- /max { 2 copy lt { exch } if pop } def
-
- /vecop {
- % [ v1x v1y ] [ v2x v2y ] { op } vecop [ v1x v2x { op } v1y v2y { op } ]
- 3 1 roll aload pop
- 3 2 roll aload pop
- 3 2 roll
- 5 -1 roll dup 6 1 roll exec
- exch 4 2 roll exch exec
- exch
- [ 3 1 roll ]
- } def
-
- % Automatic stretching
- /pagedim { % - pagedim [ llx lly ] [ urx ury ]
- initclip clippath pathbbox
- [ 3 1 roll ]
- 3 1 roll
- [ 3 1 roll ]
- } def
-
- /ndim { % - ndim [ nx ny ]
- [ I setfont (n) stringwidth pop dy ]
- } def
-
- /stretch { % w h stretch -
- dup
- % How much can we magnify?
- pagedim { sub } vecop margin { sub } vecop % page space
- exch { div } vecop
- aload pop min exch
- % How much can we magnify on rotated page?
- [ pagedim { sub } vecop margin { sub } vecop aload pop exch ]
- exch { div } vecop
- aload pop min exch
-
- gsave
- 2 copy
- gt { % landscape
- pagedim exch pop
- margin [ 2 2 ] { div } vecop { add } vecop
- aload pop translate
- 90 rotate
- pop dup scale
- } { % portrait
- [ pagedim 0 get exch 1 get ]
- margin [ 2 -2 ] { div } vecop { add } vecop
- aload pop translate
- dup scale pop
- } ifelse
- /txfrm matrix currentmatrix def
- grestore
- } def
-
- % pps instructions
- /fname { % string fname -
- /filename exch def
- /pageno 0 def
- 1 f
- } def
-
- /fdate { /date exch def } def
- /funct { pop } def
-
- /t { % ntabs t -
- {
- curx 1 add
- tabwidth div ceiling
- tabwidth mul
- cury moveto
- } repeat
- } def
-
- /n { % nlines n -
- { 0 cury dy sub moveto } repeat
- } def
-
- /f { % npages f -
- {
- totalpage 0 gt {
- showpage
- } if
- /totalpage totalpage 1 add def
- /pageno pageno 1 add def
- } repeat
-
- txfrm setmatrix
- 0 0 moveto
- 1 n
- } def
-
- /s { % string font s -
- setfont
- show
- } def
-
- /ppsinit { % width ht ppsinit -
- fonts {
- findfont ppoints scalefont def
- } forall
- [ 3 1 roll ] ndim { mul } vecop stretch
- /tabwidth ndim 0 get tabstop mul def
- /totalpage 0 def
- } def
-
- /ppsdone { % - ppsdone -
- 1 f
- } def
-
- % Fonts -- should better be fixed pitch.
- /fonts 4 dict def
- fonts begin
- /C /NewCenturySchlbk-Roman def % Comments
- /K /Courier-Bold def % Keywords
- /S /Courier-Oblique def % Strings
- /I /Courier def % The rest
- end
-
- % Page parameters
- /margin [ 60 60 ] def % x, y margin in points
- /ppoints 10 def % pointsize -- do not change!
- /dy ppoints def % line spacing, >= ppoints
- /tabstop 8 def % ens per tabstop
- %%EndProlog
-