-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLINOFSET.PS
executable file
·98 lines (85 loc) · 2.89 KB
/
LINOFSET.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
%!PS-Adobe-2.0
%%Title: linofset.ps
%%Creator: Rhea Myers
%%EndComments
%Basic variables and operations for redefining drawing commands
%/moveto load { %def 2modify *moveto } ne { %if
/n 42949672940 def %the number to divide rand by to get 0-.20
/modify { %def
dup 0 eq { pop 1 } if
rand n div .975 add mul cvi %multiplies integer by 90-110%
} bind def
/2modify { %def
2 { modify 1 2 roll } repeat %modifies top 2 numbers on stack
} bind def
/5modify { %def
5 { modify 1 5 roll } repeat %modifies top 5 numbers on stack
} bind def
/6modify { %def
6 { modify 1 6 roll } repeat %modifies top 6 numbers on stack
} bind def
%Rename drawing functions
/*moveto /moveto load def
/*lineto /lineto load def
/*rmoveto /rmoveto load def
/*rlineto /rlineto load def
%Redefine drawing functions
/moveto { %def
2modify
*moveto
} bind def
/lineto { %def
2modify
*lineto
} bind def
/rmoveto { %def
2modify
*rmoveto
} bind def
/rlineto { %def
2modify
*rlineto
} bind def
/rcurveto { %def
2modify
*rcurveto
} bind def
%Rename text commands
/*show /show load def %rename show
%Redefine text commands
/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 false charpath %get character outline
/thispath [
{ /moveto cvx } { /lineto cvx } { /curveto cvx }
{ /closepath cvx } pathforall
] cvx def
newpath
currentx currenty moveto
thispath
%level2 flattenpath pathbbox setbbox
currentfont begin
PaintType 2 eq { %ifelse
stroke
}{ %else
fill
} ifelse
end
grestore
thischar stringwidth pop 0 *rmoveto
currentpoint pop currenty *moveto
} forall
} bind def
%%EndProlog
/Helvetica findfont
96 scalefont setfont
50 700 *moveto
(viral) show
showpage
cleardictstack