2 % Enscript styled header.
3 % Copyright (c) 1995 Markku Rossi.
4 % Author: Markku Rossi <mtr@iki.fi>
8 % This file is part of GNU Enscript.
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.
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.
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/>.
24 % -- code follows this line --
25 %%DocumentNeededResources: font Times-Bold Times-Roman
26 %Format: moddatestr $W
27 %Format: modtimestr $C
28 %Format: pagenumstr $%
31 /Times-Bold /HeaderFont-Bold MF
32 /HeaderDateF /HeaderFont-Bold findfont 12 scalefont def
34 /Times-Roman /HeaderFont-Times MF
35 /HeaderHDRF /HeaderFont-Times findfont 14 scalefont def
37 /HeaderPageNumF /Helvetica-Bold findfont 28.8 scalefont def
39 /do_header { % print enscript header
41 d_header_x d_header_y translate
44 0 0 d_header_w d_header_h 2 div Box
48 /dbw d_header_h 2 mul def % dark box width
49 /dbc .7 def % dark box color
52 0 0 dbw d_header_h Box
57 moddatestr dup stringwidth pop dbw exch sub 2 div
58 d_header_h 2 div 2 add moveto show
59 modtimestr dup stringwidth pop dbw exch sub 2 div
60 d_header_h 5 div moveto show
63 d_header_w dbw sub 0 dbw d_header_h Box
66 HeaderPageNumF setfont
69 stringwidth pop dbw exch sub 2 div d_header_w dbw sub add
70 d_header_h .2 mul moveto show
75 d_header_w fname stringwidth pop sub 2 div d_header_h 8 div moveto
78 % user supplied header string.
80 /h d_header_h 8 div 5 mul def
82 % Implement strict enscript compatibility.
83 user_header_center_str () eq user_header_right_str () eq and {
84 d_header_w user_header_left_str stringwidth pop sub 2 div
85 h moveto user_header_left_str show
87 dbw 5 add h moveto user_header_left_str show
89 d_header_w user_header_center_str stringwidth pop sub 2 div
90 h moveto user_header_center_str show
92 d_header_w dbw sub 5 sub user_header_right_str stringwidth pop
93 sub h moveto user_header_right_str show