[gs-cvs] rev 8580 - tests/ps

alexcher at ghostscript.com alexcher at ghostscript.com
Sun Mar 2 20:10:37 PST 2008


Author: alexcher
Date: 2008-03-02 20:10:37 -0800 (Sun, 02 Mar 2008)
New Revision: 8580

Added:
   tests/ps/colored_pattern.ps
   tests/ps/uncolored_pattern.ps
Log:
Add colored and uncolored pattern examples from the Red Book.


Added: tests/ps/colored_pattern.ps
===================================================================
--- tests/ps/colored_pattern.ps	2008-03-03 04:03:51 UTC (rev 8579)
+++ tests/ps/colored_pattern.ps	2008-03-03 04:10:37 UTC (rev 8580)
@@ -0,0 +1,44 @@
+%!
+% Colored pattern example from the Red Book.
+%
+1.3 dup scale
+
+<< /PatternType 1 % Tiling pattern
+   /PaintType   1 % Colored
+   /TilingType 1
+   /BBox [0 0 60 60]
+   /XStep 60
+   /YStep 60
+   /star
+     { gsave % Private procedure used by PaintProc
+       0 12 moveto
+       4 { 144 rotate 0 12 lineto } repeat
+       closepath fill
+       grestore
+     } bind
+
+  /PaintProc
+    { begin % Push pattern on dictionary stack
+      0.3 setgray % Set color for dark gray stars
+      15 15 translate star
+      30 30 translate star
+      0.7 setgray % Set color for light gray stars
+      -30 0 translate star
+      30 -30 translate star
+      end
+    } bind
+>> % End prototype pattern dictionary
+
+matrix % Identity matrix
+makepattern % Instantiate the pattern
+/Star4 exch def
+120 120 184 120 4 copy % Two copies of rectangle operands
+/Pattern setcolorspace
+Star4 setcolor rectfill % Fill rectangle with stars
+0.0 setgray rectstroke % Stroke black outline
+/Times-Roman 270 selectfont
+160 100 translate
+0.9 setgray 0 0 moveto (A) show % Paint glyph with gray
+Star4 setpattern 0 0 moveto (A) show % Paint glyph with stars
+showpage
+


Property changes on: tests/ps/colored_pattern.ps
___________________________________________________________________
Name: svn:executable
   + *

Added: tests/ps/uncolored_pattern.ps
===================================================================
--- tests/ps/uncolored_pattern.ps	2008-03-03 04:03:51 UTC (rev 8579)
+++ tests/ps/uncolored_pattern.ps	2008-03-03 04:10:37 UTC (rev 8580)
@@ -0,0 +1,31 @@
+%!
+% Uncolored pattern example from the Red Book.
+%
+1.3 dup scale
+
+<< /PatternType 1 % Tiling pattern
+   /PaintType 2 % Uncolored
+   /TilingType 1
+   /BBox [-12 -12 12 12]
+   /XStep 30
+   /YStep 30
+   /PaintProc
+     { pop % Pop pattern dictionary
+       0 12 moveto
+       4 { 144 rotate 0 12 lineto } repeat
+       closepath
+       fill
+     } bind
+>> % End prototype pattern dictionary
+matrix % Identity matrix
+makepattern % Instantiate the pattern
+
+/Star exch def
+140 110 170 100 4 copy % Two copies of rectangle operands
+0.9 setgray rectfill % Fill rectangle with gray
+[/Pattern /DeviceGray] setcolorspace
+1.0 Star setcolor rectfill % Fill rectangle with white stars
+225 185 60 0 360 arc % Build circular path
+0.0 Star setpattern gsave fill grestore % Fill circle with black stars
+0.0 setgray stroke % Stroke black outline
+showpage


Property changes on: tests/ps/uncolored_pattern.ps
___________________________________________________________________
Name: svn:executable
   + *



More information about the gs-cvs mailing list