lintian doesn't like orphan packages with uploaders...
[debian/amanda] / example / DLT-A4.ps
1 %!
2 %%BoundingBox: 0 0 595 842
3 %%Title: AMANDA ExaLabel
4 %%Pages: 1
5 %%EndComments
6
7 %%%%
8 %%%% This is a template file used by AMANDA to create PostScript tape
9 %%%% labels for each dump.  This file is set up for DAT 4mm tapes,
10 %%%% but you can edit it to work with anything.
11 %%%%
12 %%%% NOTE: this is quick-hack for DAT TAPES; it is simply a scaled 
13 %%%% version of the Exabyte version.
14 %%%%
15
16 %
17 % The label is made up of 6 parts:  statistics, tape name, date,
18 % header, filesystem list, and the logo.  Geometrically, the label 
19 % looks like this:
20 %
21 %   +------------------------+
22 %   |statistics              |   <- section 'A'
23 %   +----+-------------------+
24 %   |logo|     TAPE_NAME     |   <- section 'B'  (logo) <- section 'F'
25 %   |    | version      date |   <- section 'C'
26 %   +----+--+--------+-------+
27 %   | h   fs   l | h  fs   l |   <- section 'D'
28 %   +-------+--------+-------+
29 %   |            |           |   <- section 'E'
30 %   |            |           |
31 %   v            v           v
32 %
33 % Sections D and E, which hold the bulk of the information are 
34 % cut into columns.
35 %
36
37 % Quick-hack for DAT tapes
38 %
39
40 72 25.4 div dup scale              %% scale to millimeters
41
42 % section 'A' font, start position, and line separation
43 %
44 /StatFont               { /Courier findfont 4.5 scalefont setfont } def
45 /StatPos                { 30 255 } def
46 /StatSep                { 4 } def
47
48 % section 'B' font and position (text centered around this point)
49 %
50 /TitleFont              { /Helvetica-Bold findfont 10 scalefont setfont } def
51 /TitlePos               { 115 230 } def
52
53 % section 'C' font, position of the date (left justified) and the version
54 %
55 /DateFont               { /Palatino-Bold findfont 5 scalefont setfont } def
56 /DatePos                { 190 222 } def
57 /VersFont               { /Palatino-Bold findfont 5 scalefont setfont } def
58 /VersPos                { 43 222 } def
59
60 % section 'D' font, and field positions (x coord is relative to each column)
61 %
62
63 /HeadingFont            { /Palatino-Bold findfont 5 scalefont setfont } def
64 /HeadingHostPos         { 1 212 } def
65 /HeadingFsPos           { 17 212 } def
66 /HeadingLvlPos          { 57 212 } def
67
68 % section 'E' font, and line separation
69 %
70 /HostFont               { /Courier findfont 2.6 scalefont setfont } def
71 /HostSep                { 2.5 } def
72
73
74 % the following rectangles separate the regions
75 %
76 /StatBox                { 200 260 15 240 } def
77 /TitleBox               { 200 240 15 220 } def
78 /LogoBox                { 35 240 15 220 } def
79 /HeadingBox             { 200 220 15 210 } def
80 /HostBox                { 200 210 15 0 } def
81 % Punckmark marks center of page height to aid punching holes for ring binder
82 /PunchMark              { 13 130 15 130 } def
83
84 % number of columns for section 'E,' column width, position of first 
85 % entry in first column, y coordinate of top and bottom of dividing lines
86 %
87 /NumColumns             { 3 } def
88 /ColumnWidth            { 60 } def
89 /ColumnBasePos          { 16 200 } def
90 /TopColDivLine          { 201 } def
91 /BotColDivLine          { 2 } def
92
93 % 5
94
95 %%%%
96 %%%% END OF USER-CONFIGURABLE OPTIONS
97 %%%%
98 %%%% the rest of this file contains the internal functions that are used
99 %%%% by genlabel to draw the label
100 %%%%
101
102
103 %
104 % Initial Setup... draws everything that is the same for all labels
105 %
106
107 % function to draw a box
108 %
109 /box {
110         /ury exch def
111         /urx exch def
112         /lly exch def
113         /llx exch def
114
115         llx lly moveto
116         llx ury lineto
117         urx ury lineto
118         urx lly lineto
119         closepath
120 } def
121
122
123 % move the origin up a bit
124 %
125 0 19 translate
126
127 % draw all of the boxes
128 %
129 0 setgray 
130 .3 setlinewidth                                 % thick lines
131 StatBox box stroke
132 TitleBox box stroke
133 LogoBox box stroke
134 HeadingBox box stroke
135 HostBox box stroke
136 % and the PunchMark to aid puching ring binder holes
137 PunchMark box stroke
138
139 % draw the column dividers
140 %
141 0.2 setlinewidth                                % thin lines
142 /i 1 def
143 {
144         NumColumns i sub 0 le { exit } if       % no lines if this last col.
145         /xoff ColumnBasePos pop                 % get x base position
146            i ColumnWidth mul add def            % offset for this column
147         xoff TopColDivLine moveto 
148         xoff BotColDivLine lineto stroke        
149         /i i 1 add def
150 } loop
151
152
153 % draw the heading names
154 %
155 /i 0 def
156 HeadingFont
157 {
158         NumColumns i sub 0 le { exit } if
159         /xoff ColumnBasePos pop
160           i ColumnWidth mul add def
161         HeadingHostPos exch xoff add exch moveto
162           (Host) show
163         HeadingFsPos exch xoff add exch moveto
164           (Fs) show
165         HeadingLvlPos exch xoff add exch moveto
166           (*) show
167         /i i 1 add def
168 } loop
169
170
171 %
172 % the following functions draw strings for each kind of information
173 %
174
175 /CurrStatY StatPos exch pop def
176 ColumnBasePos /CurrColumnY exch def
177   /CurrColumnX exch def
178
179
180 % DrawStat draws the string on the top of the stack in the next position
181 % in section 'A'
182 %
183 /DrawStat {
184         StatFont
185         StatPos pop CurrStatY moveto
186         show
187         /CurrStatY CurrStatY StatSep sub def
188 } def
189
190
191 % DrawTitle draws the string on the top of the stack in section 'B'
192 %
193 /DrawTitle {
194         TitleFont
195         TitlePos moveto
196         dup stringwidth pop 2 div neg 0 rmoveto
197         show
198 } def
199
200
201 % DrawDate draws the string on the top of the stack in section 'C'
202 %
203 /DrawDate {
204         DateFont
205         DatePos moveto
206         dup stringwidth pop neg 0 rmoveto
207         show
208 } def
209
210
211 % DrawVers draws the string on the top of the stack in section 'C'
212 %
213 /DrawVers {
214         VersFont
215         VersPos moveto
216         show
217 } def
218
219
220 /StripDomain {
221
222 (.) search {
223   3 1 roll pop pop
224 } if
225
226 } def
227
228 /TrimFs {
229
230 dup length 25 gt {
231   dup (*                         ) dup 4 2 roll length 24 sub 24 getinterval 1 exch putinterval
232 } if
233
234 } def
235
236
237 % DrawHost expects five strings to be on the stack; right now it
238 % uses only the first three.  The strings are Host Name, Partition Name,
239 % Dump Level, Tape File Number, and Output Size.
240
241 /DrawHost {
242         HostFont
243         pop pop pop                     % discard sizes and fileno
244         CurrColumnX HeadingLvlPos pop add CurrColumnY moveto
245         show
246         CurrColumnX HeadingFsPos pop add CurrColumnY moveto
247         TrimFs
248         show
249         CurrColumnX HeadingHostPos pop add CurrColumnY moveto
250         StripDomain
251         show
252         /CurrColumnY CurrColumnY HostSep sub def
253         CurrColumnY BotColDivLine lt {
254                 /CurrColumnY ColumnBasePos exch pop def
255                 /CurrColumnX CurrColumnX ColumnWidth add def
256         } if
257 } def
258
259
260 %%%%
261 %%%% END OF TEMPLATE FILE
262 %%%% 
263