2 %%BoundingBox: 0 0 612 792
5 %%DocumentData: Clean7Bit
6 %%DocumentSuppliedResources: procset testprint/1.3
7 %%DocumentNeededResources: font Helvetica Helvetica-Bold Times-Roman
8 %%Creator: Michael Sweet, Apple Inc.
9 %%CreationDate: D:20070606214000+0500
13 %%BeginResource procset testprint 1.3 0
15 % PostScript test page for CUPS.
17 % Copyright 2007-2011 Apple Inc.
18 % Copyright 1993-2007 Easy Software Products
20 % These coded instructions, statements, and computer programs are the
21 % property of Apple Inc. and are protected by Federal copyright law.
22 % Distribution and use rights are outlined in the file "LICENSE.txt"
23 % which is included with the CUPS source distribution.
25 /SEXTANT { % Draw a color wheel sextant...
26 % (name) white radius r g b SEXTANT -
27 % Loop through 100 shades...
30 dup 0.75 le { % Get "white" value
32 dup 0.75 div % val2 = val / 0.75
34 0 index 5 index mul % R = R * val2
35 1 index 5 index mul % G = G * val2
36 2 index 5 index mul % B = B * val2
38 4 -1 roll pop % Discard val2
41 dup neg 1 add 4 mul % val2 = (1 - val) * 4
43 0 index 5 index mul % R = R * val2
44 1 index neg 1 add add % + (1 - val2)
45 1 index 5 index mul % G = G * val2
46 2 index neg 1 add add % + (1 - val2)
47 2 index 5 index mul % B = B * val2
48 3 index neg 1 add add % + (1 - val2)
50 4 -1 roll pop % Discard val2
52 setrgbcolor % Set the color...
55 newpath % Start a new path...
56 dup 5 index mul % r1 = radius * val
57 0 0 3 -1 roll 0 60 arc % Draw the inner arc
59 dup 0.010101 add 5 index mul% r2 = (radius + 0.010101) * val
60 0 0 3 -1 roll 60 0 arcn % Draw the outer arc
62 closepath % Close the path
68 % Draw a line around the polygons...
69 pop pop pop dup % Pop R, G, B, start
73 0 0 3 -1 roll 0 60 arc % Arc around octant
74 closepath % Back to center
79 dup 30 cos mul % X = radius * cos(30)
80 exch 30 sin mul % Y = radius * sin(30)
81 moveto % Position label
84 30 rotate % Rotate label
85 dup 0.05 mul % Offset to the right
86 exch -0.05 mul % and down...
87 rmoveto % Offset label
91 /CENTER { % Draw centered text
93 dup stringwidth pop % Get the width of the string
94 0.5 mul neg 0 rmoveto % Shift left 1/2 of the distance
95 show % Show the string
97 /RIGHT { % Draw right-justified text
99 dup stringwidth pop % Get the width of the string
100 neg 0 rmoveto % Shift left the entire distance
101 show % Show the string
103 /NUMBER { % Draw a number
105 1 index 1 eq { % power == 1?
106 round cvi exch pop % Convert "n" to integer
108 1 index mul round exch div % Truncate extra decimal places
110 100 string cvs show % Convert to a string and show it...
112 /CUPSLOGO { % Draw the CUPS logo
114 % Start with a big C...
115 /Helvetica findfont 1 index scalefont setfont
120 % Then "UNIX Printing System" much smaller...
121 /Helvetica-Bold findfont 1 index 9 div scalefont setfont
123 dup dup 2.0 mul moveto
125 dup dup 1.6 mul moveto
135 % Determine the imageable area and device resolution...
136 initclip newpath clippath pathbbox % Get bounding rectangle
137 72 div /pageTop exch def % Get top margin in inches
138 72 div /pageRight exch def % Get right margin in inches
139 72 div /pageBottom exch def % Get bottom margin in inches
140 72 div /pageLeft exch def % Get left margin in inches
142 4 setlinewidth % Draw wide lines
143 0 setgray closepath stroke % Draw a clipping rectangle
145 /pageWidth pageRight pageLeft sub def % pageWidth = pageRight - pageLeft
146 /pageHeight pageTop pageBottom sub def% pageHeight = pageTop - pageBottom
148 72 72 dtransform % Get device resolution per inch
149 /yResolution exch abs def % yResolution = abs(yres)
150 /xResolution exch abs def % xResolution = abs(xres)
152 % Figure out the sizes of things...
153 /wheelSize % size of wheels
154 pageWidth pageHeight lt
160 /bigFont /Helvetica-Bold findfont % bigFont = Helvetica-Bold
161 pageHeight 3 mul scalefont def % size = pageHeight * 3 (nominally 33)
163 /mediumFont /Helvetica findfont % mediumFont = Helvetica
164 pageHeight 1.5 mul scalefont def % size = pageHeight * 1.5 (nominally 16.5)
166 /smallFont /Times-Roman findfont % smallFont = Times-Roman
167 pageHeight scalefont def % size = pageHeight (nominally 11)
169 % Draw rulers along the edges...
170 /CENTIMETER 72 2.54 div def
171 /MILLIMETER 72 25.4 div def
173 /Times-Roman findfont % Font for ruler numbers
174 11 scalefont setfont % 11 points
176 gsave % Left side inches
177 pageLeft 72 mul 0 translate % Offset left edge
179 1 setlinewidth % Draw normal lines
180 72 72 pageTop 72 mul { % Height inches
182 0 exch moveto 24 0 rlineto stroke % Draw tic mark
183 24 exch pageHeight sub moveto % Draw number
184 72 div cvi 10 string cvs RIGHT
187 0.5 setlinewidth % Draw thin lines
188 18 18 pageTop 72 mul { % 1/4 inches
189 0 exch moveto 15 0 rlineto stroke % Draw tic mark
192 9 9 pageTop 72 mul { % 1/8 inches
193 0 exch moveto 6 0 rlineto stroke % Draw tic mark
197 gsave % Bottom inches
198 0 pageBottom 72 mul translate % Offset bottom edge
200 1 setlinewidth % Draw normal lines
201 72 72 pageRight 72 mul { % Width inches
203 0 moveto 0 24 rlineto stroke % Draw tic mark
204 3 add 27 pageHeight sub moveto % Draw number
205 72 div cvi 10 string cvs show
208 0.5 setlinewidth % Draw thin lines
209 18 18 pageRight 72 mul { % 1/4 inches
210 0 moveto 0 15 rlineto stroke % Draw tic mark
213 9 9 pageRight 72 mul { % 1/8 inches
214 0 moveto 0 6 rlineto stroke % Draw tic mark
218 gsave % Right side centimeters
219 pageRight 72 mul 0 translate % Offset right edge
221 1 setlinewidth % Draw normal lines
222 CENTIMETER CENTIMETER
223 pageTop 72 mul { % Height centimeters
224 0 exch moveto -24 0 rlineto stroke% Draw tic mark
226 1 1 pageTop 2.54 mul { % Height labels
228 -24 exch CENTIMETER mul
229 pageHeight sub moveto % Draw number
230 cvi 10 string cvs show
233 0.5 setlinewidth % Draw thin lines
235 pageTop 72 mul { % 1/2 centimeters
236 0 exch moveto -15 0 rlineto stroke% Draw tic mark
238 0 MILLIMETER pageTop 72 mul { % Millimeters
239 0 exch moveto -6 0 rlineto stroke % Draw tic mark
243 gsave % Top centimeters
244 0 pageTop 72 mul translate % Offset top edge
246 1 setlinewidth % Draw normal lines
247 CENTIMETER CENTIMETER
248 pageRight 72 mul { % Width centimeters
249 0 moveto 0 -24 rlineto stroke % Draw tic mark
251 1 1 pageRight 2.54 mul { % Width labels
253 CENTIMETER mul 3 add -24 moveto % Draw number
254 cvi 10 string cvs show
257 0.5 setlinewidth % Draw thin lines
259 pageRight 72 mul { % 1/2 centimeters
260 0 moveto 0 -15 rlineto stroke % Draw tic mark
262 0 MILLIMETER pageRight 72 mul { % Millimeters
263 0 moveto 0 -6 rlineto stroke % Draw tic mark
267 % Offset page to account for lower-left margin...
272 % Set text font and color...
273 mediumFont setfont % Font
275 1 setlinewidth % Draw normal lines
277 % Draw the color wheel...
279 % Position the wheel on the left side...
280 pageWidth 18 mul % x = pageWidth * 1/4 * 72
281 pageHeight 54 mul % y = pageHeight * 3/4 * 72
288 dup (C) 3 -1 roll 0 1 1 SEXTANT 60 rotate
289 dup (M) 3 -1 roll 1 0 1 SEXTANT 60 rotate
290 dup (Y) 3 -1 roll 1 1 0 SEXTANT 60 rotate
291 dup (R) 3 -1 roll 1 0 0 SEXTANT 60 rotate
292 dup (G) 3 -1 roll 0 1 0 SEXTANT 60 rotate
293 dup (B) 3 -1 roll 0 0 1 SEXTANT 60 rotate
298 % Label the color wheel...
299 pageWidth 18 mul % x = pageWidth * 1/4 * 72
300 pageHeight 43 mul % y = pageHeight * 19/32 * 72
301 moveto % Position the text
302 (Color Wheel) CENTER % Show the text centered
304 % Draw the gray ramp...
306 % Position the gray ramp in the center...
307 pageWidth 36 mul % x = pageWidth * 1/2 * 72
308 pageHeight 54 mul % y = pageHeight * 3/4 * 72
309 wheelSize sub % - wheelSize
312 % Loop through 100 shades...
315 dup setgray % Set the grayscale...
317 % Draw the polygon...
318 newpath % Start a new path...
320 wheelSize -0.2 mul % X = -wheelSize / 5
321 1 index 2 mul wheelSize mul % Y = val * 2 * wheelSize
322 moveto % Move there...
324 wheelSize 0.4 mul 0 rlineto % Right side...
326 wheelSize 0.2 mul % X = wheelSize / 5
327 1 index 0.010101 add 2 mul wheelSize mul
328 % Y = (val + 0.010101) * 2 * wheelSize
329 lineto % Move there...
331 wheelSize -0.4 mul 0 rlineto % Left side...
333 closepath % Close the path
341 newpath % Start a new path
342 wheelSize -0.2 mul 0 moveto % Bottom left
343 wheelSize 0.4 mul 0 rlineto % Bottom right
344 0 wheelSize 2 mul rlineto % Upper right
345 wheelSize -0.4 mul 0 rlineto % Upper left
346 closepath % Close the path
347 stroke % Stroke it...
349 0 wheelSize -0.2 mul moveto % Center bottom for label
350 (K) CENTER % Center K at bottom
352 0 wheelSize 2.05 mul moveto % Center top for label
353 (W) CENTER % Center W at top
356 % Label the gray ramp...
357 pageWidth 36 mul % x = pageWidth * 1/2 * 72
358 pageHeight 43 mul % y = pageHeight * 19/32 * 72
359 moveto % Position the text
360 (Gray Ramp) CENTER % Show the text centered
363 % Draw radial lines...
365 0 setlinewidth % 1 pixel lines
367 % Position the lines on the left side...
368 pageWidth 54 mul % x = pageWidth * 3/4 * 72
369 pageHeight 54 mul % y = pageHeight * 3/4 * 72
375 % Loop at 1 degree increments
377 pop % Discard angle - not used
378 0 0 moveto % Start line at the center
379 dup 0 lineto % Draw to the radius
380 1 rotate % Rotate 1 degree
383 pop % Discard radius - not needed anymore
384 stroke % Draw lines...
389 pageWidth 54 mul % x = pageWidth * 3/4 * 72
390 pageHeight 43 mul % y = pageHeight * 19/32 * 72
391 moveto % Position the text
392 (1 Degree Radial Lines) CENTER % Show the text centered
395 pageHeight 15 mul % Height of imageable area
397 pageWidth 4.5 mul % x = pageWidth * 1/16 * 72
398 pageHeight 35.5 mul % y = pageHeight * 1/2 * 72
399 2 index sub % y -= height
400 pageWidth 28 mul % width = pageWidth * 1/4 * 72
402 0.5 setgray rectfill % Draw a shadow
404 pageWidth 4 mul % x = pageWidth * 1/16 * 72
405 pageHeight 36 mul % y = pageHeight * 1/2 * 72
406 2 index sub % y -= height
407 pageWidth 28 mul % width = pageWidth * 3/8 * 72
409 4 copy 1 setgray rectfill % Clear the box to white
410 0 setgray rectstroke % Draw a black box around it...
414 % Label the imageable area...
415 pageWidth 4 mul % x = pageWidth * 1/16 * 72
416 pageHeight 37 mul % y = pageHeight * 1/2 * 72
417 moveto % Position the text
418 mediumFont setfont % Font
419 (Imageable Area) show % Show the text
421 smallFont setfont % Font
422 pageWidth 14 mul % x = pageWidth * 3/16 * 72
423 pageHeight 36 mul % y = pageWidth * 1/2 * 72
424 pageHeight -2 mul add % y -= 2 * smallFont height
427 2 copy moveto % Move to x & y
428 (Page Size: ) RIGHT % Label
429 100 pageWidth NUMBER % pageWidth
431 100 pageHeight NUMBER % pageHeight
434 % Page Size millimeters
435 pageHeight sub % Move down...
437 2 copy moveto % Move to x & y
438 10 pageWidth 25.4 mul NUMBER % pageWidth
440 10 pageHeight 25.4 mul NUMBER % pageHeight
444 pageHeight 2 mul sub % Move down...
446 2 copy moveto % Move to x & y
447 (Lower-Left: ) RIGHT % Label
448 100 pageLeft NUMBER % pageLeft
450 100 pageBottom NUMBER % pageBottom
453 % Lower-left millimeters
454 pageHeight sub % Move down...
456 2 copy moveto % Move to x & y
457 10 pageLeft 25.4 mul NUMBER % pageLeft
459 10 pageBottom 25.4 mul NUMBER % pageBottom
463 pageHeight 2 mul sub % Move down...
465 2 copy moveto % Move to x & y
466 (Upper-Right: ) RIGHT % Label
467 100 pageRight NUMBER % pageRight
469 100 pageTop NUMBER % pageTop
472 % Upper-right millimeters
473 pageHeight sub % Move down...
475 2 copy moveto % Move to x & y
476 10 pageRight 25.4 mul NUMBER % pageRight
478 10 pageTop 25.4 mul NUMBER % pageTop
481 % Resolution dots-per-inch
482 pageHeight 2 mul sub % Move down...
484 2 copy moveto % Move to x & y
485 (Resolution: ) RIGHT % Label
486 1 xResolution NUMBER % xResolution
488 1 yResolution NUMBER % yResolution
491 % Resolution dots-per-meter
492 pageHeight sub % Move down...
494 moveto % Move to x & y
495 1 xResolution 39.27 mul NUMBER % xResolution
497 1 yResolution 39.27 mul NUMBER % yResolution
500 % Interpreter Information...
501 pageHeight 15 mul % Height of interpreter information
503 pageWidth 40.5 mul % x = pageWidth * 9/16 * 72
504 pageHeight 35.5 mul % y = pageHeight * 1/2 * 72
505 2 index sub % y -= height
506 pageWidth 28 mul % width = pageWidth * 1/4 * 72
508 0.5 setgray rectfill % Draw a shadow
510 pageWidth 40 mul % x = pageWidth * 9/16 * 72
511 pageHeight 36 mul % y = pageHeight * 1/2 * 72
512 2 index sub % y -= height
513 pageWidth 28 mul % width = pageWidth * 3/8 * 72
515 4 copy 1 setgray rectfill % Clear the box to white
516 0 setgray rectstroke % Draw a black box around it...
520 % Label the interpreter info...
521 pageWidth 40 mul % x = pageWidth * 9/16 * 72
522 pageHeight 37 mul % y = pageHeight * 1/2 * 72
523 moveto % Position the text
524 mediumFont setfont % Font
525 (Interpreter Information) show % Show the text
527 smallFont setfont % Font
528 pageWidth 49 mul % x = pageWidth * 11/16 * 72
529 pageHeight 36 mul % y = pageWidth * 1/2 * 72
530 pageHeight 2 mul sub % y -= 2 * smallFont height
533 2 copy moveto % Move to x & y
534 (PostScript: ) RIGHT % Label
535 (Level ) show % "Level "
536 1 languagelevel NUMBER % Language level
539 pageHeight 2 mul sub % Move down...
540 2 copy moveto % Move to x & y
541 (Version: ) RIGHT % Label
542 version show % Version
544 1 revision NUMBER % Revision
548 pageHeight 2 mul sub % Move down...
549 2 copy moveto % Move to x & y
550 (Product: ) RIGHT % Label
551 product show % Product name
554 pageHeight 2 mul sub % Move down...
555 moveto % Move to x & y
556 (Serial #: ) RIGHT % Label
557 1 serialnumber NUMBER % S/N
559 % Draw the label at the top...
560 pageWidth 36 mul % Center of page
561 pageHeight 66 mul % Top of page (11/12ths)
562 moveto % Position text
563 bigFont setfont % Font
564 (Printer Test Page) CENTER % Show text centered
566 % Draw the copyright notice at the bottom...
567 pageWidth 17 mul % Center of page
568 pageHeight 10 mul % Bottom of page
569 moveto % Position text
570 (Printed Using CUPS v1.3.x) show
572 pageWidth 17 mul % Left side of page
573 pageHeight 8 mul % Move down...
574 2 copy moveto % Position text
575 smallFont setfont % Font
576 (Copyright 2007 Apple Inc., All Rights Reserved. CUPS and the CUPS logo are the trademark) show
577 pageHeight 2 add sub % Move down...
578 2 copy moveto % Position text
579 (property of Apple Inc., 1 Infinite Loop, Cupertino, CA 95014, USA.) show
580 pageHeight 2 mul 4 add sub % Move down...
581 moveto % Position text
582 (Need help? Contact your operating system vendor or visit "http://www.cups.org/".) show
584 % Then the CUPS logo....
589 pageWidth 15 mul CUPSLOGO
596 % End of "$Id: testfile.ps 6649 2007-07-11 21:46:42Z mike $".