2 %%BoundingBox: 0 0 612 792
5 %%DocumentData: Clean7Bit
6 %%DocumentSuppliedResources: procset testprint/1.1
7 %%DocumentNeededResources: font Helvetica Helvetica-Bold Times-Roman
8 %%Creator: Michael Sweet, Easy Software Products
9 %%CreationDate: May 11, 1999
13 %%BeginResource procset testprint 1.1 0
15 % PostScript test page for the Common UNIX Printing System ("CUPS").
17 % Copyright 1993-2005 by Easy Software Products
19 % These coded instructions, statements, and computer programs are the
20 % property of Easy Software Products and are protected by Federal
21 % copyright law. Distribution and use rights are outlined in the file
22 % "LICENSE.txt" which should have been included with this file. If this
23 % file is missing or damaged please contact Easy Software Products
26 % Attn: CUPS Licensing Information
27 % Easy Software Products
28 % 44141 Airport View Drive, Suite 204
29 % Hollywood, Maryland 20636 USA
31 % Voice: (301) 373-9600
32 % EMail: cups-info@cups.org
33 % WWW: http://www.cups.org
35 /OCTANT { % Draw a color wheel OCTANT...
36 % (name) radius r g b OCTANT -
37 % Loop through 100 shades...
40 3 index 1 eq % R == 1?
41 3 index 1 eq % G == 1?
42 3 index 1 eq % B == 1?
44 0 index 4 index mul % R * val
45 1 index 4 index mul % G * val
46 2 index 4 index mul % B * val
48 0 index 4 index mul % R * val
49 1 index neg 1 add add % + (1 - val)
50 1 index 4 index mul % G * val
51 2 index neg 1 add add % + (1 - val)
52 2 index 4 index mul % B * val
53 3 index neg 1 add add % + (1 - val)
58 dup 5 index mul dup 0 % x1, y1
60 0.707106781 mul dup lineto % x2, y2
62 0.010101 add 4 index mul dup % x3
63 0.707106781 mul dup lineto % x3, y3
69 % Draw a line around the polygons...
74 0.707106781 mul dup lineto
79 0 exch dup -9 div exch % text offset = 0, -radius/9
80 dup 0.923879532 mul % x = radius * cos(22.5)
81 exch 0.382683432 mul % y = radius * cos(22.5)
82 moveto % position label
84 22.5 rotate % rotate label
85 rmoveto % offset label
89 /CENTER { % Draw centered text
91 dup stringwidth pop % Get the width of the string
92 0.5 mul neg 0 rmoveto % Shift left 1/2 of the distance
93 show % Show the string
95 /RIGHT { % Draw right-justified text
97 dup stringwidth pop % Get the width of the string
98 neg 0 rmoveto % Shift left the entire distance
99 show % Show the string
101 /NUMBER { % Draw a number
103 1 index 1 eq { % power == 1?
104 round cvi exch pop % Convert "n" to integer
106 1 index mul round exch div % Truncate extra decimal places
108 100 string cvs show % Convert to a string and show it...
110 /CUPSLOGO { % Draw the CUPS logo
112 % Start with a big C...
113 /Helvetica findfont 1 index scalefont setfont
118 % Then "UNIX Printing System" much smaller...
119 /Helvetica-Bold findfont 1 index 9 div scalefont setfont
121 dup dup 2.0 mul moveto
123 dup dup 1.6 mul moveto
128 /ESPLOGO { % Draw the ESP logo
130 % Compute the size of the logo...
132 2 index 1.5 mul 3 index
134 % Do the "metallic" fill from 10% black to 40% black...
137 -0.15 mul % loopval * -0.15
138 0.9 add % 0.9 - loopval * 0.15
139 setgray % set gray shade
142 1 index neg % loopval
145 mul % height * (1 - loopval)
146 moveto % starting point
150 mul % loopval * width
162 0.15 mul % loopval * 0.15
163 0.6 add % 0.6 + loopval * 0.15
167 neg 1 add % 1 - loopval
169 mul % (1 - loopval) * width
171 moveto % Starting point
176 mul % loopval * height
189 /Helvetica-BoldOblique findfont 1 index 3 div scalefont setfont
192 dup 4 mul 1 index 25 mul moveto (E) show
193 dup 10 mul 1 index 15 mul moveto (S) show
194 dup 16 mul 1 index 5 mul moveto (P) show
196 /Helvetica-BoldOblique findfont 2 index 5 div scalefont setfont
197 dup 14 mul 1 index 29 mul moveto (asy) show
198 dup 20 mul 1 index 19 mul moveto (oftware) show
199 dup 26 mul 1 index 9 mul moveto (roducts) show
208 % Determine the imageable area and device resolution...
209 initclip newpath clippath pathbbox % Get bounding rectangle
210 72 div /pageTop exch def % Get top margin in inches
211 72 div /pageRight exch def % Get right margin in inches
212 72 div /pageBottom exch def % Get bottom margin in inches
213 72 div /pageLeft exch def % Get left margin in inches
215 4 setlinewidth % Draw wide lines
216 0 setgray closepath stroke % Draw a clipping rectangle
217 1 setlinewidth % Draw normal lines
219 /pageWidth pageRight pageLeft sub def % pageWidth = pageRight - pageLeft
220 /pageHeight pageTop pageBottom sub def% pageHeight = pageTop - pageBottom
222 72 72 dtransform % Get device resolution per inch
223 /yResolution exch abs def % yResolution = abs(yres)
224 /xResolution exch abs def % xResolution = abs(xres)
226 % Figure out the sizes of things...
227 /wheelSize % size of wheels
228 pageWidth pageHeight lt
234 /bigFont /Helvetica-Bold findfont % bigFont = Helvetica-Bold
235 pageHeight 3 mul scalefont def % size = pageHeight * 3 (nominally 33)
237 /mediumFont /Helvetica findfont % mediumFont = Helvetica
238 pageHeight 1.5 mul scalefont def % size = pageHeight * 1.5 (nominally 16.5)
240 /smallFont /Times-Roman findfont % smallFont = Times-Roman
241 pageHeight scalefont def % size = pageHeight (nominally 11)
243 % Offset page to account for lower-left margin...
248 % Draw the color wheel...
249 mediumFont setfont % Font
253 % Position the wheel on the left side...
254 pageWidth 18 mul % x = pageWidth * 1/4 * 72
255 pageHeight 54 mul % y = pageHeight * 3/4 * 72
262 dup (C) exch 0 1 1 OCTANT 45 rotate
263 dup (M) exch 1 0 1 OCTANT 45 rotate
264 dup (Y) exch 1 1 0 OCTANT 45 rotate
265 dup (K) exch 0 0 0 OCTANT 45 rotate
266 dup (R) exch 1 0 0 OCTANT 45 rotate
267 dup (G) exch 0 1 0 OCTANT 45 rotate
268 dup (B) exch 0 0 1 OCTANT 45 rotate
269 (W) exch 1 1 1 OCTANT 45 rotate
272 % Label the color wheel...
273 pageWidth 18 mul % x = pageWidth * 1/4 * 72
274 pageHeight 44 mul % y = pageHeight * 19/32 * 72
275 moveto % Position the text
276 (Color Wheel) CENTER % Show the text centered
278 % Draw radial lines...
280 0 setlinewidth % 1 pixel lines
282 % Position the lines on the left side...
283 pageWidth 54 mul % x = pageWidth * 3/4 * 72
284 pageHeight 54 mul % y = pageHeight * 3/4 * 72
290 % Loop at 1 degree increments
292 pop % Discard angle - not used
293 0 0 moveto % Start line at the center
294 dup 0 lineto % Draw to the radius
295 1 rotate % Rotate 1 degree
298 pop % Discard radius - not needed anymore
299 stroke % Draw lines...
304 pageWidth 54 mul % x = pageWidth * 3/4 * 72
305 pageHeight 44 mul % y = pageHeight * 19/32 * 72
306 moveto % Position the text
307 (1 Degree Radial Lines) CENTER % Show the text centered
310 pageHeight 15 mul % Height of imageable area
312 pageWidth 4.5 mul % x = pageWidth * 1/16 * 72
313 pageHeight 35.5 mul % y = pageHeight * 1/2 * 72
314 2 index sub % y -= height
315 pageWidth 28 mul % width = pageWidth * 1/4 * 72
317 0.5 setgray rectfill % Draw a shadow
319 pageWidth 4 mul % x = pageWidth * 1/16 * 72
320 pageHeight 36 mul % y = pageHeight * 1/2 * 72
321 2 index sub % y -= height
322 pageWidth 28 mul % width = pageWidth * 3/8 * 72
324 4 copy 1 setgray rectfill % Clear the box to white
325 0 setgray rectstroke % Draw a black box around it...
329 % Label the imageable area...
330 pageWidth 4 mul % x = pageWidth * 1/16 * 72
331 pageHeight 37 mul % y = pageHeight * 1/2 * 72
332 moveto % Position the text
333 mediumFont setfont % Font
334 (Imageable Area) show % Show the text
336 smallFont setfont % Font
337 pageWidth 14 mul % x = pageWidth * 3/16 * 72
338 pageHeight 36 mul % y = pageWidth * 1/2 * 72
339 pageHeight -2 mul add % y -= 2 * smallFont height
342 2 copy moveto % Move to x & y
343 (Page Size: ) RIGHT % Label
344 100 pageWidth NUMBER % pageWidth
346 100 pageHeight NUMBER % pageHeight
349 % Page Size millimeters
350 pageHeight sub % Move down...
352 2 copy moveto % Move to x & y
353 10 pageWidth 25.4 mul NUMBER % pageWidth
355 10 pageHeight 25.4 mul NUMBER % pageHeight
359 pageHeight 2 mul sub % Move down...
361 2 copy moveto % Move to x & y
362 (Lower-Left: ) RIGHT % Label
363 100 pageLeft NUMBER % pageLeft
365 100 pageBottom NUMBER % pageBottom
368 % Lower-left millimeters
369 pageHeight sub % Move down...
371 2 copy moveto % Move to x & y
372 10 pageLeft 25.4 mul NUMBER % pageLeft
374 10 pageBottom 25.4 mul NUMBER % pageBottom
378 pageHeight 2 mul sub % Move down...
380 2 copy moveto % Move to x & y
381 (Upper-Right: ) RIGHT % Label
382 100 pageRight NUMBER % pageRight
384 100 pageTop NUMBER % pageTop
387 % Upper-right millimeters
388 pageHeight sub % Move down...
390 2 copy moveto % Move to x & y
391 10 pageRight 25.4 mul NUMBER % pageRight
393 10 pageTop 25.4 mul NUMBER % pageTop
396 % Resolution dots-per-inch
397 pageHeight 2 mul sub % Move down...
399 2 copy moveto % Move to x & y
400 (Resolution: ) RIGHT % Label
401 1 xResolution NUMBER % xResolution
403 1 yResolution NUMBER % yResolution
406 % Resolution dots-per-meter
407 pageHeight sub % Move down...
409 moveto % Move to x & y
410 1 xResolution 39.27 mul NUMBER % xResolution
412 1 yResolution 39.27 mul NUMBER % yResolution
415 % Interpreter Information...
416 pageHeight 15 mul % Height of interpreter information
418 pageWidth 40.5 mul % x = pageWidth * 9/16 * 72
419 pageHeight 35.5 mul % y = pageHeight * 1/2 * 72
420 2 index sub % y -= height
421 pageWidth 28 mul % width = pageWidth * 1/4 * 72
423 0.5 setgray rectfill % Draw a shadow
425 pageWidth 40 mul % x = pageWidth * 9/16 * 72
426 pageHeight 36 mul % y = pageHeight * 1/2 * 72
427 2 index sub % y -= height
428 pageWidth 28 mul % width = pageWidth * 3/8 * 72
430 4 copy 1 setgray rectfill % Clear the box to white
431 0 setgray rectstroke % Draw a black box around it...
435 % Label the interpreter info...
436 pageWidth 40 mul % x = pageWidth * 9/16 * 72
437 pageHeight 37 mul % y = pageHeight * 1/2 * 72
438 moveto % Position the text
439 mediumFont setfont % Font
440 (Interpreter Information) show % Show the text
442 smallFont setfont % Font
443 pageWidth 49 mul % x = pageWidth * 11/16 * 72
444 pageHeight 36 mul % y = pageWidth * 1/2 * 72
445 pageHeight 2 mul sub % y -= 2 * smallFont height
448 2 copy moveto % Move to x & y
449 (PostScript: ) RIGHT % Label
450 (Level ) show % "Level "
451 1 languagelevel NUMBER % Language level
454 pageHeight 2 mul sub % Move down...
455 2 copy moveto % Move to x & y
456 (Version: ) RIGHT % Label
457 version show % Version
459 1 revision NUMBER % Revision
463 pageHeight 2 mul sub % Move down...
464 2 copy moveto % Move to x & y
465 (Product: ) RIGHT % Label
466 product show % Product name
469 pageHeight 2 mul sub % Move down...
470 2 copy moveto % Move to x & y
471 (Serial #: ) RIGHT % Label
472 1 serialnumber NUMBER % S/N
474 % Draw the label at the top...
475 pageWidth 36 mul % Center of page
476 pageHeight 68 mul % Top of page (15/16ths)
477 2 copy moveto % Position text
478 bigFont setfont % Font
479 (Printer Test Page) CENTER % Show text centered
481 % Draw the copyright notice at the bottom...
482 pageWidth 36 mul % Center of page
483 pageHeight 10 mul % Bottom of page
484 2 copy moveto % Position text
485 (Printed Using CUPS v1.1.x) CENTER % Show text centered
487 pageHeight 2 mul sub % Move down...
488 2 copy moveto % Position text
489 smallFont setfont % Font
490 (Copyright 1993-2005 by Easy Software Products, All Rights Reserved.) CENTER
491 pageHeight sub % Move down...
492 2 copy moveto % Position text
493 (CUPS, Easy Software Products and their logos are the trademark property of) CENTER
494 pageHeight sub % Move down...
495 2 copy moveto % Position text
496 (Easy Software Products, 44141 Airport View Drive, Suite 204,) CENTER
497 pageHeight sub % Move down...
498 2 copy moveto % Position text
499 (Hollywood, Maryland, 20636, USA.) CENTER
501 % Then the CUPS logo....
506 pageWidth 9 mul CUPSLOGO
509 % And the ESP logo....
514 pageWidth 6 mul ESPLOGO
520 % End of "$Id: testprint.ps,v 1.17 2005/01/03 19:29:45 mike Exp $".