Paths and
Clipping Paths |
%!PS-Adobe-2.0
% Example 1
/Mulberry {0.34 0.90 0 0.02 setcmykcolor} def
/oneline {
0 0 moveto 450 0 lineto stroke
} def
/lines {
gsave
oneline
180 {1 rotate oneline} repeat
grestore
} def
200 100 translate
1 setlinewidth
lines
showpage
|
%!PS-Adobe-2.0
% Example 2
/Mulberry {0.34 0.90 0 0.02 setcmykcolor} def
/circle {
newpath
0 0 100 0 360 arc
closepath
} def
200 200 translate
Mulberry circle fill
0 setgray
2 setlinewidth
circle stroke
showpage
|
%!PS-Adobe-2.0
% Example 3
/Mulberry {0.34 0.90 0 0.02 setcmykcolor} def
/oneline {
0 0 moveto 450 0 lineto stroke
} def
/lines {
gsave
oneline
180 {1 rotate oneline} repeat
grestore
} def
/circle {
newpath
0 100 100 0 360 arc
closepath
} def
200 100 translate
Mulberry circle fill
0 setgray
2 setlinewidth
circle stroke
1 setlinewidth
lines
showpage
|
%!PS-Adobe-2.0
% Example 4
/oneline {
0 0 moveto 450 0 lineto stroke
} def
/lines {
gsave
oneline
180 {1 rotate oneline} repeat
grestore
} def
/circle {
newpath
0 100 100 0 360 arc
closepath
} def
200 100 translate
Mulberry circle fill
0 setgray
2 setlinewidth
circle stroke
circle clip
1 setlinewidth
lines
showpage
|
%!PS-Adobe-2.0
% Example 5
/Mulberry {0.34 0.90 0 0.02 setcmykcolor} def
/oneline {
0 0 moveto 550 0 lineto stroke
} def
/lines {
gsave
oneline
180 {1 rotate oneline} repeat
grestore
} def
/path {
/Times-Bold findfont 250 scalefont setfont
newpath 0 0 moveto (ABC) false charpath
} def
50 100 translate
Mulberry path fill
0 setgray
2 setlinewidth
path stroke
path clip
1 setlinewidth
lines
showpage
|
%!PS-Adobe-2.0
% Example 6
% Some colors
/Apricot{0 0.32 0.52 0 setcmykcolor} def
/OliveGreen{0.64 0 0.95 0.40 setcmykcolor} def
/GreenYellow{0.15 0 0.69 0 setcmykcolor} def
/RedViolet{0.07 0.90 0 0.34 setcmykcolor} def
/Times-Bold findfont 80 scalefont setfont
/background {
newpath
0 0 moveto
1000 0 lineto
1000 1000 lineto
0 1000 lineto
closepath
} def
/pl {
50 200 moveto
(Programming) show
50 100 moveto
(Languages) show
} def
/circle {
newpath
250 175 130 0 360 arc
closepath
} def
Apricot background fill
OliveGreen pl
circle clip
GreenYellow background fill
RedViolet pl
showpage
% Example 6.1
% with the line "circle clip" commented out
|
%!PS-Adobe-2.0
% Example 7
/Apricot{0 0.32 0.52 0 setcmykcolor} def
/OliveGreen{0.64 0 0.95 0.40 setcmykcolor} def
/GreenYellow{0.15 0 0.69 0 setcmykcolor} def
/RedViolet{0.07 0.90 0 0.34 setcmykcolor} def
/Times-Bold findfont 80 scalefont setfont
/background {
newpath
0 0 moveto
1000 0 lineto
1000 1000 lineto
0 1000 lineto
closepath
} def
/pl {
50 200 moveto
(Programming) show
50 100 moveto
(Languages) show
} def
/circles {
newpath
435 50 2 div add 230 50 2 div add moveto
435 230 50 0 360 arc
250 130 2 div add 175 130 2 div add moveto
250 175 130 0 360 arc
230 60 2 div add 155 602 2 div add moveto
230 155 60 0 360 arc
closepath
} def
Apricot background fill
OliveGreen pl
circles eoclip % even-odd clipping algorithm
GreenYellow background fill
RedViolet pl
showpage
Example 9
Example 10
Example 11
|
%!PS-Adobe-2.0
% Example 8
/Apricot{0 0.32 0.52 0 setcmykcolor} def
/OliveGreen{0.64 0 0.95 0.40 setcmykcolor} def
/GreenYellow{0.15 0 0.69 0 setcmykcolor} def
/RedViolet{0.07 0.90 0 0.34 setcmykcolor} def
/Times-Bold findfont 110 scalefont setfont
/background {
newpath
0 0 moveto
1000 0 lineto
1000 1000 lineto
0 1000 lineto
closepath
} def
/pl {
50 200 moveto
(Programming) show
50 100 moveto
(Languages) show
} def
/circlepath { % stack: x y r
/r exch def /y exch def /x exch def
x r 2 div add y r 2 div add moveto
x y r 0 360 arc
} def
/circles {
newpath
500 230 65 circlepath
250 175 130 circlepath
230 155 60 circlepath
475 160 65 circlepath
closepath
} def
/everything {
Apricot background fill
OliveGreen pl
circles eoclip % even-odd clipping algorithm
GreenYellow background fill
RedViolet pl
} def
% below to keep vert. alignment, < 5 no good
5 { 1000 1000 moveto (abcdefgh) show} repeat
90 rotate
0 -612 translate
everything
showpage
|