Release version 1.6.5.
[enscript.git] / lib / mp.hdr
1
2 % OPENWINDOWS' mp header
3 % Copyright (c) 1996 Markku Rossi.
4 % Author: Markku Rossi <mtr@iki.fi>
5 %
6
7 %
8 % This file is part of GNU Enscript.
9
10 % Enscript is free software: you can redistribute it and/or modify
11 % it under the terms of the GNU General Public License as published by
12 % the Free Software Foundation, either version 3 of the License, or
13 % (at your option) any later version.
14 %
15 % Enscript is distributed in the hope that it will be useful,
16 % but WITHOUT ANY WARRANTY; without even the implied warranty of
17 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 % GNU General Public License for more details.
19 %
20 % You should have received a copy of the GNU General Public License
21 % along with Enscript.  If not, see <http://www.gnu.org/licenses/>.
22 %
23
24 % -- code follows this line --
25 %Format: userstr        %n
26 %Format: datestr        %D{%d/%m/%y  %Hh%M}
27 %Format: pagestr        $%/$=
28
29 %HeaderHeight: 48
30 %FooterHeight: 48
31
32 % Fonts.
33 /Helvetica-BoldOblique /helvetica-encoded MF
34 /SmallFont /helvetica-encoded findfont 10 scalefont def
35 /BigFont /helvetica-encoded findfont 16 scalefont def
36
37 /RBox {         % x y w h r -> -
38   /r exch def
39   /h exch def
40   /w exch def
41   /y exch def
42   /x exch def
43   
44   x y r add moveto
45   x y h add x w add y h add r arcto 4 {pop} repeat
46   x w add y h add x w add y r arcto 4 {pop} repeat
47   x w add y x y r arcto 4 {pop} repeat
48   x y x y h add r arcto 4 {pop} repeat
49   closepath
50 } def
51
52 /radius 10 def
53
54 /do_header {    % print mp header
55   gsave
56     .5 setlinewidth
57
58     % footer
59     d_footer_x d_footer_y d_footer_w 40 radius RBox
60     gsave
61       .9 setgray fill
62     grestore
63     stroke
64  
65     BigFont setfont
66     ftail dup stringwidth pop d_footer_w exch sub 2 div 
67     d_footer_y 14 add moveto show
68
69     % header
70     d_header_x d_header_y 8 add d_header_w 65 sub 40 radius RBox
71     gsave
72       .9 setgray fill
73     grestore
74     stroke
75     SmallFont setfont
76
77     datestr dup stringwidth pop d_header_x d_header_w 75 sub add exch sub
78     d_header_y 22 add moveto show
79
80     d_header_x 10 add d_header_y 22 add moveto (printed by: ) show
81     BigFont setfont
82     userstr show
83
84     d_header_x d_header_w add 60 sub d_header_y 8 add 60 40 radius RBox
85     stroke
86
87     SmallFont setfont
88     (Page) dup stringwidth pop 60 exch sub 2 div 
89     d_header_x d_header_w add 60 sub add d_header_y 33 add moveto show
90
91     BigFont setfont
92     pagestr dup stringwidth pop 60 exch sub 2 div
93     d_header_x d_header_w add 60 sub add d_header_y 13 add moveto show
94
95   grestore
96 } def