-
Notifications
You must be signed in to change notification settings - Fork 1
/
ARROW1.PS
executable file
·102 lines (88 loc) · 1.84 KB
/
ARROW1.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*scalefont /scalefont load def
/scalefont { %def
dup 12 div /fontsiz exch def
*scalefont
} bind def
/pathtextdict 26 dict def
/pathtext { %def
pathtextdict begin
/str ( v) def
/pathdist 0 def
/setdist 0 def
/charcount 0 def
gsave
/Courier findfont fontsiz scalefont setfont
flattenpath
{ tomove } { toline } { tocurve } { toclose } pathforall
grestore
newpath
end
} bind def
/tomove { %def
/newy exch def
/newx exch def
/firstx newx def
/firsty newy def
/ovr 0 def
newx newy transform
/cpy exch def
/cpx exch def
}bind def
/toline { %def
/oldx newx def
/oldy newy def
/newy exch def
/newx exch def
/dx newx oldx sub def
/dy newy oldy sub def
/dist dx dup mul dy dup mul add abs sqrt def
dist 0 ne { %if
/dsx dx dist div ovr mul def
/dsy dy dist div ovr mul def
oldx dsx add oldy dsy add transform
/cpy exch def
/cpx exch def
/pathdist pathdist dist add def
{ %loop
setdist pathdist le { %ifelse
setchar
}{ %elseif
/ovr setdist pathdist sub def exit
} ifelse
} loop
} if
} bind def
/tocurve { %def
(ERROR! No curves after flattenpath!) print
} bind def
/closepathproc { %def
firstx firsty toline
firstx firsty tomove
} bind def
/setchar { %def
/char str charcount 1 getinterval def
/charcount charcount 1 add def
/charwidth char stringwidth pop def
gsave
cpx cpy itransform translate
dy dx atan 180 add rotate
0 0 moveto
char show
charwidth neg 0 moveto
currentpoint transform
/cpy exch def
/cpx exch def
grestore
/setdist setdist charwidth add def
charcount 3 eq {/charcount 0 def } if
}def
%%EndProlog
/Helvetica findfont 170 scalefont setfont
100 100 moveto
(v) true charpath stroke
100 100 moveto
(v) true charpath
pathtext
100 200 moveto
(v) show
showpage