1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
% -*- PostScript -*-
% Base of a2ps' prologues
%
% $Id: a2ps.hdr,v 1.1.1.1.2.1 2007/12/29 01:58:26 mhatta Exp $
%
%
% This file is part of a2ps.
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 3, or (at your option)
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; see the file COPYING. If not, write to
% the Free Software Foundation, 59 Temple Place - Suite 330,
% Boston, MA 02111-1307, USA.
% Variables and Functions
%
% Variables from `outside'
% v: virtual page number in current page
% sx: number of chars in lines' prefix
% tab: tab size (in chars)
% Functions
% title: title
% footer: footer
% border: border around the body text
% Coordinates
% x, y: the virtual pages (arrays)
% x0, y0: the current line content (x0 does not include
% the line numbers)
% snx, sny: left footer
% dx, dy: the l-footer
% lx, ly: the r-header
% fnx, fny: the c-footer
% scx, scy: the sheet center
% Font sizes
% fnfs: center title
% bfs: body
% Fonts
% df: footer/header
% sf: symbol
% fnf: center title
% Widths and heigths
% cw: a Courier char
% pw, ph: page
% sw, sh: sheet
% th: v.p. title
% Margins
% hm: header
% ury: top
% urx: right
% llx: left
% -- code follows this line --
%%BeginResource: procset a2ps-a2ps-hdr 2.0 2
%%Copyright: (c) 1988, 89, 90, 91, 92, 93 Miguel Santana
%%Copyright: (c) 1995, 96, 97, 98 Akim Demaille, Miguel Santana
%%DocumentProcessColors: Black
% Function title: prints page header.
% <ct> <rt> <lt> are passed as argument
/title {
% 1. Draw the background
x v get y v get moveto
gsave
0 th 2 div neg rmoveto
th setlinewidth
0.95 setgray
pw 0 rlineto stroke
grestore
% 2. Border it
gsave
0.7 setlinewidth
pw 0 rlineto
0 th neg rlineto
pw neg 0 rlineto
closepath stroke
grestore
% stk: ct rt lt
x v get y v get th sub 1 add moveto
%Font: Helvetica fnfs 0.8 mul
% 3. The left title
gsave
dup stringwidth pop fnfs 0.8 mul add exch % leave space took on stack
fnfs 0.8 mul hm rmoveto
show % left title
grestore
exch
% stk: ct ltw rt
% 4. the right title
gsave
dup stringwidth pop fnfs 0.8 mul add exch % leave space took on stack
dup
pw exch stringwidth pop fnfs 0.8 mul add sub
hm
rmoveto
show % right title
grestore
% stk: ct ltw rtw
% 5. the center title
gsave
pw 3 1 roll
% stk: ct pw ltw rtw
3 copy
% Move to the center of the left room
sub add 2 div hm rmoveto
% What is the available space in here?
add sub fnfs 0.8 mul sub fnfs 0.8 mul sub
% stk: ct space_left
%Font: Helvetica-Bold fnfs
cfshow
grestore
} bind def
% Function border: prints virtual page border
/border { %def
gsave % print four sides
0 setgray
x v get y v get moveto
0.7 setlinewidth % of the square
pw 0 rlineto
0 ph neg rlineto
pw neg 0 rlineto
closepath stroke
grestore
} bind def
% Function water: prints a water mark in background
/water { %def
gsave
scx scy moveto rotate
%Font: Times-Bold 100
.97 setgray
dup stringwidth pop 2 div neg -50 rmoveto
show
grestore
} bind def
% Function rhead: prints the right header
/rhead { %def
lx ly moveto
%Font: Helvetica fnfs 0.8 mul
l-show
} bind def
% Function footer (cf rf lf -> -)
/footer {
%Font: Helvetica fnfs 0.8 mul
dx dy moveto
show
snx sny moveto
l-show
fnx fny moveto
c-show
} bind def
%%EndResource
|