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