-
Notifications
You must be signed in to change notification settings - Fork 1
/
CRVOFSET.PS
executable file
·115 lines (95 loc) · 2.45 KB
/
CRVOFSET.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
103
104
105
106
107
108
109
110
111
112
113
114
115
%!PS-Adobe-2.0
%%Title: Arrow1.ps
%%Author: Rob
%%EndComments
%Routines for arrow drawing
/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 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
{ %ifelse
charcount str length lt
{ setchar } { exit } ifelse }
}{ %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
gsave
cpx cpy itransform translate
dx dy atan rotate
0 0 moveto
char show
currentpoint transform
/cpy exch def /cpx exch def
grestore
/setdist setdist charwidth add def
}def
%Rename text commands
/*scalefont /scalefont load def
/*show /show load def %rename show
%Redefine text commands
/scalefont { %def
dup
/fsize exch def
scalefont
} bind def
/show { %def %redefine show for filled characters only
{ %forall
/charcode exch def
/thischar ( ) dup 0 charcode put def
gsave
currentpoint %save starting point
/currenty exch def
/currentx exch def
thischar cvs show
currentx currenty moveto
thischar false charpath %get character outline
flattenpath
/sfont currentfont def
/Symbol findfont fsize 10 div scalefont setfont
/char (\257) def
/charwidth char stringwidth pop def
{ tomove } { toline } { tocurve } { toclose } pathforall
sfont findfont fsize scalefont setfont
grestore
thischar stringwidth pop 0 rmoveto
currentpoint pop currenty moveto
} forall
} bind def
%%EndProlog
/Helvetica findfont 90 scalefont setfont
100 100 moveto
(viral) show
showpage