Import GNU Enscript version 1.6.4
[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 % This program 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 2, or (at your option)
13 % any later version.
14 %
15 % This program 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 this program; see the file COPYING.  If not, write to
22 % the Free Software Foundation, 59 Temple Place - Suite 330,
23 % Boston, MA 02111-1307, USA.
24 %
25
26 % -- code follows this line --
27 %Format: userstr        %n
28 %Format: datestr        %D{%d/%m/%y  %Hh%M}
29 %Format: pagestr        $%/$=
30
31 %HeaderHeight: 48
32 %FooterHeight: 48
33
34 % Fonts.
35 /Helvetica-BoldOblique /helvetica-encoded MF
36 /SmallFont /helvetica-encoded findfont 10 scalefont def
37 /BigFont /helvetica-encoded findfont 16 scalefont def
38
39 /RBox {         % x y w h r -> -
40   /r exch def
41   /h exch def
42   /w exch def
43   /y exch def
44   /x exch def
45   
46   x y r add moveto
47   x y h add x w add y h add r arcto 4 {pop} repeat
48   x w add y h add x w add y r arcto 4 {pop} repeat
49   x w add y x y r arcto 4 {pop} repeat
50   x y x y h add r arcto 4 {pop} repeat
51   closepath
52 } def
53
54 /radius 10 def
55
56 /do_header {    % print mp header
57   gsave
58     .5 setlinewidth
59
60     % footer
61     d_footer_x d_footer_y d_footer_w 40 radius RBox
62     gsave
63       .9 setgray fill
64     grestore
65     stroke
66  
67     BigFont setfont
68     ftail dup stringwidth pop d_footer_w exch sub 2 div 
69     d_footer_y 14 add moveto show
70
71     % header
72     d_header_x d_header_y 8 add d_header_w 65 sub 40 radius RBox
73     gsave
74       .9 setgray fill
75     grestore
76     stroke
77     SmallFont setfont
78
79     datestr dup stringwidth pop d_header_x d_header_w 75 sub add exch sub
80     d_header_y 22 add moveto show
81
82     d_header_x 10 add d_header_y 22 add moveto (printed by: ) show
83     BigFont setfont
84     userstr show
85
86     d_header_x d_header_w add 60 sub d_header_y 8 add 60 40 radius RBox
87     stroke
88
89     SmallFont setfont
90     (Page) dup stringwidth pop 60 exch sub 2 div 
91     d_header_x d_header_w add 60 sub add d_header_y 33 add moveto show
92
93     BigFont setfont
94     pagestr dup stringwidth pop 60 exch sub 2 div
95     d_header_x d_header_w add 60 sub add d_header_y 13 add moveto show
96
97   grestore
98 } def