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 % 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)
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.
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, 51 Franklin Street, Fifth Floor,
23 % Boston, MA 02110-1301, USA.
26 % -- code follows this line --
27 %%DocumentNeededResources: font Times-Bold Times-Roman
28 %Format: moddatestr $W
29 %Format: modtimestr $C
30 %Format: pagenumstr $%
33 /Times-Bold /HeaderFont-Bold MF
34 /HeaderDateF /HeaderFont-Bold findfont 12 scalefont def
36 /Times-Roman /HeaderFont-Times MF
37 /HeaderHDRF /HeaderFont-Times findfont 14 scalefont def
39 /HeaderPageNumF /Helvetica-Bold findfont 28.8 scalefont def
41 /do_header { % print enscript header
43 d_header_x d_header_y translate
46 0 0 d_header_w d_header_h 2 div Box
50 /dbw d_header_h 2 mul def % dark box width
51 /dbc .7 def % dark box color
54 0 0 dbw d_header_h Box
59 moddatestr dup stringwidth pop dbw exch sub 2 div
60 d_header_h 2 div 2 add moveto show
61 modtimestr dup stringwidth pop dbw exch sub 2 div
62 d_header_h 5 div moveto show
65 d_header_w dbw sub 0 dbw d_header_h Box
68 HeaderPageNumF setfont
71 stringwidth pop dbw exch sub 2 div d_header_w dbw sub add
72 d_header_h .2 mul moveto show
77 d_header_w fname stringwidth pop sub 2 div d_header_h 8 div moveto
80 % user supplied header string.
82 /h d_header_h 8 div 5 mul def
84 % Implement strict enscript compatibility.
85 user_header_center_str () eq user_header_right_str () eq and {
86 d_header_w user_header_left_str stringwidth pop sub 2 div
87 h moveto user_header_left_str show
89 dbw 5 add h moveto user_header_left_str show
91 d_header_w user_header_center_str stringwidth pop sub 2 div
92 h moveto user_header_center_str show
94 d_header_w dbw sub 5 sub user_header_right_str stringwidth pop
95 sub h moveto user_header_right_str show