-
Notifications
You must be signed in to change notification settings - Fork 0
/
flag.ps
63 lines (53 loc) · 1.1 KB
/
flag.ps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
% Chicago Flag in Postscript
% by Ken Schutte
/numstar 4 def
/width 720 def % total flag w,h
/height 480 def
/pw 16 def % pw,ph control size of points
/ph 60 def
/npoint 4 def % num points on a star
/barheight 80 def
/starRGB [ 1 0 0] def
/barRGB [.702 .867 .949] def % #b3ddf2
/setcolor {
aload pop setrgbcolor
} def
/bars {
0 120 moveto
width 0 rlineto
0 360 moveto
width 0 rlineto
barheight setlinewidth
barRGB setcolor
stroke
} def
% draw one point for six-pointed star
/point {
pw neg 0 moveto
pw ph rlineto
pw ph neg rlineto
} def
% draw one star
/star {
/degrees 360 npoint div def
npoint {
point
degrees rotate
} repeat
} def
/stars {
% compute horiz distance between stars
% (equally spaced with pad 10 on both sides)
% sdist = (width - 20)/(numstar+1)
/sdist width 20 sub numstar 1 add div def
10 sdist add height 2 div translate % move to first
numstar {
star
sdist 0 translate
} repeat
starRGB setcolor
fill
} def
%---main---
bars
stars