Debian Codegraph @

texmf-dist/fonts/source/public/bbm/blbordu.mf

raw
1 % Copyright 1993 Gilles F. Robert.
2 % You may freely use, modify and/or distribute this file.
3 % This statement added 2008/11/14 by Clea F. Rees on the basis of the email exchange archived at http://lists.debian.org/debian-tex-maint/2008/05/msg00040.html.
4 %
5 % Computer Modern Blackboard upper case:
6 % Was romanu.mf; modified for blackboard letter
7 % Gilles F. ROBERT (29-03-93) v1.0
8
9 % These letters were originally coded by D. E. Knuth in November, 1979,
10 % inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
11 % Sans serif designs by Richard Southall were added in April, 1982.
12 % The programs were revised for the new \MF\ conventions in 1985.
13 % modified March 93 by Gilles F. ROBERT for blackboard letters
14
15 % Character codes \0101 through \0132 are generated.
16
17 cmchar "The letter A";
18 beginchar("A",13u#,cap_height#,0);
19 adjust_fit(cap_serif_fit#,cap_serif_fit#);
20 numeric left_stem,right_stem,outer_jut,alpha;
21 right_stem=cap_stem-stem_corr;
22 left_stem=max(min(cap_hair if hefty: -3stem_corr fi,.5right_stem),tiny);
23 pen_duplicate(1,2);
24 outer_jut=.8cap_jut; x.G1l=w-x4r=l+letter_fit+outer_jut+.5u; y1=y4=0;
25 x2-x1=x4-x3; x3r=x.D2r+apex_corr; y2=y3=h+apex_o+apex_oo;
26 alpha=diag_ratio(2,left_stem+cap_interspace,y2-y1,x4r-x.G1l-apex_corr);
27 penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
28 penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
29 Delta_x = hround(alpha*(cap_interspace+left_stem));
30 z0=whatever[z.D1r,z.D2r]=whatever[z3l,z4l];
31 if y0<h-cap_notch_cut: y0:=h-cap_notch_cut;
32 fill z0+.5right{down}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
33 --diag_end(4r,3r,1,1,D2l,D1l)--diag_end(D2l,D1l,1,1,D1r,D2r){z2-z1}
34 ...{up}z0+.5left--cycle; % left and right diagonals
35 else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,D2l,D1l)
36 --diag_end(D2l,D1l,1,1,D1r,0)--cycle; fi % left and right diagonals
37 fill diag_end(G2l,G1l,1,1,G1r,G2r)--diag_end(G1r,G2r,1,1,G2l,G1l)--cycle; % left outer diagonal
38 penpos5(whatever,angle(z2-z1)); z5=whatever[z.D1,z.D2];
39 penpos6(whatever,angle(z3-z4)); z6=whatever[z3,z4]; y6=y5;
40 if hefty: y5r else: y5 fi =5/12y0;
41 y5r-y5l=y6r-y6l=cap_band; penstroke z5e--z6e; % bar line
42 if serifs: numeric inner_jut; pickup tiny.nib;
43 prime_points_inside(1,2); prime_points_inside(4,3);
44 prime_points_inside(2,1); pen_duplicate(1',2');
45 if rt x.D1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
46 else: rt x.D1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
47 dish_biserif(1',2,a,1/2,outer_jut,ab,1/2,b,.6,inner_jut)(dark); % left serif
48 mid_biserif(2',1,ab',1/2); % upper terminal
49 dish_serif(4',3,c,1/2,inner_jut,d,1/3,outer_jut); % right serif
50 else: mid_biserif(1,2,ab,1/3)(dark); % lower terminal
51 mid_biserif(2,1,ab',1/2); fi % upper terminal
52 penlabels(0,G1,D1,G2,D2,3,4,5,6); endchar;
53
54 cmchar "The letter B";
55 beginchar("B",12.5u#,cap_height#,0);
56 italcorr .75cap_height#*slant-.5u#;
57 adjust_fit(cap_serif_fit#,0);
58 numeric left_stem,right_curve,middle_weight;
59 left_stem=.5cap_stem-hround stem_corr; middle_weight=.6vair+.5;
60 pen_duplicate(1,2);
61 pickup tiny.nib; pos1(left_stem,0); pos2(left_stem,0);
62 Delta_x = hround(cap_interspace+left_stem);
63 lft x.G1l=lft x.G2l=hround max(2u,3u-left_stem); top y1=h; bot y2=0;
64 double filldraw stroke z1e--z2e; % double stem
65 penpos3(cap_band,90); penpos4(cap_band,90);
66 penpos6(middle_weight,-90); penpos7(middle_weight,-90);
67 penpos8(middle_weight,90); penpos9(middle_weight,90);
68 penpos5(right_curve-stem_corr,0); penpos10(right_curve,0);
69 penpos11(cap_band,-90); penpos12(cap_band,-90);
70 z3r=top z.G1; y4=y3; y5=.5[y4,y6]; y6=y7; y7l-y8l=vair;
71 z12r=bot z.G2; y11=y12; y10=.5[y11,y9]; y8=y9; .5[y7l,y8l]=.52h;
72 x4=x6; x9=x11=x4+.5u; x7=x8=x.D1; x9l:=x4+.25u;
73 x5r=hround(w-1.5u); x10r=hround(w-u);
74 if serifs: right_curve=cap_curve-stem_corr; x4=.5[x.G1,w-1.5u];
75 else: right_curve=cap_curve-3stem_corr; x4=.5[x.G1,w-2.5u];
76 x4l:=x4l-.5u; x9l:=x9l-.5u; fi
77 x6l:=x6l-.5u; x11l:=x11l-.5u;
78 fill stroke z3e..super_arc.e(4,5) & super_arc.e(5,6)..z7e; % upper lobe
79 fill stroke z8e..super_arc.e(9,10) & super_arc.e(10,11)..z12e; % lower lobe
80 if serifs: nodish_biserif(1,2,a,1/3,cap_jut,ab,1/3,b,1/3,.5cap_jut); % upper serif
81 nodish_biserif(2,1,c,1/3,cap_jut,cd,1/3,d,1/3,.5cap_jut); fi % lower serif
82 math_fit(0,.5ic#); penlabels(G1,D1,G2,D2,3,4,5,6,7,8,9,10,11,12); endchar;
83
84 cmchar "The letter C";
85 if serifs: beginchar("C",13u#,cap_height#,0);
86 italcorr cap_height#*slant-.5u#;
87 adjust_fit(0,0);
88 pickup fine.nib; pos1(cap_hair,0); pos2(cap_band,90);
89 pos3(hround(.5cap_curve),180); pos4(cap_band,270); pos5(hair,360);
90 pen_duplicate(3);
91 rt x1r=rt x5r=hround(w-u); lft x.G3r=hround u; x2=x4=.55[x.G3,x1];
92 top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
93 bot y1=min(vround max(.6h,x_height-.5vair),bot y2l-eps);
94 y5=max(good.y .95(h-y1),y4l+eps);
95 (x2l',y2l)=whatever[z2r,z1l]; x2l:=min(x2l',x2l+.5u);
96 (x4l',y4l)=whatever[z4r,z5l]; x4l:=min(x4l',x4l+.5u);
97 filldraw stroke z1e{x2-x1,10(y2-y1)}
98 ...pulled_arc.e(2,G3) & pulled_arc.e(G3,4)...{up}z5e; % exterior arc
99 Delta_x = min(hround(cap_curve_interspace+.5cap_curve),x4r-x.G3l);
100 define_upper_and_lower(D2,D4,D3,pulled_arc.r(2,G3) & pulled_arc.r(G3,4));
101 pos6(.3[fine.breadth,cap_hair],0); x6r=x1r; top y6=h+o;
102 x1r-x1'=2cap_curve-fine; y1'=y1;
103 path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..z2{left};
104 numeric t; t=xpart(upper_arc intersectiontimes (z6l--z1'));
105 filldraw z1r--z6r--z6l--subpath(t,0) of upper_arc--cycle; % barb
106 else: beginchar("C",11.5u#,cap_height#,0);
107 italcorr cap_height#*slant-.5u#;
108 adjust_fit(0,0);
109 pickup fine.nib; pos1(1.2flare,80); pos2(slab,90);
110 pos3(.5cap_curve,180); pos4(slab,270); pos5(flare,275);
111 pen_duplicate(3);
112 rt x1r=hround(w-1.1u); x2=x4=.5w+1.25u;
113 lft x.G3r=hround max(u,2u-.5cap_curve); rt x5r=hround(w-.9u);
114 top y1r=vround .95h+o; top y2r=h+o; y3=.5h;
115 bot y4r=-o; bot y5r=vround .08h-o; y5l:=good.y y5l; x5l:=good.x x5l;
116 filldraw stroke rterm.e(2,1,right,.9,4) & super_arc.e(2,G3)
117 & super_arc.e(G3,4) & term.e(4,5,right,.8,4); % exterior arc and terminals
118 Delta_x = min(hround(cap_curve_interspace+.5cap_curve),x4r-x.G3l);
119 define_upper_and_lower(D2,D4,D3,super_arc.r(2,G3) & super_arc.r(G3,4)); fi
120 filldraw stroke z.D2e--z.D4e; % inner stroke
121 math_fit(-.3cap_height#*slant-.5u#,.5ic#);
122 penlabels(1,1',2,G3,4,D2,D3,D4,5,6); endchar;
123
124 cmchar "The letter D";
125 beginchar("D",13.5u#,cap_height#,0);
126 italcorr .7cap_height#*slant-.5u#;
127 adjust_fit(cap_serif_fit#,0);
128 pen_duplicate(1,2);
129 pickup tiny.nib; pos1(.5cap_stem',0); pos2(.5cap_stem',0);
130 lft x.G1l=lft x.G2l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
131 Delta_x = hround(cap_interspace+.5cap_stem');
132 double filldraw stroke z1e--z2e; % double stem
133 penpos3(cap_band,90); penpos4(cap_band,90);
134 penpos5(cap_curve-stem_corr,0);
135 penpos6(cap_band,-90); penpos7(cap_band,-90);
136 z3r=top z.G1; y4=y3; y5=.51[y4,y6]; y6=y7;
137 z7r=bot z.G2; x4=x6=.5w+.25u; x5r=hround(w-u);
138 x4l:=x6l:=x4-.25cap_curve;
139 fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe
140 if serifs: nodish_biserif(1,2,a,1/3,cap_jut,ab,1/3,b,1/3,.5cap_jut); % upper serif
141 nodish_biserif(2,1,c,1/3,cap_jut,cd,1/3,d,1/3,.5cap_jut); fi % lower serif
142 math_fit(0,ic#-.5u#); penlabels(G1,D1,G2,D2,3,4,5,6,7); endchar;
143
144 cmchar "The letter E";
145 beginchar("E",12u#-width_adj#,cap_height#,0);
146 italcorr cap_height#*slant-beak_jut#-.5u#;
147 adjust_fit(cap_serif_fit#,0);
148 h:=vround(h-stem_corr);
149 pen_duplicate(1,2);
150 pickup tiny.nib; pos1(.5cap_stem,0); pos2(.5cap_stem,0);
151 Delta_x = hround(cap_interspace+.5cap_stem);
152 lft x.G1l=lft x.G2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
153 double filldraw stroke z1e--z2e; % double stem
154 pickup crisp.nib; pos3(slab,90); pos4(hair,0);
155 top y3r=h; x3=x.G1; rt x4r=hround(w-u); y4=good.y(y3l-beak)-eps;
156 arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak
157 pos5(cap_bar,-90); pos6(hair,0);
158 top y5l=vround(.52[y2,y1]+.5cap_bar); x5=x.D1;
159 pos0(cap_bar,90); pos7(hair,0);
160 z0=z5; x6=x7; y6-y5l=y0l-y7;
161 if serifs: rt x6r=hround(w-4.4u+.5hair); y6=good.y(y5l+.6beak)+eps;
162 rt x9r=hround(w-.5u);
163 else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
164 arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0); % middle arm and serif
165 pos8(slab if not serifs:+2stem_corr fi,-90); pos9(hair,0);
166 bot y8r=0; x8=x.G2; y9=good.y(y8l+7/6beak)+eps;
167 arm(8,9,h,beak_darkness,1.5beak_jut); % lower arm and beak
168 if serifs: nodish_biserif(1,2,a,1/3,cap_jut,ab,1/3,b,1/3,.5cap_jut); % upper serif
169 nodish_biserif(2,1,c,1/3,cap_jut,cd,1/3,d,1/3,.5cap_jut); fi % lower serif
170 math_fit(0,.5ic#); penlabels(0,G1,D1,G2,D2,3,4,5,6,7,8,9); endchar;
171
172 cmchar "The letter F";
173 beginchar("F",11.5u#-width_adj#,cap_height#,0);
174 italcorr cap_height#*slant-beak_jut#-.25u#;
175 adjust_fit(cap_serif_fit#,0);
176 h:=vround(h-stem_corr);
177 pen_duplicate(1,2);
178 pickup tiny.nib; pos1(.5cap_stem,0); pos2(.5cap_stem,0);
179 Delta_x = hround(cap_interspace+.5cap_stem);
180 lft x.G1l=lft x.G2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
181 double filldraw stroke z1e--z2e; % double stem
182 pickup crisp.nib; pos3(slab,90); pos4(hair,0);
183 top y3r=h; x3=x.G1; rt x4r=hround(w-.75u); y4=good.y(y3l-beak)-eps;
184 arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak
185 pos5(cap_bar,-90); pos6(hair,0);
186 top y5l=vround(.5[y2,y1]+.5cap_bar); x5=x.D1;
187 pos0(cap_bar,90); pos7(hair,0);
188 z0=z5; x6=x7; y6-y5l=y0l-y7;
189 if serifs: rt x6r=hround(w-4u+.5hair); y6=good.y(y5l+.6beak)+eps;
190 rt x9r=hround(w-.5u);
191 else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
192 arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0); % middle arm and serif
193 if serifs: nodish_biserif(1,2,a,1/3,cap_jut,ab,1/3,b,1/3,.5cap_jut); % upper serif
194 dish_biserif(2,1,c,1/3,cap_jut,cd,1/3,d,1/3,1.25cap_jut); % lower serif
195 else: mid_biserif(2,1,cd,1/3); fi % lower terminal
196 math_fit(0,ic#-2.5u#); penlabels(0,G1,D1,G2,D2,3,4,5,6,7,8,9); endchar;
197
198 cmchar "The letter G";
199 if serifs: beginchar("G",14u#,cap_height#,0);
200 italcorr cap_height#*slant-1.5u#-.5cap_serif_fit#;
201 adjust_fit(0,.5cap_serif_fit#);
202 pickup tiny.nib; pos0(cap_stem,0); pos7(cap_stem,0);
203 rt x0r=hround(w-2u); y0=good.y(.1[bar_height,x_height]+1); x7=x0;
204 pickup fine.nib;
205 if hefty: bot y7=0; pos5(cap_stem,0); x5=x0; top y5=tiny.top y0;
206 else: pos5(cap_hair,0); pos8(cap_stem,0);
207 y7=.5bar_height; z5l=z8l; z8=z7; x9=x8r; bot y9=0;
208 filldraw z8l{down}..{4(x9-x8),y9-y8}z9--z8r--cycle; fi % spur
209 pos1(cap_hair,0); pos2(cap_band,90);
210 pos3(hround(.5cap_curve),180); pos4(cap_band,270);
211 pen_duplicate(3);
212 rt x1r=hround(w-2u); lft x.G3r=hround u; x2=x4=.55[x.G3,x1];
213 top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
214 bot y1=min(vround max(.6h,x_height-.5vair),bot y2l-eps);
215 (x2l',y2l)=whatever[z2r,z1l]; x2l:=min(x2l',x2l+.5u);
216 (x4l',y4l)=whatever[z4r,z5l]; x4l:=min(x4l',x4l+.5u);
217 filldraw stroke z1e{x2-x1,10(y2-y1)}
218 ...pulled_arc.e(2,G3) & pulled_arc.e(G3,4)...z5e{up}; % arc
219 Delta_x = min(hround(cap_curve_interspace+.5cap_curve),x4r-x.G3l);
220 define_upper_and_lower(D2,D4,D3,pulled_arc.r(2,G3) & pulled_arc.r(G3,4));
221 filldraw stroke z.D2e--z.D4e; % inner stroke
222 pos6(.3[fine.breadth,cap_hair],0); x6r=x1r; top y6=h+o;
223 x1r-x1'=2cap_curve-fine; y1'=y1;
224 path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..z2{left};
225 numeric t; t=xpart(upper_arc intersectiontimes (z6l--z1'));
226 filldraw z1r--z6r--z6l--subpath(t,0) of upper_arc--cycle; % barb
227 pickup tiny.nib; filldraw stroke z0e--z7e; % stem
228 dish_serif(0,7,a,1/3,max(cap_jut,2.25u),b,1/3,1.25u); % serif
229 math_fit(-.3cap_height#*slant-.5u#,ic#);
230 else: beginchar("G",12u#,cap_height#,0);
231 italcorr cap_height#*slant-.5u#;
232 adjust_fit(0,0);
233 pen_duplicate(3);
234 pickup fine.nib; pos1(1.2flare,80); pos2(slab,90);
235 pos3(hround(.75cap_curve),180); pos4(slab,270); pos5(flare,270);
236 rt x1r=hround(w-1.35u); x2=x4=.5w+u;
237 lft x.G3r=hround max(u,2u-.5cap_curve); rt x5l=hround(w-1.2u);
238 top y1r=vround .93h+o; top y2r=h+o; y3=.5h;
239 bot y4r=-o; bot y5r=vround .07h-o;
240 filldraw stroke rterm.e(2,1,right,.9,4)&super_arc.e(2,G3)
241 & super_arc.e(G3,4) & term.e(4,5,right,1,4); % arc and terminals
242 Delta_x = min(hround(cap_curve_interspace+.5cap_curve),x4r-x.G3l);
243 define_upper_and_lower(D2,D4,D3,super_arc.r(2,G3) & super_arc.r(G3,4));
244 filldraw stroke z.D2e--z.D4e; % inner stroke
245 pos0(stem,0); pos7(stem,0);
246 z7r=z5r; x0=x7; top y0=1+vround .35[bar_height,x_height];
247 filldraw stroke z0e--z7e; % stem
248 pos8(cap_bar,90); pos9(cap_bar,90);
249 z0r=z9r; y8=y9; lft x8=hround x4;
250 filldraw stroke z8e--z9e; % bar
251 math_fit(-.3cap_height#*slant-.5u#,.5ic#); fi
252 penlabels(0,1,1',2,G3,4,D2,D3,D4,5,6,7,8,9); endchar;
253
254 cmchar "The letter H";
255 beginchar("H",13u#+width_adj#,cap_height#,0);
256 italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
257 adjust_fit(cap_serif_fit#,cap_serif_fit#);
258 pen_duplicate(1,2);
259 pickup tiny.nib; pos1(.5cap_stem,0); pos2(.5cap_stem,0);
260 pos3(cap_stem,0); pos4(cap_stem,0);
261 Delta_x = hround(cap_interspace+.5cap_stem);
262 lft x.G1l=lft x.G2l=hround max(2u,3u-.5cap_stem); x3r=x4r=w-x.G1l;
263 top y1=top y3=h; bot y2=bot y4=0;
264 double filldraw stroke z1e--z2e; % left (double) stem
265 filldraw stroke z3e--z4e; % right stem
266 penpos5(cap_bar,90); penpos6(cap_bar,90);
267 x5=x.D1; x6=x3; y5=y6=.52h;
268 fill stroke z5e--z6e; % bar
269 if serifs: numeric inner_jut;
270 if rt x.D1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
271 else: rt x.D1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
272 dish_biserif(1,2,a,1/3,cap_jut,ab,1/3,b,1/3,inner_jut); % upper left serif
273 dish_biserif(2,1,c,1/3,cap_jut,cd,1/3,d,1/3,inner_jut); % lower left serif
274 dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut); % upper left serif
275 dish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut); % lower left serif
276 else: mid_biserif(1,2,ab,1/3); % upper left terminal
277 mid_biserif(2,1,cd,1/3); fi % lower left terminal
278 math_fit(0,.5ic#); penlabels(G1,D1,G2,D2,3,4,5,6); endchar;
279
280 cmchar "The letter I";
281 beginchar("I",max(6u#,4u#+cap_stem#),cap_height#,0);
282 italcorr cap_height#*slant-.25u#;
283 adjust_fit(cap_serif_fit#,cap_serif_fit#);
284 pen_duplicate(1,2);
285 pickup tiny.nib; pos1(.5cap_stem,0); pos2(.5cap_stem,0);
286 Delta_x = hround(cap_interspace+.5cap_stem);
287 lft x.G1l=lft x.G2l=hround(.5w-.5cap_stem-.5cap_interspace); top y1=h; bot y2=0;
288 double filldraw stroke z1e--z2e; % double stem
289 if serifs: dish_biserif(1,2,a,1/3,1.05cap_jut,ab,1/3,b,1/3,1.05cap_jut); % upper serif
290 dish_biserif(2,1,c,1/3,1.05cap_jut,cd,1/3,d,1/3,1.05cap_jut); % lower serif
291 else: mid_biserif(1,2,ab,1/3); % upper terminal
292 mid_biserif(2,1,cd,1/3); fi % lower terminal
293 math_fit(0,.5ic#); labels(G1,D1,G2,D2); endchar;
294
295 cmchar "The letter J";
296 beginchar("J",9u#,cap_height#,0);
297 italcorr cap_height#*slant-cap_serif_fit#
298 +.75cap_jut#-2.5u#+min(.5cap_stem#,u#);
299 adjust_fit(0,cap_serif_fit#);
300 pen_duplicate(1,2);
301 pickup tiny.nib; pos1(.5cap_stem',0); pos2(.5cap_stem',0);
302 top y1=h; rt x.D1r=hround(w-2u); x2=x1; y2=.21h;
303 if serifs: pos3(vair,-90); pos4(cap_hair,-180);
304 pos5(flare+(cap_stem-stem),-180);
305 bot y3r=-o; x3=.5[x4,x.D2]; y5=1/6h; rt x5l=hround 2.75u; z5r=z4r;
306 filldraw stroke z.D1e--z.D2e&super_arc.e(D2,3); % stem and arc
307 Delta_x = min(hround(cap_interspace+.5cap_stem'),x.D2l-x3r);
308 define_lower(G3,G2,super_arc.r(D2,3));
309 filldraw stroke z.G1e--z.G3e; % left (inner) stroke
310 dish_biserif(1,2,a,1/3,1.3cap_jut,ab,1/3,b,1/3,.75cap_jut); % serif
311 pickup tiny.nib; bulb(3,4,5); % bulb
312 else: pen_duplicate(3);
313 pickup fine.nib; pos3(.5cap_stem',0); z3=z2;
314 pos4(flare,angle(6.5u,-h)); pos5(1.1flare,-100);
315 bot y4r=-o; x4r=.5[x5r,x.D3r]; lft x5r=hround.75u; bot y5r=vround.06h-o;
316 filldraw stroke z.D3e{down}....term.e(4,5,left,1,4); % arc and terminal
317 Delta_x = min(hround(cap_interspace+.5cap_stem'),x.D2l-x5l);
318 define_lower(G4,G3,z.D3r{down}....term.r(4,5,left,1,4));
319 filldraw stroke z.G3e--z.G4e; % left (inner) stroke
320 pickup tiny.nib; double filldraw stroke z1e--z2e; % double stem
321 mid_biserif(1,2,ab,1/3); fi % terminal
322 math_fit(0,.5ic#-.5u#); penlabels(G1,D1,G2,D2,D3,G3,4,G4,5); endchar;
323
324 cmchar "The letter K";
325 beginchar("K",13.5u#,cap_height#,0);
326 italcorr cap_height#*slant-.5u#;
327 adjust_fit(cap_serif_fit#,cap_serif_fit#);
328 numeric right_jut,stem[],alpha[];
329 if serifs: right_jut=.6cap_jut;
330 else: right_jut=.4tiny; fi
331 pen_duplicate(1,2);
332 pickup tiny.nib; pos1(.5fudged.cap_stem,0); pos2(.5fudged.cap_stem,0);
333 Delta_x = hround(cap_interspace+.5fudged.cap_stem);
334 lft x.G1l=lft x.G2l=hround max(2u,3u-.5fudged.cap_stem); top y1=h; bot y2=0;
335 double filldraw stroke z1e--z2e; % double stem
336 stem2=max(tiny.breadth,fudged.cap_stem-3stem_corr);
337 stem1=max(tiny.breadth,fudged.hair if hefty:-3stem_corr fi);
338 top y3=h; rt x3r=hround(r-letter_fit-u-right_jut);
339 bot y6=0; rt x6r=hround(r-letter_fit-.75u-right_jut);
340 x4=x.D1; y4=1/3h;
341 alpha1=diag_ratio(1,.5(stem1-tiny),y3-y4,x3r-x4);
342 penpos3(alpha1*(stem1-tiny),0); penpos4(whatever,-90);
343 alpha2=diag_ratio(1,.5(stem2-tiny),y1-y6,x6r-x.D1);
344 penpos6(alpha2*(stem2-tiny),0);
345 forsuffixes $=l,r: y3'$=h; y6'$=0; z4$=z3'$+whatever*(z3-z4);
346 z5$=z6'$+whatever*(z1-z6)=whatever[z3,z4]; endfor
347 z5=.5[z5l,z5r];
348 z3'r=z3r+penoffset z3-z4 of currentpen+whatever*(z3-z4);
349 % we have also |z3'l=z3l+penoffset z4-z3 of currentpen+whatever*(z3-z4)|;\]
350 z6'r=z6r+penoffset z.D1-z6 of currentpen+whatever*(z1-z6);
351 z6'l=z6l+penoffset z6-z.D1 of currentpen+whatever*(z1-z6);
352 fill z4r--diag_end(4r,3'r,1,.5,3'l,4l)--z4l--cycle; % upper diagonal
353 fill z5l--diag_end(5l,6'l,.5,1,6'r,5r)--z5r--cycle; % lower diagonal
354 if serifs: numeric inner_jut;
355 if rt x.D2r+cap_jut+.5u+1<=lft x6l-cap_jut: inner_jut=cap_jut;
356 else: rt x.D2r+cap_jut+.5u+1=lft x6l-inner_jut; fi
357 dish_biserif(1,2,a,1/3,cap_jut,ab,1/3,b,1/3,cap_jut); % upper stem serif
358 dish_biserif(2,1,c,1/3,cap_jut,cd,1/3,d,1/3,cap_jut); % lower stem serif
359 dish_serif(3,4,e,2/3,1.2cap_jut,f,1/2,right_jut)(dark); % upper diagonal serif
360 dish_serif(6,5,g,1/2,inner_jut,h,1/3,right_jut)(dark); % lower diagonal serif
361 else: mid_biserif(1,2,ab,1/3); % upper stem terminal
362 mid_biserif(2,1,cd,1/3); fi % lower stem terminal
363 math_fit(0,.5ic#); penlabels(G1,D1,G2,D2,3,4,5,6); endchar;
364
365 cmchar "The letter L";
366 beginchar("L",11u#-width_adj#,cap_height#,0);
367 adjust_fit(cap_serif_fit#,0);
368 pen_duplicate(1,2);
369 pickup tiny.nib; pos1(.5cap_stem,0); pos2(.5cap_stem,0);
370 Delta_x = hround(cap_interspace+.5cap_stem);
371 lft x.G1l=lft x.G2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
372 double filldraw stroke z1e--z2e; % double stem
373 pickup crisp.nib; pos3(slab,-90); pos4(hair,0);
374 bot y3r=0; x3=x.G2; y4=y3l+7/6beak+eps; rt x4r=hround(w-.75u);
375 arm(3,4,e,1.2beak_darkness,beak_jut); % lower arm and beak
376 if serifs: dish_biserif(1,2,a,1/3,cap_jut,ab,1/3,b,1/3,1.25cap_jut); % upper serif
377 nodish_biserif(2,1,c,1/3,cap_jut,cd,1/3,d,1/3,.5cap_jut); % lower serif
378 else: mid_biserif(1,2,ab,1/3); fi % upper terminal
379 math_fit(0,u#); penlabels(G1,D1,G2,D2,3,4); endchar;
380
381 cmchar "The letter M";
382 beginchar("M",16u#+width_adj#,cap_height#,0);
383 italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
384 adjust_fit(cap_serif_fit#,cap_serif_fit#);
385 numeric stem[]; % thicknesses of the four strokes
386 stem1=hround(max(.5fudged.hair+stem_corr,tiny));
387 stem2=hround(fudged.cap_stem-4stem_corr);
388 stem3=hround(fudged.hair-stem_corr);
389 stem4=hround(fudged.cap_stem-3stem_corr);
390 if stem4<2stem1: stem4:=2stem1; fi
391 pen_duplicate(1,2);
392 pickup tiny.nib; pos1(stem1,0); pos2(stem1,0);
393 Delta_x = hround(cap_interspace+stem1);
394 pos3(stem4,0); pos4(stem4,0);
395 x1=x2; x3=x4; x.G1l=w-x3r; rt x3r=hround min(w-2u,w-3u+.5stem4);
396 top y1=top y3=h; bot y2=bot y4=0;
397 double filldraw stroke z1e--z2e; % left (double) stem
398 filldraw stroke z3e--z4e; % right stem
399 penpos5(stem2,0); penpos6(stem2,0); penpos7(stem3,0); penpos8(stem3,0);
400 x5l=x.D1; x6l=x7l; x8=lft x3l; x6-x5=x8-x7; y5=y8=h; y6=y7;
401 if hefty: y6=if monospace: vround 1/3h else: o fi;
402 numeric upper_notch,lower_notch;
403 upper_notch=h-cap_notch_cut; lower_notch=y6+cap_notch_cut;
404 x1'=rt x.D1r; z1'=whatever[z5l,z6l]; x3'=lft x3l; z3'=whatever[z7r,z8r];
405 z0=whatever[z5r,z6r]=whatever[z7l,z8l];
406 fill z5l..
407 if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
408 {z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
409 if y3'<upper_notch: ...{up}(x3'-1,upper_notch){right} fi
410 ..z8r--diag_out(8r,1,8l,7l){z7-z8}
411 if y0<=lower_notch: ..{z7-z8}z0{z5-z6}..
412 else: ...{down}(x0+.5,lower_notch)--(x0-.5,lower_notch){up}... fi
413 {z5-z6}diag_in(6r,5r,1,5l)--cycle; % diagonals
414 else: y6=0; z0=whatever[z5r,z6r]=whatever[z7l,z8l];
415 fill z5l..{z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
416 ..z8r--diag_out(8r,1,8l,7l){z7-z8}..{z7-z8}z0{z5-z6}
417 ..{z5-z6}diag_in(6r,5r,1,5l)--cycle; fi % diagonals
418 if serifs: serif(G1,G2,a,1/3,-cap_jut); mid_biserif(1,2,a',1/3); % upper left serif
419 dish_biserif(2,1,b,1/2,cap_jut,bc,1/2,c,1/2,cap_jut)(dark); % lower left serif
420 serif(3,4,d,1/3,cap_jut); % upper right serif
421 dish_serif(4,3,e,1/3,cap_jut,f,1/3,cap_jut); % lower right serif
422 else: mid_biserif(1,2,a',1/3); % upper left terminal
423 mid_biserif(2,1,bc,1/2)(dark); fi % lower left terminal
424 math_fit(0,max(.5ic#-.5u#,0));
425 penlabels(0,G1,D1,1',G2,D2,3,3',4,5,6,7,8); endchar;
426
427 cmchar "The letter N";
428 beginchar("N",13u#+width_adj#,cap_height#,0);
429 italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
430 adjust_fit(cap_serif_fit#,cap_serif_fit#);
431 numeric thin_stem,thin_stem'; thin_stem=hround(fudged.hair+stem_corr);
432 thin_stem'=hround(max(.5(fudged.hair+stem_corr),tiny+eps)); pen_duplicate(1,2);
433 pickup tiny.nib; pos1(thin_stem',0); pos2(thin_stem',0);
434 Delta_x = hround(cap_interspace+thin_stem');
435 pos3(thin_stem,0); pos4(thin_stem,0);
436 pickup tiny.nib; top y1=top y3=h; bot y2=bot y4=0;
437 x1=x2; x3=x4; x.G1l=w-x3r;
438 rt x3r=hround min(w-2u,w-3u+.5fudged.cap_stem);
439 double filldraw stroke z1e--z2e; % left (double) stem
440 filldraw stroke z3e--z4e; % right stem
441 if hefty: penpos5(fudged.cap_stem,0); penpos6(fudged.cap_stem,0);
442 if x.D1r-x.G1l<x5r-x5l: lft x5l=tiny.lft x.G1l; else: x5r=tiny.rt x.D1r; fi
443 x6r=x4; y5=h; y6=0;
444 numeric upper_notch,lower_notch;
445 upper_notch=h-cap_notch_cut; lower_notch=cap_notch_cut;
446 x1'=rt x.G1r; z1'=whatever[z5l,z6l]; x4'=lft x4l; z4'=whatever[z5r,z6r];
447 fill z5l..
448 if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
449 {z6-z5}diag_in(5l,6l,1,6r)--z6r..
450 if y4'>lower_notch: {left}(x4'-1,lower_notch){up}... fi
451 {z5-z6}diag_in(6r,5r,1,5l)--cycle; % diagonal
452 else: penpos6(whatever,90);
453 z6l=z4l;
454 if xpart((z.D1r-z.G1l) rotated (-angle(z.G1l-z6l)+90))<cap_stem-3stem_corr-tiny: z5l=z.G1l;
455 penpos5(whatever,0);
456 z7=z6l+(max(eps,cap_stem-3stem_corr-tiny),0) rotated (angle(z5l-z6l)-90);
457 z5r=z7+whatever*(z5l-z6l); z6r=z7+whatever*(z5l-z6l);
458 else: z5r=z.D1r; numeric alpha;
459 alpha=diag_ratio(1,cap_stem-3stem_corr-tiny,y5r-y6l,x6l-x5r);
460 penpos5(alpha*max(eps,cap_stem-3stem_corr-tiny),0);
461 z6r=z5r+whatever*(z5l-z6l); fi
462 %z7=z6l+(max(eps,cap_stem-3stem_corr-tiny),0) rotated (angle(z5l-z6l)-90);
463 %z5r=z7+whatever*(z5l-z6l); z6r=z7+whatever*(z5l-z6l); fi
464 filldraw stroke z5e..z6e; fi % diagonal
465 if serifs: if hefty: serif(G1,G2,a,1/3,-cap_jut);
466 mid_biserif(1,2,a',1/3); % upper left serif
467 else: serif(5,6,a,1/3,-cap_jut-x5l+x.G1l); fi % upper left serif
468 dish_biserif(2,1,b,1/2,cap_jut,bc,1/2,c,1/2,cap_jut)(dark); % lower left serif
469 dish_serif(3,4,e,1/2,cap_jut,f,1/2,cap_jut)(dark); % upper right serif
470 else: mid_biserif(1,2,a',1/3); % upper left terminal
471 mid_biserif(2,1,bc,1/2)(dark); fi % lower left terminal
472 math_fit(0,max(.5ic#-.5u#,0)); penlabels(G1,D1,1',G2,D2,3,4,4',5,6,7); endchar;
473
474 cmchar "The letter O";
475 beginchar("O",14u#-width_adj#,cap_height#,0);
476 italcorr .7cap_height#*slant-.5u#;
477 adjust_fit(0,0);
478 penpos1(vair',90); penpos3(vround(vair+1.5vair_corr),-90);
479 penpos2(hround(.5cap_curve),180); penpos4(cap_curve,0);
480 pen_duplicate(2);
481 if monospace: x.G2r=hround 1.5u;
482 interim superness:=sqrt superness; % make |"O"|, not |"0"|
483 else: x.G2r=hround u; fi
484 x4r=w-x.G2r; x1=x3=.5w; y1r=h+o; y3r=-o;
485 y2=y4=.5h-vair_corr; y2l:=y4l:=.52h;
486 penstroke pulled_super_arc.e(1,G2)(.5superpull)
487 & pulled_super_arc.e(G2,3)(.5superpull)
488 & pulled_super_arc.e(3,4)(.5superpull)
489 & pulled_super_arc.e(4,1)(.5superpull) & cycle; % bowl
490 Delta_x = min(hround(cap_curve_interspace+.5cap_curve),x1r-x.G2l) ;
491 define_upper_and_lower(D1,D3,D2,
492 pulled_super_arc.r(1,G2)(.5superpull) & pulled_super_arc.r(G2,3)(.5superpull));
493 filldraw stroke z.D1e--z.D3e; % inner stroke
494 math_fit(-.3cap_height#*slant-.5u#,ic#-.5u#); penlabels(1,G2,3,D1,D2,D3,4); endchar;
495
496 cmchar "The letter P";
497 beginchar("P",12u#,cap_height#,0);
498 italcorr .75cap_height#*slant-.5u#;
499 adjust_fit(cap_serif_fit#,0);
500 pen_duplicate(0,0',1,2);
501 pickup tiny.nib; penpos1(.5cap_stem'-tiny,0); penpos2(.5cap_stem-tiny,0);
502 pos0(.5cap_stem',0); pos0'(.5cap_stem,0);
503 Delta_x = hround(cap_interspace+.5cap_stem);
504 lft x.G1l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
505 x1l=x2l=x0l=x0'l; y.D0=y.D0'=y7;
506 penpos3(cap_band,90); penpos4(cap_band,90);
507 penpos5(cap_curve if hefty:-3stem_corr fi,0);
508 penpos6(.5[vair,cap_band],-90); penpos7(.5[vair,cap_band],-90);
509 z3r=top z.G1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
510 x7=x.D2; y7l=vround .5h; x4=x6=.5w+.75u; x5r=hround(w-u);
511 x4l:=x6l:=x4-.25cap_curve;
512 double filldraw stroke z1e--z0e--z0'e--z2e; % double stem
513 fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe
514 if serifs: nodish_biserif(1,0,a,1/3,cap_jut,ab,1/3,b,1/3,.5cap_jut); % upper serif
515 dish_biserif(2,0',c,1/3,cap_jut,cd,1/3,d,1/3,cap_jut); % lower serif
516 else: mid_biserif(2,0',cd,1/3); fi % lower terminal
517 math_fit(0,ic#-2.5u#); penlabels(G0,D0,G1,D1,G2,D2,3,4,5,6,7); endchar;
518
519 cmchar "The letter Q";
520 beginchar("Q",14u#-width_adj#,cap_height#,comma_depth#);
521 italcorr .7cap_height#*slant-.5u#;
522 adjust_fit(0,0);
523 numeric light_curve; light_curve=cap_curve-hround stem_corr;
524 penpos1(vair',90); penpos3(vair',-90);
525 penpos2(hround(.5light_curve),180); penpos4(light_curve,0);
526 pen_duplicate(2);
527 if monospace: x.G2r=hround 1.5u;
528 interim superness:=sqrt superness; % make |"Q"| like |"O"|
529 else: x.G2r=hround u; fi
530 x4r=w-x.G2r; x1=x3=.5w; y1r=h+o; y2=y4=.5h-vair_corr; y3r=-o;
531 penstroke pulled_super_arc.e(1,G2)(.5superpull)
532 & pulled_super_arc.e(G2,3)(.5superpull)
533 & pulled_super_arc.e(3,4)(.5superpull)
534 & pulled_super_arc.e(4,1)(.5superpull) & cycle; % bowl
535 Delta_x = min(hround(cap_curve_interspace+.5cap_curve),x1r-x.G2l) ;
536 define_upper_and_lower(D1,D3,D2,
537 pulled_super_arc.r(1,G2)(.5superpull) & pulled_super_arc.r(G2,3)(.5superpull));
538 filldraw stroke z.D1e--z.D3e; % inner stroke
539 pickup tiny.nib;
540 if hefty: penpos5(1.2(.5[cap_bar,light_curve]),0); penpos6(1.2light_curve,0);
541 x5=.5w; x6r=hround(w-1.5u);
542 y5=vround .28h; y6=-d;
543 fill diag_end(6r,5r,.25,1,5l,6l)--diag_end(5l,6l,.5,1,6r,5r)--cycle; % tail
544 else: pos3'(vair,270); pos5(vair,180); pos6(vair,90);
545 pos7(cap_curve,85); penpos8(eps,180);
546 z3'=z3; x6=x3; top y6r=vround(.2h+.5vair);
547 lft x5r=hround(.5w-1.25u-.5vair); y5=.5[y3,y6];
548 bot y7l=-d; x7l=2/3[x6,x8]; y8=0; rt x8=hround(x4r+.1u);
549 filldraw stroke z3'e{left}...z5e{up}...z6e{right}
550 ..z7e{right}...z8e{up}; fi % tail
551 math_fit(-.3cap_height#*slant-.5u#,ic#);
552 penlabels(1,G2,3,D1,D2,D3,4,5,6,7,8); endchar;
553
554 cmchar "The letter R";
555 beginchar("R",if serifs: 12u#+.5max(2u#,cap_curve#)
556 else:12.5u#-.5width_adj# fi,cap_height#,0);
557 italcorr .75cap_height#*slant- if serifs: 1.75 else: .5 fi\\ u#;
558 adjust_fit(cap_serif_fit#,0);
559 pen_duplicate(1,2);
560 pickup tiny.nib; pos1(.5cap_stem',0); pos2(.5cap_stem',0);
561 Delta_x = hround(cap_interspace+.5cap_stem');
562 lft x.G1l=lft x.G2l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
563 double filldraw stroke z1e--z2e; % double stem
564 penpos3(cap_band,90); penpos4(cap_band,90);
565 penpos5(cap_curve if hefty:-3stem_corr fi,0);
566 penpos6(vair,-90); penpos7(vair,-90);
567 z3r=top z.G1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
568 x7=x.D2; y7l=vround(.5h+.5vair); x4=x6;
569 if serifs: x4=.5w-.5u; x5r=hround(w-2.25u);
570 else: x4=.5w+.5u; x5r=hround(w-u); fi
571 x4l:=x6l:=x4-.125cap_curve;
572 fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe
573 if serifs: pos6'(vair,-90); pos0(cap_stem,180);
574 pos8(cap_curve,180); pos9(vair,-90); pos10(hair,0);
575 z6'=z6; lft x0r=lft x8r=hround(x5-2/3u-.5cap_curve);
576 y8=1/3[y2,y7]; y0=3/5[y2,y7]; x9=.5[x8l,x10r];
577 bot y9r=-o; rt x10r=hround(w-.05u); y10=1/4[y2,y7];
578 filldraw stroke z6'e{right}..z0e---z8e....z9e{right}..z10e{up}; % tail
579 nodish_biserif(1,2,a,1/3,cap_jut,ab,1/3,b,1/3,.5cap_jut); % upper serif
580 dish_biserif(2,1,c,1/3,cap_jut,cd,1/3,d,1/3,cap_jut); % lower serif
581 else: penpos8(cap_stem-2stem_corr,0); penpos9(cap_stem,0);
582 x8=x6+.5u; y8=y6; x9r=hround(w-.5u); y9=0;
583 fill z8l--diag_end(8l,9l,.5,1,9r,8r)--z8r--cycle; % tail
584 mid_biserif(2,1,cd,1/3); fi % lower terminal
585 math_fit(0,.75ic#); penlabels(0,G1,D1,G2,D2,3,4,5,6,7,8,9,10); endchar;
586
587 cmchar "The letter S";
588 beginchar("S",10u#,cap_height#,0);
589 italcorr cap_height#*slant-u#;
590 adjust_fit(0,0);
591 numeric theta; theta=90-angle(50u,h); slope:=-h/50u; % angle at middle
592 numeric s_slab; s_slab=if serifs:slab else:vround .2[slab,cap_stem] fi;
593 numeric ess'; ess'=max(fine.breadth,cap_ess);
594 pen_duplicate(3,6);
595 pickup fine.nib; pos2(max(fine.breadth,s_slab-vround vair_corr),-90);
596 pos0(ess',theta); pos7(s_slab,-90);
597 x2+x7=2x0=w; x7-x2=if serifs: u else: 0 fi; top y2l=h+o; bot y7r=-o;
598 y0=.52h; lft x.G3l=hround u; rt x.D6r=hround(w-u);
599 x3r-x3l=x6r-x6l=hround (.5[.75s_slab,.75ess']-fine);
600 Delta_x = min(hround(cap_curve_interspace+x3r-x3l+fine),x2l-x.G3r); % x2l-x.G3r=x.D6l-x7r
601 ellipse_set(2l,G3l,4l,0l); ellipse_set(2r,G3r,4r,0r); y3=y3r;
602 ellipse_set(7l,D6l,5l,0l); ellipse_set(7r,D6r,5r,0r); y6=y6r;
603 filldraw stroke super_arc.e(2,G3) & z.G3e{down}
604 ..z4e---z5e..z.D6e{down} & super_arc.e(D6,7); % main stroke
605 define_upper_and_lower(D2,D4,D3,
606 super_arc.l(2,G3) & (z.G3l{down}..z4l---z5l));
607 define_upper_and_lower(G5,G7,G6,
608 (z4r---z5r..z.D6r{down}) & super_arc.r(D6,7));
609 filldraw stroke z.D2e--z.D4e; filldraw stroke z.G5e--z.G7e; % inner strokes
610 if serifs: pos1(hair,180); pos8(hair,180);
611 rt x1l=hround(w-1.5u); lft x8r=hround u;
612 bot y1=vround 2/3h+1; top y8=vround 1/3h-1;
613 filldraw stroke z1e{x2-x1,10(y2-y1)}....{left}z2e; % upper arc
614 filldraw stroke z7e{left}....{up}z8e; % lower arc
615 path upper_arc, lower_arc;
616 upper_arc=z1{x2-x1,10(y2-y1)}....{left}z2;
617 lower_arc=z7{left}....{up}z8;
618 pos10(.3[fine.breadth,cap_hair],0); pos9(.3[fine.breadth,cap_hair],0);
619 x10r=x1l; top y10=top y2l; x9l=x8r; bot y9=bot y7r;
620 x1l-x1'=x8'-x8r=1.6cap_curve-fine; y1'=y1; y8'=y8;
621 numeric t; t=xpart(upper_arc intersectiontimes(z10l--z1'));
622 filldraw z1l--z10r--z10l--subpath(t,0) of upper_arc--cycle; % upper barb
623 t:=xpart(lower_arc intersectiontimes(z9r--z8'));
624 filldraw z8r--z9l--z9r--subpath(t,1) of lower_arc--cycle; % lower barb
625 else: pos1(1.2flare,-100); pos8(1.2flare,-100);
626 x1l=good.x(x1l+w-1.75u-rt x1); lft x8r=hround .8u;
627 top y1l=vround .93h+o; bot y8r=vround .1h-o;
628 filldraw stroke term.e(2,1,right,.9,4); % upper arc and terminal
629 filldraw stroke term.e(7,8,left,1,4); fi % lower arc and terminal
630 math_fit(0,.5ic#); penlabels(0,1,1',2,G3,4,D2,D3,D4,5,D6,7,G5,G6,G7,8,8',9,10); endchar;
631
632 cmchar "The letter T";
633 beginchar("T",13u#-width_adj#,cap_height#,0);
634 italcorr cap_height#*slant-beak_jut#-.25u#;
635 adjust_fit(0,0);
636 h:=vround(h-2stem_corr);
637 pen_duplicate(1,2);
638 pickup tiny.nib; pos1(.5cap_stem,0); pos2(.5cap_stem,0);
639 lft x.G1l=lft x.G2l=hround(.5w-.5cap_stem-.5cap_interspace); top y1=h; bot y2=0;
640 Delta_x = hround(cap_interspace+.5cap_stem);
641 double filldraw stroke z1e--z2e; % double stem
642 pickup crisp.nib; pos3(slab,90); pos4(hair,0);
643 top y3r=h; x3=x1; rt x4r=hround(w-.65u); y4=good.y(y3l-beak)-eps;
644 arm(3,4,e,beak_darkness,.7beak_jut); % right arm and beak
645 pos5(hair,180); x5=w-x4; y5=y4;
646 arm(3,5,f,beak_darkness,-.7beak_jut); % left arm and beak
647 if serifs: dish_biserif(2,1,c,1/3,1.414cap_jut,cd,1/3,d,1/3,1.414cap_jut); % lower serif
648 nodish_biserif(1,2,a,1/3,.5cap_jut,ab,1/3,b,1/3,.5cap_jut); % upper bracketing
649 else: mid_biserif(2,1,cd,1/3); fi % lower terminal
650 math_fit(-.75cap_height#*slant,ic#-2.5u#); penlabels(G1,D1,G2,D2,3,4,5,6); endchar;
651
652 cmchar "The letter U";
653 beginchar("U",13u#+.5width_adj#,cap_height#,0);
654 italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
655 if monospace: adjust_fit(cap_serif_fit#-.5u#,cap_serif_fit#-.5u#)
656 else: adjust_fit(cap_serif_fit#,cap_serif_fit#) fi;
657 pen_duplicate(1,2,2');
658 pickup tiny.nib; pos1(.5cap_stem,0); pos2(.5cap_stem,0);
659 pos2'(.5cap_stem,180); z2'=z2;
660 pos3(cap_band,-90);
661 pos4(cap_hair,0); pos5(cap_hair,0);
662 x1=x2; x3=.5[x.G1,x5]; x4=x5; x.G1l=w-x5r;
663 top y1=top y5=h; y2=y4=1/3h; bot y3r=-o;
664 lft x.G1l=hround max(2u,3u-.5cap_stem-.5cap_interspace);
665 Delta_x = min(hround(cap_interspace+.5cap_stem),x3r-x.G2r);
666 double filldraw stroke z1e--z2e; % left (double) stem
667 filldraw stroke pulled_arc.e(G2',3)
668 & pulled_arc.e(3,4)&z4e--z5e; % arc and right stem
669 define_lower(D3,D2',pulled_arc.r(G2',3));
670 filldraw stroke z.D2'e--z.D3e; % inner stroke
671 if serifs: dish_biserif(1,2,a,1/3,cap_jut,ab,1/3,b,1/3,cap_jut); % left serif
672 dish_serif(5,4,c,1/2,cap_jut,d,1/2,cap_jut)(dark); % right serif
673 else: mid_biserif(1,2,ab,1/3); fi % left terminal
674 math_fit(-cap_serif_fit#-.3cap_height#*slant-min(cap_height#*slant,u#),
675 max(.5ic#-.5u#,0)); penlabels(G1,D1,G2,D2,3,D3,4,5); endchar;
676
677 cmchar "The letter V";
678 beginchar("V",13u#,cap_height#,0);
679 italcorr cap_height#*slant+.25u#;
680 adjust_fit(cap_serif_fit#,cap_serif_fit#);
681 numeric left_stem,right_stem,outer_jut,alpha;
682 left_stem=cap_stem-stem_corr;
683 right_stem=min(cap_hair if hefty:-2stem_corr fi,left_stem);
684 pen_duplicate(1,2);
685 outer_jut=.75cap_jut; x.G1l=w-x4r=l+letter_fit+outer_jut+.25u; y1=y4=h;
686 x2-x1=x4-x3; x.D2r=x3r; y2=y3=-apex_o;
687 alpha=diag_ratio(2,right_stem,y1-y2,x4r-x.G1l-apex_corr-cap_interspace);
688 penpos1(alpha*.5left_stem,0); penpos2(alpha*.5left_stem,0);
689 penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
690 Delta_x = hround(alpha*(cap_interspace+.5left_stem));
691 z0=whatever[z.D1r,z.D2r]=whatever[z3l,z4l];
692 if y0>cap_notch_cut: y0:=cap_notch_cut;
693 fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
694 --diag_end(4r,3r,1,1,D2l,D1l)--diag_end(D2l,D1l,1,1,D1r,D2r){z2-z1}
695 ...{down}z0+.5left--cycle; % left and right diagonals
696 else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,D2l,D1l)
697 --diag_end(D2l,D1l,1,1,D1r,0)--cycle; fi % left and right diagonals
698 fill diag_end(G2l,G1l,1,1,G1r,G2r)--diag_end(G1r,G2r,1,1,G2l,G1l)--cycle; % lower left diagonal
699 if serifs: numeric inner_jut; pickup tiny.nib;
700 prime_points_inside(1,2); prime_points_inside(4,3);
701 prime_points_inside(2,1); pen_duplicate(1',2');
702 if rt x.D1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
703 else: rt x.D1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
704 dish_biserif(1',2,a,1/3,outer_jut,ab,1/3,b,1/2,inner_jut); % left serif
705 mid_biserif(2',1,ab',1/3); % lower terminal
706 dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); % right serif
707 else: mid_biserif(1,2,ab,1/3); % upper terminal
708 mid_biserif(2,1,ab',1/3); fi % lower terminal
709 math_fit(.75u#-cap_height#*slant,ic#-4u#); penlabels(0,G1,D1,G2,D2,3,4); endchar;
710
711 cmchar "The letter W";
712 beginchar("W",18u#,cap_height#,0);
713 italcorr cap_height#*slant+.25u#;
714 adjust_fit(cap_serif_fit#,cap_serif_fit#);
715 numeric stem[],outer_jut,upper_notch,alpha,mid_corr;
716 outer_jut=.7cap_jut; x.G1l=w-x8r=l+letter_fit+outer_jut+.25u;
717 stem1=fudged.cap_stem-stem_corr;
718 stem4=min(fudged.hair if hefty:-2stem_corr fi,stem1);
719 stem2=stem4 if hefty:-2stem_corr fi;
720 stem3=stem1 if hefty:-2stem_corr fi;
721 pen_duplicate(1,2);
722 x2-x1=x4-x3=x6-x5=x8-x7; x.D2r=x3r; x6l+apex_corr=x7l;
723 y1=y8=h; y2=y3=y6=y7=-apex_o; y4=y5=if monospace: vround .6 fi\\ h;
724 mid_corr=if monospace or hefty:-apex_corr else: 1/3jut fi;
725 alpha=diag_ratio(4,stem2-stem3+stem4,y1-y2,x8r-x.G1l+mid_corr-2apex_corr+cap_interspace);
726 penpos1(alpha*.5stem1,0); penpos2(alpha*.5stem1,0);
727 penpos3(alpha*stem2,0); penpos4(alpha*stem2,0);
728 penpos5(alpha*stem3,0); penpos6(alpha*stem3,0);
729 penpos7(alpha*stem4,0); penpos8(alpha*stem4,0);
730 Delta_x = hround(alpha*(cap_interspace+.5stem1));
731 x4l-x1l=floor(x4l-x1l+.5(x5r+mid_corr-x4r)); % |x5r+mid_corr| $\approx$ |x4r|
732 z23=whatever[z.D1r,z.D2r]=whatever[z3l,z4l];
733 z45=whatever[z3r,z4r]=whatever[z5l,z6l];
734 z67=whatever[z5r,z6r]=whatever[z7l,z8l]; upper_notch=y4-cap_notch_cut;
735 fill diag_end(D1l,D2l,1,1,3r,4r){z4-z3}
736 ...if y45<upper_notch:(x45,upper_notch)+.5left{up}
737 --(x45,upper_notch)+.5right{down} else: z45&z45 fi
738 ...{z6-z5}diag_end(5l,6l,1,1,7r,8r)--diag_end(7r,8r,1,1,8l,7l){z7-z8}
739 ...if y67>cap_notch_cut:(x67,cap_notch_cut)+.5right{down}
740 --(x67,cap_notch_cut)+.5left{up} else: z67&z67 fi
741 ...{z5-z6}special_diag_end(6,5,4,3){z3-z4}
742 ...if y23>cap_notch_cut:(x23,cap_notch_cut)+.5right{down}
743 --(x23,cap_notch_cut)+.5left{up} else: z23&z23 fi
744 ...{z1-z2}diag_end(D2r,D1r,1,1,D1l,D2l)--cycle; % diagonals
745 fill diag_end(G2r,G1r,1,1,G1l,G2l)--diag_end(G1l,G2l,1,1,G2r,G1r)--cycle; % lower left diagonal
746 if serifs: numeric inner_jut[]; pickup tiny.nib;
747 prime_points_inside(1,2); prime_points_inside(5,6); prime_points_inside(8,7);
748 prime_points_inside(2,1); pen_duplicate(1',2');
749 if monospace: inner_jut1=inner_jut4=1.5cap_jut;
750 elseif hefty: inner_jut1=inner_jut4=cap_jut;
751 else: fill diag_end(6r,5r,1,1,5l,6l)--.9[z5l,z6l]
752 ..{z5-z6}.1[z5r,z6r]--cycle; % middle stem
753 inner_jut2=.7inner_jut1; inner_jut4=1.1inner_jut3;
754 if rt x.D1'r+cap_jut+.5u+1<=lft x5'l-.7cap_jut: inner_jut1=cap_jut;
755 else: rt x.D1'r+inner_jut1+.5u+1=lft x5'l-inner_jut2; fi
756 if rt x5'r+cap_jut+.5u+1<=lft x8'l-1.1cap_jut: inner_jut3=cap_jut;
757 else: rt x5'r+inner_jut3+.5u+1=lft x8'l-inner_jut4; fi
758 dish_serif(5',6,e,1/3,inner_jut2,f,1/2,inner_jut3); fi % middle serif
759 dish_biserif(1',2,a,1/3,outer_jut,ab,1/3,b,1/2,inner_jut1); % left serif
760 mid_biserif(2',1,ab',1/3); % lower left terminal
761 dish_serif(8',7,c,.6,inner_jut4,d,1/2,outer_jut)(dark); % right serif
762 else: mid_biserif(1,2,ab,1/3); % left serif
763 mid_biserif(2,1,ab',1/3); fi % lower left terminal
764 math_fit(.75u#-cap_height#*slant,ic#-2.5u#);
765 penlabels(0,G1,D1,G2,D2,3,4,5,6,7,8,23,45,67); endchar;
766
767 cmchar "The letter X";
768 beginchar("X",13u#,cap_height#,0);
769 italcorr cap_height#*slant-.25u#;
770 adjust_fit(cap_serif_fit#,cap_serif_fit#);
771 numeric stem[],outer_jut,xjut,alpha[];
772 stem1=cap_stem-2stem_corr; stem2=min(cap_hair,stem1);
773 outer_jut=.75cap_jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi;
774 pen_duplicate(1,4);
775 x.G1l=l+letter_fit+.5u+outer_jut; x2r=r-letter_fit-u-outer_jut-xjut;
776 x3l=l+letter_fit+.25u+outer_jut+xjut; x.D4r=r-letter_fit-.25u-outer_jut;
777 y1=y2=h; y3=y4=0;
778 alpha1=diag_ratio(1,stem1+cap_interspace,h,x.D4r-x.G1l);
779 alpha2=diag_ratio(1,stem2,h,x2r-x3l);
780 penpos1(alpha1*.5stem1,0); penpos2(alpha2*stem2,0);
781 penpos3(alpha2*stem2,0); penpos4(alpha1*.5stem1,0);
782 Delta_x = hround(alpha1*(cap_interspace+.5stem1));
783 if hefty:
784 z12=whatever[z2l,z3l]=whatever[z.D1r,z.D4r];
785 z13=whatever[z2l,z3l]=whatever[z.G1l,z.G4l];
786 z24=whatever[z2r,z3r]=whatever[z.D1r,z.D4r];
787 z34=whatever[z2r,z3r]=whatever[z.G1l,z.G4l];
788 fill diag_end(12,D1r,.5,1,D1l,D4l)--diag_end(D1l,D4l,.5,1,D4r,24)--z24
789 --diag_end(24,2r,1,.5,2l,12)--z12--cycle; % upper diagonals
790 fill diag_end(34,G4l,.5,1,G4r,G1r)--diag_end(G4r,G1r,.5,1,G1l,13)--z13
791 --diag_end(13,3l,1,.5,3r,34)--z34--cycle; % lower diagonals
792 else: forsuffixes e=l,,r: forsuffixes $=G,D:
793 z$0e = whatever[z2e,z3e] = whatever[z$1,z$4]; endfor endfor
794 fill diag_end(D4r,D1r,.5,1,D1l,D4l)
795 --diag_end(D1l,D4l,.5,1,D4r,D1r)--cycle; % upper left diagonal
796 fill diag_end(G4r,G1r,.5,1,G1l,G4l)
797 --diag_end(G1l,G4l,.5,1,G4r,G1r)--cycle; % lower left diagonal
798 fill z.D0l--z.D0r--diag_end(D0r,2r,.5,1,2l,D0l)--cycle; % upper right diagonal
799 fill diag_end(G0l,3l,.5,1,3r,G0r)--z.G0r--z.G0l--cycle; fi % lower right diagonal
800 if serifs: numeric inner_jut[]; pickup tiny.nib;
801 prime_points_inside(1,4); prime_points_inside(4,1); pen_duplicate(1',4');
802 prime_points_inside(2,3); prime_points_inside(3,2);
803 if rt x.D1'r+cap_jut+.5u+1<=lft x2'l-cap_jut-xjut: inner_jut1=cap_jut;
804 else: rt x.D1'r+inner_jut1+.5u+1=lft x2'l-inner_jut1-xjut; fi
805 if rt x3'r+cap_jut+.5u+1<=lft x.G4'l-cap_jut-xjut: inner_jut2=cap_jut;
806 else: rt x3'r+inner_jut2+.5u+1=lft x.G4'l-inner_jut2-xjut; fi
807 dish_biserif(1',4,a,1/3,outer_jut,ab,1/2,b,2/3,inner_jut1); % upper left serif
808 dish_biserif(4',1,c,2/3,inner_jut2,cd,1/2,d,1/3,outer_jut); % lower right serif
809 dish_serif(2',3,e,2/3,inner_jut1+xjut,
810 f,1/2,outer_jut+xjut)(dark); % upper right serif
811 dish_serif(3',2,g,1/2,outer_jut+xjut,
812 h,2/3,inner_jut2+xjut)(dark); % lower left serif
813 else: mid_biserif(1,4,ab,1/2); % upper left terminal
814 mid_biserif(4,1,cd,1/2); fi % lower right terminal
815 math_fit(0,.5ic#); penlabels(0,G0,D0,G1,D1,2,3,G4,D4,12,13,24,34); endchar;
816
817 cmchar "The letter Y";
818 beginchar("Y",13u#,cap_height#,0);
819 italcorr cap_height#*slant+.45u#;
820 adjust_fit(cap_serif_fit#,cap_serif_fit#);
821 numeric left_stem,right_stem,outer_jut,dy,alpha;
822 left_stem=cap_stem-stem_corr;
823 right_stem=min(cap_hair if hefty:-2stem_corr fi,left_stem);
824 pen_duplicate(1,2,5,6);numeric theta;
825 outer_jut=.75cap_jut; x.G1l=w-x4r=l+letter_fit+outer_jut+.05u;
826 x.G2l=x.G5l=hround(.5w-.5left_stem-.5cap_interspace); x3r=x.D5r; y1l=y4=h; y2l=y3=y5=.4h;
827 %dy=y1-y2; alpha=((x2l-x1l)++dy)/dy;
828 %pair dz; forsuffixes $=1,2,6: z$r-z$=z$-z$l=endfor .5dz;
829 penpos5(.5left_stem,0); penpos6(.5left_stem,0); x5=x6; y6=0;
830 theta = angle(z2l-z1l)+90; alpha = 1/cosd(.5theta);
831 penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
832 penpos1(alpha*.5left_stem,0);penpos2(.5left_stem,theta);
833 %dz=(alpha*.5left_stem,0)rotated theta; x5=x6; y6=0;
834 Delta_x = hround(alpha*(cap_interspace+.5left_stem));
835 z0=whatever[z.D1r,z.D2r]=whatever[z3l,z4l];
836 if y0>y2+cap_notch_cut: y0:=y2+cap_notch_cut;
837 fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)--z.D5r
838 --diag_end(D5r,D6r,1,1,D6l,D5l)--z.D5l--diag_end(D2l,D1l,1,1,D1r,D2r){z2-z1}
839 ...{down}z0+.5left--cycle; % diagonals and stem
840 else: fill z0--diag_end(0,4l,1,1,4r,3r)--z.D5r
841 --diag_end(D5r,D6r,1,1,D6l,D5l)--z.D5l % z.D5l=z.D2l
842 --diag_end(D2l,D1l,1,1,D1r,0)--cycle; fi % diagonals and stem
843 fill z.G2r..z.G5r--diag_end(G5r,G6r,1,1,G6l,G5l)--z.G5l--diag_end(G2l,G1l,1,1,G1r,G2r)--cycle;
844 if serifs: numeric inner_jut; pickup tiny.nib;
845 prime_points_inside(1,2); prime_points_inside(4,3);
846 prime_points_inside(6,5); pen_duplicate(1',6');
847 if rt x.D1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
848 else: rt x.D1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
849 dish_biserif(1',2,a,1/3,outer_jut,ab,1/3,b,1/2,inner_jut); % upper left serif
850 dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); % upper right serif
851 dish_biserif(6',5,e,1/3,cap_jut,ef,1/3,f,1/3,cap_jut); % lower serif
852 else: mid_biserif(1,2,ab,1/3); % upper left terminal
853 mid_biserif(6,5,ef,1/3); fi % lower terminal
854 math_fit(.5u#-cap_height#*slant,ic#-4u#);
855 penlabels(0,G1,D1,G2,D2,3,4,G5,D5,G6,D6); endchar;
856
857 cmchar "The letter Z";
858 beginchar("Z",11u#,cap_height#,0);
859 italcorr cap_height#*slant-.5u#;
860 adjust_fit(0,0);
861 numeric arm_thickness[],z_stem;
862 if hefty: arm_thickness1=Vround(slab-vair_corr); arm_thickness2=slab;
863 z_stem=max(.8[vair,.5cap_stem],tiny+eps);
864 else: arm_thickness1=slab; arm_thickness2=vround(slab+vair_corr);
865 z_stem=max(.9[vair,.5cap_stem],tiny+eps); fi
866 pen_duplicate(1,2,3,4);
867 pickup tiny.nib;
868 x3l=x4l=w-x1r=w-x2r; lft x.G3l=hround u;
869 top y1=h; y2=min(y1,h-2/3arm_thickness1);
870 bot y4=0; y3=max(y4,2/3arm_thickness2);
871 numeric alpha; alpha=diag_ratio(1,z_stem+cap_interspace-tiny,y2-y3,x.D2r-x.G3l);
872 penpos1(alpha*(z_stem-tiny),0);penpos2(alpha*(z_stem-tiny),0);
873 penpos3(alpha*(z_stem-tiny),0);penpos4(alpha*(z_stem-tiny),0);
874 Delta_x = hround(alpha*(cap_interspace+z_stem));
875 pair delta; delta=penoffset z3-z2 of currentpen;
876 double
877 fill top lft z1l--z2l+delta---z3l+delta..lft z3l---lft z4l..bot z4l
878 ---bot rt z4r--z3r-delta---z2r-delta..rt z2r---rt z1r..top z1r
879 ---cycle; % double diagonal
880 pickup crisp.nib; pos5(arm_thickness1,90); pos6(hair,180);
881 top y5r=h; x5=x.D1; lft x6r=hround 1.25u; y6=good.y(y5l-beak)-eps;
882 arm(5,6,a,beak_darkness**.8,-.4beak_jut); % upper arm and beak
883 pos7(arm_thickness2,-90); pos8(hair,0);
884 bot y7r=0; x7=x.G4; rt x8r=hround(w-.9u); y8=good.y(y7l+1.2beak)+eps;
885 arm(7,8,b,beak_darkness**.9,.6beak_jut); % lower arm and beak
886 math_fit(0,.5ic#); penlabels(G1,D1,G2,D2,G3,D3,G4,D4,5,6,7,8); endchar;
887
888