2 %%BoundingBox: 0 0 612 792
5 %%DocumentData: Clean7Bit
6 %%DocumentSuppliedResources: procset testprint/1.0
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.2 0
15 % PostScript test page for the Common UNIX Printing System ("CUPS").
17 % Copyright 1993-2005 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 /SEXTANT { % Draw a color wheel sextant...
36 % (name) white radius r g b SEXTANT -
37 % Loop through 100 shades...
40 dup 0.75 le { % Get "white" value
42 dup 0.75 div % val2 = val / 0.75
44 0 index 5 index mul % R = R * val2
45 1 index 5 index mul % G = G * val2
46 2 index 5 index mul % B = B * val2
48 4 -1 roll pop % Discard val2
51 dup neg 1 add 4 mul % val2 = (1 - val) * 4
53 0 index 5 index mul % R = R * val2
54 1 index neg 1 add add % + (1 - val2)
55 1 index 5 index mul % G = G * val2
56 2 index neg 1 add add % + (1 - val2)
57 2 index 5 index mul % B = B * val2
58 3 index neg 1 add add % + (1 - val2)
60 4 -1 roll pop % Discard val2
62 setrgbcolor % Set the color...
65 newpath % Start a new path...
66 dup 5 index mul % r1 = radius * val
67 0 0 3 -1 roll 0 60 arc % Draw the inner arc
69 dup 0.010101 add 5 index mul% r2 = (radius + 0.010101) * val
70 0 0 3 -1 roll 60 0 arcn % Draw the outer arc
72 closepath % Close the path
78 % Draw a line around the polygons...
79 pop pop pop dup % Pop R, G, B, start
83 0 0 3 -1 roll 0 60 arc % Arc around octant
84 closepath % Back to center
89 dup 30 cos mul % X = radius * cos(30)
90 exch 30 sin mul % Y = radius * sin(30)
91 moveto % Position label
94 30 rotate % Rotate label
95 dup 0.05 mul % Offset to the right
96 exch -0.05 mul % and down...
97 rmoveto % Offset label
101 /CENTER { % Draw centered text
103 dup stringwidth pop % Get the width of the string
104 0.5 mul neg 0 rmoveto % Shift left 1/2 of the distance
105 show % Show the string
107 /RIGHT { % Draw right-justified text
109 dup stringwidth pop % Get the width of the string
110 neg 0 rmoveto % Shift left the entire distance
111 show % Show the string
113 /NUMBER { % Draw a number
115 1 index 1 eq { % power == 1?
116 round cvi exch pop % Convert "n" to integer
118 1 index mul round exch div % Truncate extra decimal places
120 100 string cvs show % Convert to a string and show it...
122 /CUPSLOGO { % Draw the CUPS logo
124 % Start with a big C...
125 /Helvetica findfont 1 index scalefont setfont
130 % Then "UNIX Printing System" much smaller...
131 /Helvetica-Bold findfont 1 index 9 div scalefont setfont
133 dup dup 2.0 mul moveto
135 dup dup 1.6 mul moveto
140 /ESPLOGO { % Draw the ESP logo
142 % Compute the size of the logo...
144 2 index 1.5 mul 3 index
146 % Do the "metallic" fill from 10% black to 40% black...
149 -0.15 mul % loopval * -0.15
150 0.9 add % 0.9 - loopval * 0.15
151 setgray % set gray shade
154 1 index neg % loopval
157 mul % height * (1 - loopval)
158 moveto % starting point
162 mul % loopval * width
174 0.15 mul % loopval * 0.15
175 0.6 add % 0.6 + loopval * 0.15
179 neg 1 add % 1 - loopval
181 mul % (1 - loopval) * width
183 moveto % Starting point
188 mul % loopval * height
201 /Helvetica-BoldOblique findfont 1 index 3 div scalefont setfont
204 dup 4 mul 1 index 25 mul moveto (E) show
205 dup 10 mul 1 index 15 mul moveto (S) show
206 dup 16 mul 1 index 5 mul moveto (P) show
208 /Helvetica-BoldOblique findfont 2 index 5 div scalefont setfont
209 dup 14 mul 1 index 29 mul moveto (asy) show
210 dup 20 mul 1 index 19 mul moveto (oftware) show
211 dup 26 mul 1 index 9 mul moveto (roducts) show
220 % Determine the imageable area and device resolution...
221 initclip newpath clippath pathbbox % Get bounding rectangle
222 72 div /pageTop exch def % Get top margin in inches
223 72 div /pageRight exch def % Get right margin in inches
224 72 div /pageBottom exch def % Get bottom margin in inches
225 72 div /pageLeft exch def % Get left margin in inches
227 4 setlinewidth % Draw wide lines
228 0 setgray closepath stroke % Draw a clipping rectangle
229 1 setlinewidth % Draw normal lines
231 /pageWidth pageRight pageLeft sub def % pageWidth = pageRight - pageLeft
232 /pageHeight pageTop pageBottom sub def% pageHeight = pageTop - pageBottom
234 72 72 dtransform % Get device resolution per inch
235 /yResolution exch abs def % yResolution = abs(yres)
236 /xResolution exch abs def % xResolution = abs(xres)
238 % Figure out the sizes of things...
239 /wheelSize % size of wheels
240 pageWidth pageHeight lt
246 /bigFont /Helvetica-Bold findfont % bigFont = Helvetica-Bold
247 pageHeight 3 mul scalefont def % size = pageHeight * 3 (nominally 33)
249 /mediumFont /Helvetica findfont % mediumFont = Helvetica
250 pageHeight 1.5 mul scalefont def % size = pageHeight * 1.5 (nominally 16.5)
252 /smallFont /Times-Roman findfont % smallFont = Times-Roman
253 pageHeight scalefont def % size = pageHeight (nominally 11)
255 % Offset page to account for lower-left margin...
260 % Set text font and color...
261 mediumFont setfont % Font
264 % Draw the color wheel...
266 % Position the wheel on the left side...
267 pageWidth 18 mul % x = pageWidth * 1/4 * 72
268 pageHeight 54 mul % y = pageHeight * 3/4 * 72
275 dup (C) 3 -1 roll 0 1 1 SEXTANT 60 rotate
276 dup (M) 3 -1 roll 1 0 1 SEXTANT 60 rotate
277 dup (Y) 3 -1 roll 1 1 0 SEXTANT 60 rotate
278 dup (R) 3 -1 roll 1 0 0 SEXTANT 60 rotate
279 dup (G) 3 -1 roll 0 1 0 SEXTANT 60 rotate
280 dup (B) 3 -1 roll 0 0 1 SEXTANT 60 rotate
285 % Label the color wheel...
286 pageWidth 18 mul % x = pageWidth * 1/4 * 72
287 pageHeight 44 mul % y = pageHeight * 19/32 * 72
288 moveto % Position the text
289 (Color Wheel) CENTER % Show the text centered
291 % Draw the gray ramp...
293 % Position the gray ramp in the center...
294 pageWidth 36 mul % x = pageWidth * 1/2 * 72
295 pageHeight 54 mul % y = pageHeight * 3/4 * 72
296 wheelSize sub % - wheelSize
299 % Loop through 100 shades...
302 dup setgray % Set the grayscale...
304 % Draw the polygon...
305 newpath % Start a new path...
307 wheelSize -0.2 mul % X = -wheelSize / 5
308 1 index 2 mul wheelSize mul % Y = val * 2 * wheelSize
309 moveto % Move there...
311 wheelSize 0.4 mul 0 rlineto % Right side...
313 wheelSize 0.2 mul % X = wheelSize / 5
314 1 index 0.010101 add 2 mul wheelSize mul
315 % Y = (val + 0.010101) * 2 * wheelSize
316 lineto % Move there...
318 wheelSize -0.4 mul 0 rlineto % Left side...
320 closepath % Close the path
328 newpath % Start a new path
329 wheelSize -0.2 mul 0 moveto % Bottom left
330 wheelSize 0.4 mul 0 rlineto % Bottom right
331 0 wheelSize 2 mul rlineto % Upper right
332 wheelSize -0.4 mul 0 rlineto % Upper left
333 closepath % Close the path
334 stroke % Stroke it...
336 0 wheelSize -0.2 mul moveto % Center bottom for label
337 (K) CENTER % Center K at bottom
339 0 wheelSize 2.05 mul moveto % Center top for label
340 (W) CENTER % Center W at top
343 % Label the gray ramp...
344 pageWidth 36 mul % x = pageWidth * 1/2 * 72
345 pageHeight 44 mul % y = pageHeight * 19/32 * 72
346 moveto % Position the text
347 (Gray Ramp) CENTER % Show the text centered
350 % Draw radial lines...
352 0 setlinewidth % 1 pixel lines
354 % Position the lines on the left side...
355 pageWidth 54 mul % x = pageWidth * 3/4 * 72
356 pageHeight 54 mul % y = pageHeight * 3/4 * 72
362 % Loop at 1 degree increments
364 pop % Discard angle - not used
365 0 0 moveto % Start line at the center
366 dup 0 lineto % Draw to the radius
367 1 rotate % Rotate 1 degree
370 pop % Discard radius - not needed anymore
371 stroke % Draw lines...
376 pageWidth 54 mul % x = pageWidth * 3/4 * 72
377 pageHeight 44 mul % y = pageHeight * 19/32 * 72
378 moveto % Position the text
379 (1 Degree Radial Lines) CENTER % Show the text centered
382 pageHeight 15 mul % Height of imageable area
384 pageWidth 4.5 mul % x = pageWidth * 1/16 * 72
385 pageHeight 35.5 mul % y = pageHeight * 1/2 * 72
386 2 index sub % y -= height
387 pageWidth 28 mul % width = pageWidth * 1/4 * 72
389 0.5 setgray rectfill % Draw a shadow
391 pageWidth 4 mul % x = pageWidth * 1/16 * 72
392 pageHeight 36 mul % y = pageHeight * 1/2 * 72
393 2 index sub % y -= height
394 pageWidth 28 mul % width = pageWidth * 3/8 * 72
396 4 copy 1 setgray rectfill % Clear the box to white
397 0 setgray rectstroke % Draw a black box around it...
401 % Label the imageable area...
402 pageWidth 4 mul % x = pageWidth * 1/16 * 72
403 pageHeight 37 mul % y = pageHeight * 1/2 * 72
404 moveto % Position the text
405 mediumFont setfont % Font
406 (Imageable Area) show % Show the text
408 smallFont setfont % Font
409 pageWidth 14 mul % x = pageWidth * 3/16 * 72
410 pageHeight 36 mul % y = pageWidth * 1/2 * 72
411 pageHeight -2 mul add % y -= 2 * smallFont height
414 2 copy moveto % Move to x & y
415 (Page Size: ) RIGHT % Label
416 100 pageWidth NUMBER % pageWidth
418 100 pageHeight NUMBER % pageHeight
421 % Page Size millimeters
422 pageHeight sub % Move down...
424 2 copy moveto % Move to x & y
425 10 pageWidth 25.4 mul NUMBER % pageWidth
427 10 pageHeight 25.4 mul NUMBER % pageHeight
431 pageHeight 2 mul sub % Move down...
433 2 copy moveto % Move to x & y
434 (Lower-Left: ) RIGHT % Label
435 100 pageLeft NUMBER % pageLeft
437 100 pageBottom NUMBER % pageBottom
440 % Lower-left millimeters
441 pageHeight sub % Move down...
443 2 copy moveto % Move to x & y
444 10 pageLeft 25.4 mul NUMBER % pageLeft
446 10 pageBottom 25.4 mul NUMBER % pageBottom
450 pageHeight 2 mul sub % Move down...
452 2 copy moveto % Move to x & y
453 (Upper-Right: ) RIGHT % Label
454 100 pageRight NUMBER % pageRight
456 100 pageTop NUMBER % pageTop
459 % Upper-right millimeters
460 pageHeight sub % Move down...
462 2 copy moveto % Move to x & y
463 10 pageRight 25.4 mul NUMBER % pageRight
465 10 pageTop 25.4 mul NUMBER % pageTop
468 % Resolution dots-per-inch
469 pageHeight 2 mul sub % Move down...
471 2 copy moveto % Move to x & y
472 (Resolution: ) RIGHT % Label
473 1 xResolution NUMBER % xResolution
475 1 yResolution NUMBER % yResolution
478 % Resolution dots-per-meter
479 pageHeight sub % Move down...
481 moveto % Move to x & y
482 1 xResolution 39.27 mul NUMBER % xResolution
484 1 yResolution 39.27 mul NUMBER % yResolution
487 % Interpreter Information...
488 pageHeight 15 mul % Height of interpreter information
490 pageWidth 40.5 mul % x = pageWidth * 9/16 * 72
491 pageHeight 35.5 mul % y = pageHeight * 1/2 * 72
492 2 index sub % y -= height
493 pageWidth 28 mul % width = pageWidth * 1/4 * 72
495 0.5 setgray rectfill % Draw a shadow
497 pageWidth 40 mul % x = pageWidth * 9/16 * 72
498 pageHeight 36 mul % y = pageHeight * 1/2 * 72
499 2 index sub % y -= height
500 pageWidth 28 mul % width = pageWidth * 3/8 * 72
502 4 copy 1 setgray rectfill % Clear the box to white
503 0 setgray rectstroke % Draw a black box around it...
507 % Label the interpreter info...
508 pageWidth 40 mul % x = pageWidth * 9/16 * 72
509 pageHeight 37 mul % y = pageHeight * 1/2 * 72
510 moveto % Position the text
511 mediumFont setfont % Font
512 (Interpreter Information) show % Show the text
514 smallFont setfont % Font
515 pageWidth 49 mul % x = pageWidth * 11/16 * 72
516 pageHeight 36 mul % y = pageWidth * 1/2 * 72
517 pageHeight 2 mul sub % y -= 2 * smallFont height
520 2 copy moveto % Move to x & y
521 (PostScript: ) RIGHT % Label
522 (Level ) show % "Level "
523 1 languagelevel NUMBER % Language level
526 pageHeight 2 mul sub % Move down...
527 2 copy moveto % Move to x & y
528 (Version: ) RIGHT % Label
529 version show % Version
531 1 revision NUMBER % Revision
535 pageHeight 2 mul sub % Move down...
536 2 copy moveto % Move to x & y
537 (Product: ) RIGHT % Label
538 product show % Product name
541 pageHeight 2 mul sub % Move down...
542 2 copy moveto % Move to x & y
543 (Serial #: ) RIGHT % Label
544 1 serialnumber NUMBER % S/N
546 % Draw the label at the top...
547 pageWidth 36 mul % Center of page
548 pageHeight 68 mul % Top of page (15/16ths)
549 2 copy moveto % Position text
550 bigFont setfont % Font
551 (Printer Test Page) CENTER % Show text centered
553 % Draw the copyright notice at the bottom...
554 pageWidth 36 mul % Center of page
555 pageHeight 10 mul % Bottom of page
556 2 copy moveto % Position text
557 (Printed Using CUPS v1.2.x) CENTER % Show text centered
559 pageHeight 2 mul sub % Move down...
560 2 copy moveto % Position text
561 smallFont setfont % Font
562 (Copyright 1993-2005 Easy Software Products, All Rights Reserved.) CENTER
563 pageHeight sub % Move down...
564 2 copy moveto % Position text
565 (CUPS, and the CUPS logo are the trademark property of) CENTER
566 pageHeight sub % Move down...
567 2 copy moveto % Position text
568 (Easy Software Products, 44141 Airport View Drive, Suite 204,) CENTER
569 pageHeight sub % Move down...
570 2 copy moveto % Position text
571 (Hollywood, Maryland, 20636, USA.) CENTER
573 % Then the CUPS logo....
578 pageWidth 9 mul CUPSLOGO
581 % And the ESP logo....
586 pageWidth 6 mul ESPLOGO
592 % End of "$Id: testfile.ps 4551 2005-07-28 13:45:00Z mike $".