summaryrefslogtreecommitdiff
path: root/fonts/knot/bits.mf
blob: 2693d47d440e8dbb8be37733086f45e4893ee7b1 (plain)
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
beginchar ("0", sqwid#, sqht#, 0); "bit 0";
	pickup thin_pen;

	z1 = (0,0);
	z2 = (w,0);
	z3 = (w,h);
	z4 = (0,h);
	draw z1--z2--z3--z4--cycle;
endchar;

beginchar ("1", sqwid#, sqht#, 0); "bit 1";
	pickup thin_pen;

	z1 = (0,0);
	z2 = (w,0);
	z3 = (w,h);
	z4 = (0,h);
	z5 = (1/7w,1/7h);
	z6 = (6/7w,1/7h);
	z7 = (6/7w,6/7h);
	z8 = (1/7w,6/7h);
	draw z1--z2--z3--z4--cycle;
	draw z5--z6--z7--z8--cycle;
	pickup pensquare xscaled (1/7w) yscaled (1/7h) shifted (1/14w, 1/14h);
	drawdot (1/7w, 1/7h);
	drawdot (3/7w, 1/7h);
	drawdot (5/7w, 1/7h);
	drawdot (2/7w, 2/7h);
	drawdot (4/7w, 2/7h);
	drawdot (1/7w, 3/7h);
	drawdot (3/7w, 3/7h);
	drawdot (5/7w, 3/7h);
	drawdot (2/7w, 4/7h);
	drawdot (4/7w, 4/7h);
	drawdot (1/7w, 5/7h);
	drawdot (3/7w, 5/7h);
	drawdot (5/7w, 5/7h);
endchar;

beginchar ("2", sqwid#, sqht#, 0); "bit 2";
	pickup thin_pen;

	z1 = (0,0);
	z2 = (w,0);
	z3 = (w,h);
	z4 = (0,h);
	z5 = (0,.75h);
	z6 = (.25w,.75h);
	z7 = (.25w,.5h);
	z8 = (.75w,.5h);
	z9 = (.75w,.25h);
	z10= (w,.25h);
	z11= (.25w,0);
	z12= (.25w,.25h);
	z13= (.5w,.25h);
	z14= (.5w,.75h);
	z15= (.75w,.75h);
	z16= (.75w,h);
	z17= (.125w,.125h);
	z18= (.125w,.625h);
	z19= (.125w,.375h);
	z20= (.375w,.375h);
	z21= (.875w,.125h);
	z22= (.375w,.125h);
	z23= (.625w,.125h);
	z24= (.625w,.375h);
	z25= (.875w,.375h);
	z26= (.875w,.875h);
	z27= (.625w,.625h);
	z28= (.875w,.625h);
	z29= (.375w,.625h);
	z30= (.375w,.875h);
	z31= (.125w,.875h);
	z32= (.625w,.875h);

	draw z1--z2--z3--z4--cycle;
	draw z5--z6--z7--z8--z9--z10;
	draw z11--z12--z13--z14--z15--z16;
	draw z17--z18; draw z19--z20; draw z21--z22;
	draw z23--z24; draw z25--z26; draw z27--z28;
	draw z29--z30; draw z31--z32;
endchar;

beginchar ("3", sqwid#, sqht#, 0); "bit 3";
	z1 = (w/2,h/4);
	z2 = (3w/4,h/2);
	z3 = (w/2,3h/4);
	z4 = (w/4,h/2);
	fill z1--z2--z3--z4--cycle;
endchar;

beginchar ("4", sqwid#, sqht#, 0); "bit 4";
	z1 = (w/2,h/4);
	z2 = (3w/4,h/2);
	z3 = (w/2,3h/4);
	z4 = (w/4,h/2);
	fill z1..z2..z3..z4..cycle;
endchar;

beginchar ("5", sqwid#, sqht#, 0); "bit 5";
	pickup thin_pen;

	z1 = (0,0);
	z2 = (w,0);
	z3 = (w,h);
	z4 = (0,h);
	z5 = (1/7w,1/7h);
	z6 = (6/7w,1/7h);
	z7 = (6/7w,6/7h);
	z8 = (1/7w,6/7h);
	z9 = (w/2, 2/7h);
	z10= (5/7w, h/2);
	z11= (w/2, 5/7h);
	z12= (2/7w, h/2);
	draw z1--z2--z3--z4--cycle;
	fill z5--z9--z6--cycle;
	fill z6--z10--z7--cycle;
	fill z7--z11--z8--cycle;
	fill z8--z12--z5--cycle;
endchar;

def ulsq =
	pickup knot_pen;
	lft x1 = 0;
	y1 = 0;
	lft x2 = 0;
	top y2 = h;
	x3 = w;
	top y3 = h;
	draw z1--z2--z3;

	pickup thin_pen;
	z4 = (.2w, 0);
	z5 = (.2w, .8h);
	z6 = (w, .8h);
	draw z4--z5--z6;

	pickup thin_pen;
	z7 = (.8w, 0);
	z8 = (.8w, .2h);
	z9 = (w, .2h);
	draw z7--z8--z9;

	pickup knot_pen;
	rt x10 = w;
	y10 = 0;
	rt x11 = w;
	bot y11 = 0;
	x12 = w;
	bot y12 = 0;
	draw z10--z11--z12;
enddef;

beginchar (":", sqwid#, sqht#, 0); "ul square";
	ulsq;
endchar;

beginchar (";", sqwid#, sqht#, 0); "ur square";
	ulsq;
	currentpicture := currentpicture rotated 270 shifted (0, h);
endchar;

beginchar ("=", sqwid#, sqht#, 0); "lr square";
	ulsq;
	currentpicture := currentpicture rotated 180 shifted (w, h);
endchar;

beginchar ("<", sqwid#, sqht#, 0); "ll square";
	ulsq;
	currentpicture := currentpicture rotated 90 shifted (w, 0);
endchar;

def vtsq =
	pickup knot_pen;
	lft x1 = 0;
	y1 = 0;
	lft x2 = 0;
	y2 = h;
	draw z1--z2;
	pickup thin_pen;
	x3 = .2w;
	y3 = 0;
	x4 = .2w;
	y4 = h;
	draw z3--z4;
	pickup thin_pen;
	x5 = .8w;
	y5 = 0;
	x6 = .8w;
	y6 = h;
	draw z5--z6;
	pickup knot_pen;
	rt x7 = w;
	y7 = 0;
	rt x8 = w;
	y8 = h;
	draw z7--z8;
enddef;

beginchar (">", sqwid#, sqht#, 0); "vert square";
	vtsq;
endchar;

beginchar ("?", sqwid#, sqht#, 0); "horiz square";
	vtsq;
	currentpicture := currentpicture rotated 90 shifted (w, 0);
endchar;