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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
|
% blackboard typefaces by Anthony Phan.
% file: mbbdigit.mf (Arabic numerals)
% last modification: 25.10.2001.
def horizontal_rules_list=0.25h,0.5h,0.7h,
-body_depth,-desc_depth,x_height,cap_height,asc_height,body_height
enddef;
use_rule1;
if not(known old_digits): old_digits=false; fi
beginchar("0",8u#+2appr#,
if old_digits: x_height# else: fig_height# fi,0);
"The numeral 0";
italcorr if old_digits: x_height#
else: fig_height# fi *slant-.5u#;
pickup circle.nib;
bbcircle1(apprl-ho,w-apprr+ho,h+o,-o); draw last_path;
bbbowl(z1b,z1a,z1d,hThick) last_path;
bbbowl(z1b,z1c,z1d,hThick) last_path;
endchar;
beginchar("1",8u#+2appr#,
if old_digits: x_height# else: fig_height# fi,0);
"The numeral 1";
italcorr if old_digits: x_height#
else: fig_height# fi *slant-.5u#;
pickup circle.nib;
y3r=top y4=top y5=h+o;
bot y6=bot y7=0; y1r=vround(0.68h+0.5thin);
rt x5=rt x6=hround(0.5[apprl,w-apprr]+0.5(u+hthick+thin));
x6-x7=hthick; x3r=lft x4=0.25[lft x7,rt x6];
x1r=hround max(lft x7-2.3u,apprl+0.5u);
z2r=0.5[z1r,z3r]+0.08(z3r-z1r)rotated -90;
tmpp_path:=z1r...z2r{z3r-z1r}...z3r;
ortho_penpos1(thin,-direction 0 of tmpp_path);
ortho_penpos2(thin,z1r-z3r);
ortho_penpos3(thin,-direction 2 of tmpp_path);
tmp_path:=z1...z2{z3-z1}...z3;
z8=tmp_path intersectionpoint (z7..(x7,y3r));
penstroke z1e...z2e{z3e-z1e}...z3e; draw z7..z8;
pickup square.nib; draw z4--z5--z6--z7;
penlabels(1,2,3); labels(4,5,6,7,8);
endchar;
beginchar("2",8u#+2appr#,
if old_digits: x_height# else: fig_height# fi,0);
"The numeral 2";
italcorr if old_digits: x_height#
else: fig_height# fi *slant-.5u#;
pickup circle.nib;
x1l=rt x7=w-apprr+ho; x2l=lft x13=apprl; x9=x12=0.5[x13,x7];
y1l=y2l=0; bot y7=bot y13=vround 0.7h; top y12=h+o;
penpos1(thin,90); penpos2(thin,90); z3l=z2r;
adjust_slanted_bar(3l,7,4,6l)((thick+thin)/2,-1);
z5r-z4=z8r-z7=z4-z3l;
a:=diag_width(thin,z7-z4);
penpos3(a,0); penpos5(a,0); penpos6(a,0); penpos8(a,0);
numeric a,x,y;
(x,y)=(z7-z4)slanted slant; a=angle((y,-x)slanted -slant);
z9=whatever[z3,z6];
z9l=whatever[z3l,z6l]; z9l=z9+whatever*dir(a);
z9r=whatever[z3r,z6r]; z9r=z9+whatever*dir(a);
z10=whatever[z5,z8]; z10=z9+whatever*dir(a);
z10r=whatever[z5r,z8r]; z10r=z9+whatever*dir(a);
z10l=whatever[z5l,z8l]; z10l=z9+whatever*dir(a);
x7l=x7; z7l=whatever[z5,z8]; z11-z7=z9-z10;
x11l=x11; z11l=whatever[z3,z6];
penstroke z1e..z2e; penstroke z3e..z9e; penstroke z5e..z10e;
draw z9..controls 2/3[z9,z11l] and 2/3[z11,z11l]..z11 up_to_left z12;
draw z10..controls 2/3[z10,z7l] and 2/3[z7,z7l]..z7
up_to_left z12 left_to_down z13;
square_end13(down); penlabels(range 1 thru 13);
endchar;
beginchar("3",8u#+2appr#,
if old_digits: x_height#,desc_depth# else: fig_height#,0 fi);
"The numeral 3";
italcorr if old_digits: x_height#
else: fig_height# fi *slant-.5u#;
pickup circle.nib; top y2=h+o; bot y7=-d-o;
bot y4=bot y5=vround 0.5(h-d); y3=0.5[y2,y4];
bot y1=vround y3; y6=0.5[y4,y7]; top y8=0.2[-d,h];
lft x1-hround 0.2u=lft x8=apprl; rt x3=rt x6-ho=w-apprr;
x4=0.5[x8,x3]; x6-x9=hThick; x11=min(x9,x3-thin);
lft x5=hround min(apprl+2.75u,x11-1.5thin);
tmpp_path:=z5..z4 right_to_up z3 & elliptic_arc(3,2,1);
tmp_path:=z5..z4 left_to_down z6& elliptic_arc(6,7,8);
bbbowl(z4,z6,z7,hThick) tmp_path;
bbbowl(z2,z3,z4,max(0,x3-x.bowl.mid)) tmpp_path;
draw tmp_path; draw tmpp_path;
square_end1(z1-z1');
square_end5(left);
square_end8(z8-z8');
penlabels(range 1 thru 8,8');
endchar;
beginchar("4",8u#+2appr#,
if old_digits: x_height#,desc_depth# else: fig_height#,0 fi);
"The numeral 4";
italcorr if old_digits: x_height#
else: fig_height# fi *slant-.5u#;
pickup circle.nib;
rt x2=w-apprr-hround u; top y2=h+o; x3=x2=lft x7;
bot y7=if old_digits:0 else: vround 0.25h fi;
bot y3=-d; y4=y3; x4=x3-hthick; x5=rt x8=x4; y8=y7=y9=y6;
rt x6=w-apprr+hround 0.5u; lft x9=x10l=apprl-hround 0.5u;
x11l=0.25[lft x4,rt x3]; y10l=top y9; y11l=top y2;
a:=diag_width(thin,z11l-z10l);
penpos10(a,0); penpos11(a,0); z1r=z11; penpos2(thin,90);
z1l=whatever[z10,z11]; y1l=y2l; z5=whatever[z10,z11];
draw z5..z4; penstroke z10e..z11e; penstroke z1e..z2e;
pickup square.nib; draw z2--z3--z4; draw z6--z7; draw z8--z9;
penlabels(range 1 thru 11);
endchar;
beginchar("5",8u#+2appr#,
if old_digits: x_height#,desc_depth# else: fig_height#,0 fi);
"The numeral 5";
italcorr if old_digits: x_height#
else: fig_height# fi *slant-.5u#;
penpos6(thin,-90);
pickup circle.nib;
top y1=top y2=top y10=h;
top y6=x_height-d; bot y8=-d-o;
top y9=0.2[-d,h]; y7=0.5[y8,y6];
bot y3=bot y4=y5r=min(vround 0.5(h-d),bot y6);
lft x9=apprl; rt x1=w-apprr-hround 0.3u;
rt x7=w-apprr+ho; lft x2=lft x3=apprl+hround 0.3u;
x10-x2=hthick;
tmp_path:=elliptic_arc(7,8,9);
x4=0.5[x3,x10]; x6=max(0.4[x4,x7],x8);
x5r=x4+0.5thin*((1++slant)-slant);
z0=(z6r-z5r) xscaled 1/3;
ortho_penpos5(thin,z0);
tmp_path:=z3--z4--z5{z0}...z6
right_to_down z7 & tmp_path;
z11=tmp_path intersectionpoint (z10..(x10,y3));
bbbowl(z6,z7,z8,hThick) tmp_path;
draw subpath (3,infinity) of tmp_path; draw z10..z11;
penstroke z5e{z0}...z6e{right};
pickup square.nib; draw z1--z2--z3--z4;
square_end9(z9-z9');
labels(1,2,3,4,7,8,9,9',10,11);
penlabels(5,6);
endchar;
beginchar("6",8u#+2appr#,fig_height#,0);
"The numeral 6";
italcorr fig_height#*slant-.5u#;
numeric t;
pickup circle.nib; top y2=h+o;
bot y1=min(0.095[h,-d],bot y2-1); bot y4=-d-o;
top y6=x_height-d; y3=0.5[y2,y4]; y5=y7=0.5[y4,y6];
rt x1=w-apprr-0.74u; lft x3=lft x7=apprl-ho;
rt x5=w-apprr+ho; x4=x6=0.5[x3,x5];
tmp_path:=reverse elliptic_arc(3,2,1)
& z3 down_to_right z4 right_to_up z5
up_to_left z6 left_to_down z7;
bbbowl(z2,z3,z4,hThick) tmp_path;
t=8+xpart(subpath (8,12) of tmp_path intersectiontimes bowl_path);
bbbowl(z6,z5,z4,hThick) tmp_path;
draw subpath (0,t) of tmp_path;
square_end1(z1-z1');
labels(1,1',2,3,4,5,6,7);
endchar;
beginchar("7",8u#+2appr#,
if old_digits: x_height#,desc_depth# else: fig_height#,0 fi);
"The numeral 7";
italcorr if old_digits: x_height#
else: fig_height# fi *slant-.5u#;
y1r=y2r=h; x1r=apprl; x2r=w-apprr+hround 0.75u;
penpos1(thin,90); penpos2(thin,90);
z3r=z2l; y6l=y4r=-d; y5l=y3r; x3r-x4r=hround 4.25u;
numeric a;
a=diag_width(1,z3r-z4r);
x4r-x6l=x3r-x5l=(thick+thin)*a;
penpos3(thin*a,0); penpos4(thin*a,0);
penpos5(thin*a,0); penpos6(thin*a,0);
y4a-y4=thin; z4a=whatever[z3,z4]; z6a-z6=z4a-z4;
penstroke z1e..z2e; penstroke z3e..z4e;
penstroke z5e..z6e; fill z4a--z6a--z6--z4--cycle;
penlabels(range 1 thru 8); labels(4a,6a);
endchar;
beginchar("8",8u#+2appr#,fig_height#,0);
"The numeral 8";
italcorr fig_height#*slant-.5u#;
pickup circle.nib;
rt z1=(w-apprr,0.5[y4,y2]); top z2=(0.5[x1,x3],h+o); lft z3=(apprl,y1);
bot z4=(x2,vround 0.5(h-d));
rt z5=(w-apprr+ho,0.5[y7,y4]); bot z7=(x2,-d-o); lft z6=(apprl-ho,y5);
tmpp_path:=superellipse(z1,z2,z3,z4,superness);
tmp_path:=superellipse(z5,z4,z6,z7,superness);
bbbowl(z4,z6,z7,hThick) tmp_path;
bbbowl(z2,z3,z4,max(0,x.bowl.mid-x3)) tmpp_path;
bbbowl(z4,z5,z7,hThick) tmp_path;
bbbowl(z2,z1,z4,max(0,x1-x.bowl.mid)) tmpp_path;
draw tmpp_path; draw tmp_path;
labels(1,2,3,4,5,6,7);
endchar;
beginchar("9",8u#+2appr#,
if old_digits: x_height#,desc_depth# else: fig_height#,0 fi);
"The numeral 9";
italcorr if old_digits: x_height#
else: fig_height# fi *slant-.5u#;
numeric t;
pickup circle.nib; bot y2=-d-o;
top y1=max(0.095[-d,h],top y2+1); top y4=h+o;
bot y6=h-x_height; y3=0.5[y2,y4]; y5=y7=0.5[y4,y6];
lft x1=apprl+0.74u; rt x3=rt x7=w-apprr+ho;
lft x5=apprl-ho; x4=x6=0.5[x3,x5]; x3-x8=x10-x5=hThick;
tmp_path:=reverse elliptic_arc(3,2,1)
& z3 up_to_left z4 left_to_down z5
down_to_right z6 right_to_up z7;
bbbowl(z4,z3,z2,hThick) tmp_path;
t=8+xpart(subpath (8,12) of tmp_path intersectiontimes bowl_path);
bbbowl(z4,z5,z6,hThick) tmp_path;
draw subpath (0,t) of tmp_path;
square_end1(z1-z1');
labels(1,1',2,3,4,5,6,7);
endchar;
|