1 %% version 0.01 (94/01/20 -- corrected scaling)
2 %% version 0.02 (94/01/25 -- 2nd and 3rd order corrections added)
3 %% version 0.03 (94/01/31 -- dpi values scaled down to 1/100
4 %% and logo widening limited)
5 %% version 0.04 (94/02/10 -- color filling overshoot corrected)
6 mode_setup; font_size 10pt#;
7 font_identifier:="Faculty of Informatics logo";
8 font_coding_scheme:="UNSPECIFIED";
10 if unknown dpi: scantokens ("dpi:=0" &
11 substring (7, length jobname-2) of jobname & "." &
12 substring(length jobname-2,length jobname) of jobname);
14 if length jobname < 9: dpi:=10dpi; fi
16 message "Missing dpi information. Assuming 300.";
25 taller_letters := 1+(1-mag_dpi)**2;
26 wider_logo:=1+(1-max(mag_dpi,1/3))**3;
32 u#:=21/36pt#; % unit width from cmsc
33 %%u#:=scaling_factor*64/11pt#; uu#:=.1u#; % basic units
34 uu#:=scaling_factor*(36/21)*(64/11)*.1u#; % basic units
35 barw#:=12uu#; % bar width
36 aarw#:=13uu#; % bar width
39 triw#:=110uu#; % triangle width
40 gapw#:=5uu#; % gap width
41 hapw#:=3uu#; % gap width
42 serif#:=4uu#; % serif width
51 define_pixels(barw,aarw,carw,darw,triw,gapw,hapw,serif,barww,triww);
52 define_blacker_pixels(pen_size);
53 %%beginchar(65,triw#+aarw#,r*triw#+r*carw#,0);
55 "Le silence eternel de ces espace infinis m'effraie. --B.Pascal,1670";
57 %%x1 = 1/2 triw*wider_logo + aarw ; y1 = 0;
58 x1 = 2/3aarw*wider_logo ; y1 = -2/3(r*triw)-1/3(r*carw*wider_logo);
60 z2 - z1 = whatever * dir 60;
64 z3 - z7 = whatever * dir 0;
65 z3 - z1 = darw*wider_logo * dir 120;
66 z7 - z5 = darw*wider_logo * dir 120;
67 z7 - z3 = aarw*wider_logo * dir 180;
68 z1 - z5 = whatever * dir 0;
72 z21 = z4 - (carw*wider_logo * dir 60);
74 z10 - z1 = whatever * dir 120;
75 z16 = whatever [z21, z21 + dir 0] = whatever [z5, z5 + dir 120];
77 z16 - z17 = barw*wider_logo * dir 120;
79 z10 = whatever [z17, (z17+dir 0)];
81 z15 = whatever [z5 , z16];
82 k=darw*wider_logo+hapw;
83 z15 = z5 + k * dir 120;
84 z9 = z1 + k * dir 120;
85 whatever [z9 , z15] = whatever [z1 , z10];
87 z11 = z9 + carw*wider_logo * dir 60;
88 z12 = whatever [z10, z10 + dir 0] = whatever [z11, z11 + dir 120];
90 z18 = whatever [z17, z17 + dir 0] = whatever [z1 , z2];
91 z19 = whatever [z7 , z8] = whatever [z17 , z18];
92 z20 = whatever [z12 , z19];
94 %z21 = whatever [z16, z16 + dir 0] = whatever [z3 , z4];
95 z22 = whatever [z16 , z21] = whatever [z7 , z8];
96 z23 = whatever [z16 , z22] = whatever [z20 , z20 + dir 100];
97 z24 = whatever [z4 , z8] = whatever [z23 , z23 + dir 60];
99 z25 = whatever [z15 , z9] = whatever [z7 , z22];
100 z26 = whatever [z11 , z12] =whatever [z7 , z22];
102 z27 = whatever [z19 , z10]; x27 - x20 = - gapw;
103 z28 = whatever [z22 , z23]; x28 - x23 = - gapw;
104 z29 = whatever [z24 , z8]; x29 - x24 = - gapw;
105 z30 = whatever [z23 , z24] = whatever [z29 , z29 + dir 280];
106 z31 = whatever [z20 , z23] = whatever [z27 , z27 + dir 60];
108 z32 = whatever [z4 , z29]; x32 - x4 = - length (z21 - z16);
110 z33 = 2/3 [z9 , z10];
111 z34 = whatever [z33, z33 + dir 0] = whatever [z7 , z22];
112 z35 = whatever [z9 , z10]; x33 - x35 = x3 - x1;
113 z36 = whatever [z35, z35 + dir 0] = whatever [z5 , z6];
114 z37 = whatever [z12 , z11]; x37 - x11 = x33 - x9;
115 z38 = whatever [z37 , z37 + dir 0] = whatever [z7 , z22];
116 z39 = whatever [z35 , z36]; x39 - x35 = gapw;
117 z40 = whatever [z33 , z34]; x40 - x33 = gapw;
118 z41 = whatever [z37 , z38]; x41 - x37 = gapw;
119 z42 = whatever [z33 , z34]; x34 - x42 = 2gapw;
120 z43 = whatever [z42 , z42 + dir 280] = whatever [z35 , z39]; %%%
121 %z44 = whatever [z35 , z36] = whatever [z7 , z22];
122 z45 = whatever [z37 , z38]; x38 - x45 = 2gapw;
123 %z46 = whatever [z45 , z45 + dir 280] = whatever [z7 , z22];
124 z46 = whatever [z45 , z45 + dir 280] = whatever [z43 , z43+ z45-z42];
126 z47 = whatever [z11 , z12] = whatever [z40 , z41];
127 z48 = whatever [z11 , z12] = whatever [z35 , z36];
129 z49 = whatever [z1 , z2] = whatever [z4 , z4 + dir 290];
131 pickup pencircle scaled (pen_size*wider_logo);
133 draw z1--z49--z4--z3--z1;
134 draw z1--z3--z7--z5--z1;
136 draw z10--z9--z15--z16;
138 draw z47--z12--z10--z27--z28;
139 draw z7--z25--z9--z11--z26--z22--z23--z20--z19;
140 draw z27--z31--z23--z30--z29--z28--z27;
141 draw z16--z32--z29--z28--z16;
143 draw z39--z43--z42--z40--z39;
144 draw z40--z41--z45--z42;
147 fill z15--z9--z10--z27--z28--z16--cycle;
148 fill z39--z43--z42--z40--cycle;
149 fill z7--z3--z4--z24--z23--z22--z26--z11--z9--z25--cycle;
150 %%%erase draw rt z25 -- lft z9;
152 b[1]:=z16--z28--z29--z32--cycle;
153 b[2]:=z9--z10--z12--z47--z40--z39--z48--z11--cycle;
154 b[3]:=z27--z28--z29--z30--z23--z31--cycle;
155 b[4]:=z20--z23--z22--z19--cycle;
156 b[5]:=z1--z3--z4--z49--cycle;
157 b[6]:=z1--z5--z7--z3--cycle;
158 b[7]:=z40--z42--z45--z41--cycle;
159 b[8]:=z42--z45--z46--z43--cycle;
161 labels(range 1 thru 49);
163 f[1]dvips:=1/2[z9,z16];
164 f[2]dvips:=1/2[z1,z7];
168 "Faculty of Informatics logo colors";
177 pickup pencircle scaled (pen_size*wider_logo);
188 % Computer Modern Roman Caps and Small Caps 10 point
189 if unknown cmbase: input cmbase fi
191 %%%font_identifier:="CMCSC";
194 % first come parameters used to set the uppercase letters
195 % (including some for lowercase that aren't actually used)
196 u#:=21/36pt#; % unit width
197 width_adj#:=0pt#; % width adjustment for certain characters
198 serif_fit#:=0pt#; % extra sidebar near lowercase serifs
199 cap_serif_fit#:=5/36pt#; % extra sidebar near uppercase serifs
200 letter_fit#:=5/36pt#; % extra space added to all sidebars
202 body_height#:=270/36pt#; % height of tallest characters
203 asc_height#:=250/36pt#; % height of lowercase ascenders
204 cap_height#:=246/36pt#; % height of caps
205 fig_height#:=232/36pt#; % height of numerals
206 x_height#:=155/36pt#; % height of lowercase without ascenders
207 math_axis#:=90/36pt#; % axis of symmetry for math symbols
208 bar_height#:=87/36pt#; % height of crossbar in lowercase e
209 comma_depth#:=70/36pt#; % depth of comma below baseline
210 desc_depth#:=70/36pt#; % depth of lowercase descenders
212 crisp#:=0pt#; % diameter of serif corners
213 tiny#:=8/36pt#; % diameter of rounded corners
214 fine#:=7/36pt#; % diameter of sharply rounded corners
215 thin_join#:=7/36pt#; % width of extrafine details
216 hair#:=9/36pt#; % lowercase hairline breadth
217 stem#:=25/36pt#; % lowercase stem breadth
218 curve#:=30/36pt#; % lowercase curve breadth
219 ess#:=27/36pt#; % breadth in middle of lowercase s
220 flare#:=33/36pt#; % diameter of bulbs or breadth of terminals
221 dot_size#:=38/36pt#; % diameter of dots
222 cap_hair#:=11/36pt#; % uppercase hairline breadth
223 cap_stem#:=32/36pt#; % uppercase stem breadth
224 cap_curve#:=37/36pt#; % uppercase curve breadth
225 cap_ess#:=35/36pt#; % breadth in middle of uppercase s
226 rule_thickness#:=.4pt#; % thickness of lines in math symbols
228 dish#:=1/36pt#; % amount erased at top or bottom of serifs
229 bracket#:=20/36pt#; % vertical distance from serif base to tangent
230 jut#:=28/36pt#; % protrusion of lowercase serifs
231 cap_jut#:=37/36pt#; % protrusion of uppercase serifs
232 beak_jut#:=10/36pt#; % horizontal protrusion of beak serifs
233 beak#:=70/36pt#; % vertical protrusion of beak serifs
234 vair#:=8/36pt#; % vertical diameter of hairlines
235 notch_cut#:=10pt#; % maximum breadth above or below notches
236 bar#:=11/36pt#; % lowercase bar thickness
237 slab#:=11/36pt#; % serif and arm thickness
238 cap_bar#:=11/36pt#; % uppercase bar thickness
239 cap_band#:=11/36pt#; % uppercase thickness above/below lobes
240 cap_notch_cut#:=10pt#; % max breadth above/below uppercase notches
241 serif_drop#:=4/36pt#; % vertical drop of sloped serifs
242 stem_corr#:=1/36pt#; % for small refinements of stem breadth
243 vair_corr#:=1/36pt#; % for small refinements of hairline height
244 apex_corr#:=0pt#; % extra width at diagonal junctions
246 o#:=8/36pt#; % amount of overshoot for curves
247 apex_o#:=8/36pt#; % amount of overshoot for diagonal junctions
249 slant:=0; % tilt ratio $(\Delta x/\Delta y)$
250 fudge:=1; % factor applied to weights of heavy characters
251 math_spread:=0; % extra openness of math symbols
252 superness:=1/sqrt2; % parameter for superellipses
253 superpull:=1/6; % extra openness inside bowls
254 beak_darkness:=11/30; % fraction of triangle inside beak serifs
255 ligs:=1; % level of ligatures to be included
257 square_dots:=false; % should dots be square?
258 hefty:=false; % should we try hard not to be overweight?
259 serifs:=true; % should serifs and bulbs be attached?
260 monospace:=false; % should all characters have the same width?
261 variant_g:=false; % should an italic-style g be used?
262 low_asterisk:=false; % should the asterisk be centered at the axis?
263 math_fitting:=false; % should math-mode spacing be used?
265 % now come replacements used to set the lowercase caps
267 lower.u#:=16/36pt#; % unit width
268 lower.width_adj#:=0pt#; % width adjustment for certain characters
269 lower.cap_serif_fit#:=4/36pt#; % extra sidebar near uppercase serifs
270 lower.letter_fit#:=2.4/36pt#; % extra space added to all sidebars
272 lower.body_height#:=200/36pt#; % height of tallest characters
273 lower.cap_height#:=185/36pt#; % height of caps
274 lower.x_height#:=116/36pt#; % height of lowercase without ascenders
275 lower.bar_height#:=65/36pt#; % height of crossbar in lowercase e
276 lower.comma_depth#:=52/36pt#; % depth of comma below baseline
278 lower.flare#:=25/36pt#; % diameter of bulbs or breadth of terminals
279 lower.cap_hair#:=9.1/36pt#; % uppercase hairline breadth
280 lower.stem#:=21/36pt#; % lowercase stem breadth
281 lower.cap_stem#:=26/36pt#; % uppercase stem breadth
282 lower.cap_curve#:=31/36pt#; % uppercase curve breadth
283 lower.cap_ess#:=28/36pt#; % breadth in middle of uppercase s
285 lower.cap_jut#:=26/36pt#; % protrusion of uppercase serifs
286 lower.beak_jut#:=7/36pt#; % horizontal protrusion of beak serifs
287 lower.beak#:=52/36pt#; % vertical protrusion of beak serifs
288 lower.slab#:=9.1/36pt#; % serif and arm thickness
289 lower.cap_bar#:=9.1/36pt#; % uppercase bar thickness
290 lower.cap_band#:=9.1/36pt#; % uppercase thickness above/below lobes
291 lower.cap_notch_cut#:=10pt#; % max breadth above/below uppercase notches
293 lower.o#:=5/36pt#; % amount of overshoot for curves
294 lower.apex_o#:=4/36pt#; % amount of overshoot for diagonal junctions
296 lower.fudge:=1; % factor applied to weights of heavy characters
298 % Caps and Small Caps in Computer Modern Roman
300 font_coding_scheme:=if ligs=0: "TeX typewriter text"
301 else: "TeX text without f-ligatures" fi;
306 radius#:=scaling_factor*80u#;
307 define_pixels(radius);
309 %beginchar("[",scaling_factor*radius#+cap_height#,
310 % scaling_factor*radius#+cap_height#,
311 % scaling_factor*radius#+cap_height#);
314 %beginchar("]",scaling_factor*radius#+cap_height#,
315 % scaling_factor*radius#+cap_height#,
316 % scaling_factor*radius#+cap_height#);
320 def cmchar = CMCHAR; enddef;
322 let ENDCHAR = endchar;
324 scantokens extra_endchar;
325 if proofing>0: makebox(proofrule); fi
327 charwd:=0; charht:=0; chardp:=0;
329 if displaying>0: makebox(screenrule); showit; fi
331 %%%input romanu; % upper case (majuscules)
333 % Computer Modern Roman upper case:
334 % These letters were originally coded by D. E. Knuth in November, 1979,
335 % inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
336 % Sans serif designs by Richard Southall were added in April, 1982.
337 % The programs were revised for the new \MF\ conventions in 1985.
339 % Character codes \0101 through \0132 are generated.
341 def t_=transformed currenttransform enddef;
344 def A_(expr n, rotation_angle, moved_a, moved_b)=
345 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
346 cmchar "The letter A";
347 beginchar(n,13u#,cap_height#,0);
348 adjust_fit(cap_serif_fit#,cap_serif_fit#);
349 numeric left_stem,right_stem,outer_jut,alpha;
350 right_stem=cap_stem-stem_corr;
351 left_stem=min(cap_hair if hefty: -3stem_corr fi,right_stem);
352 outer_jut=.8cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.5u; y1=y4=0;
353 x2-x1=x4-x3; x3r=x2r+apex_corr; y2=y3=h+apex_o+apex_oo;
354 alpha=diag_ratio(2,left_stem,y2-y1,x4r-x1l-apex_corr);
355 penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
356 penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
357 z0=whatever[z1r,z2r]=whatever[z3l,z4l];
358 if y0<h-cap_notch_cut: y0:=h-cap_notch_cut;
359 fill z0+.5right{down}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
360 --diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
361 ...{up}z0+.5left--cycle; % left and right diagonals
362 else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
363 --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
364 penpos5(whatever,angle(z2-z1)); z5=whatever[z1,z2];
365 penpos6(whatever,angle(z3-z4)); z6=whatever[z3,z4]; y6=y5;
366 if hefty: y5r else: y5 fi =5/12y0;
367 y5r-y5l=y6r-y6l=cap_band; penstroke z5e--z6e; % bar line
368 if serifs: numeric inner_jut; pickup tiny.nib;
369 prime_points_inside(1,2); prime_points_inside(4,3);
370 if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
371 else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
372 dish_serif(1',2,a,1/2,outer_jut,b,.6,inner_jut)(dark); % left serif
373 dish_serif(4',3,c,1/2,inner_jut,d,1/3,outer_jut); fi % right serif
374 penlabels(0,1,2,3,4,5,6); endchar;
378 def B_(expr n, rotation_angle, moved_a, moved_b)=
379 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
380 cmchar "The letter B";
381 beginchar(n,12.5u#,cap_height#,0);
382 italcorr .75cap_height#*slant-.5u#;
383 adjust_fit(cap_serif_fit#,0);
384 numeric left_stem,right_curve,middle_weight;
385 left_stem=cap_stem-hround 2stem_corr; middle_weight=.6vair+.5;
386 pickup tiny.nib; pos1(left_stem,0); pos2(left_stem,0);
387 lft x1l=lft x2l=hround max(2u,3u-.5left_stem); top y1=h; bot y2=0;
388 filldraw stroke z1e--z2e; % stem
389 penpos3(cap_band,90); penpos4(cap_band,90);
390 penpos6(middle_weight,-90); penpos7(middle_weight,-90);
391 penpos8(middle_weight,90); penpos9(middle_weight,90);
392 penpos5(right_curve-stem_corr,0); penpos10(right_curve,0);
393 penpos11(cap_band,-90); penpos12(cap_band,-90);
394 z3r=top z1; y4=y3; y5=.5[y4,y6]; y6=y7; y7l-y8l=vair;
395 z12r=bot z2; y11=y12; y10=.5[y11,y9]; y8=y9; .5[y7l,y8l]=.52h;
396 x4=x6; x9=x11=x4+.5u; x7=x8=x1; x9l:=x4+.25u;
397 x5r=hround(w-1.5u); x10r=hround(w-u);
398 if serifs: right_curve=cap_curve-stem_corr; x4=.5[x1,w-1.5u];
399 else: right_curve=cap_curve-3stem_corr; x4=.5[x1,w-2.5u];
400 x4l:=x4l-.5u; x9l:=x9l-.5u; fi
401 x6l:=x6l-.5u; x11l:=x11l-.5u;
402 fill stroke z3e..super_arc.e(4,5) & super_arc.e(5,6)..z7e; % upper lobe
403 fill stroke z8e..super_arc.e(9,10) & super_arc.e(10,11)..z12e; % lower lobe
404 if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif
405 nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi % lower serif
406 math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9,10,11,12); endchar;
409 if serifs: width.C:=13u;
410 else: width.C:=11.5u;
412 def C_(expr n, rotation_angle, moved_a, moved_b)=
413 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
414 cmchar "The letter C";
415 if serifs: beginchar(n,13u#,cap_height#,0);
416 italcorr cap_height#*slant-.5u#;
418 pickup fine.nib; pos1(cap_hair,0); pos2(cap_band,90);
419 pos3(cap_curve,180); pos4(cap_band,270); pos5(hair,360);
420 rt x1r=rt x5r=hround(w-u); lft x3r=hround u; x2=x4=.55[x3,x1];
421 top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
422 bot y1=min(vround max(.6h,x_height-.5vair),bot y2l-eps);
423 y5=max(good.y .95(h-y1),y4l+eps);
424 (x2l',y2l)=whatever[z2r,z1l]; x2l:=min(x2l',x2l+.5u);
425 (x4l',y4l)=whatever[z4r,z5l]; x4l:=min(x4l',x4l+.5u);
426 filldraw stroke z1e{x2-x1,10(y2-y1)}
427 ...pulled_arc.e(2,3) & pulled_arc.e(3,4)...{up}z5e; % arc
428 pos6(.3[fine.breadth,cap_hair],0); x6r=x1r; top y6=h+o;
429 x1r-x1'=2cap_curve-fine; y1'=y1;
430 path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..z2{left};
431 numeric t; t=xpart(upper_arc intersectiontimes (z6l--z1'));
432 filldraw z1r--z6r--z6l--subpath(t,0) of upper_arc--cycle; % barb
433 else: beginchar(n,11.5u#,cap_height#,0);
434 italcorr cap_height#*slant-.5u#;
436 pickup fine.nib; pos1(1.2flare,80); pos2(slab,90);
437 pos3(cap_curve,180); pos4(slab,270); pos5(flare,275);
438 rt x1r=hround(w-1.1u); x2=x4=.5w+1.25u;
439 lft x3r=hround max(u,2u-.5cap_curve); rt x5r=hround(w-.9u);
440 top y1r=vround .95h+o; top y2r=h+o; y3=.5h;
441 bot y4r=-o; bot y5r=vround .08h-o; y5l:=good.y y5l; x5l:=good.x x5l;
442 filldraw stroke rterm.e(2,1,right,.9,4) & super_arc.e(2,3)
443 & super_arc.e(3,4) & term.e(4,5,right,.8,4); fi % arc and terminals
444 math_fit(-.3cap_height#*slant-.5u#,.5ic#);
445 penlabels(1,1',2,3,4,5,6); endchar;
449 def D_(expr n, rotation_angle, moved_a, moved_b)=
450 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
451 cmchar "The letter D";
452 beginchar(n,13.5u#,cap_height#,0);
453 italcorr .7cap_height#*slant-.5u#;
454 adjust_fit(cap_serif_fit#,0);
455 pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
456 lft x1l=lft x2l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
457 filldraw stroke z1e--z2e; % stem
458 penpos3(cap_band,90); penpos4(cap_band,90);
459 penpos5(cap_curve-stem_corr,0);
460 penpos6(cap_band,-90); penpos7(cap_band,-90);
461 z3r=top z1; y4=y3; y5=.51[y4,y6]; y6=y7;
462 z7r=bot z2; x4=x6=.5w+.25u; x5r=hround(w-u);
463 x4l:=x6l:=x4-.25cap_curve;
464 fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe
465 if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif
466 nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi % lower serif
467 math_fit(0,ic#-.5u#); penlabels(1,2,3,4,5,6,7); endchar;
470 width.E:=12u-width_adj;
471 def E_(expr n, rotation_angle, moved_a, moved_b)=
472 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
473 cmchar "The letter E";
474 beginchar(n,12u#-width_adj#,cap_height#,0);
475 italcorr cap_height#*slant-beak_jut#-.5u#;
476 adjust_fit(cap_serif_fit#,0);
477 h:=vround(h-stem_corr);
478 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
479 lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
480 filldraw stroke z1e--z2e; % stem
481 pickup crisp.nib; pos3(slab,90); pos4(hair,0);
482 top y3r=h; x3=x1; rt x4r=hround(w-u); y4=good.y(y3l-beak)-eps;
483 arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak
484 pos5(cap_bar,-90); pos6(hair,0);
485 top y5l=vround(.52[y2,y1]+.5cap_bar); x5=x1;
486 pos0(cap_bar,90); pos7(hair,0);
487 z0=z5; x6=x7; y6-y5l=y0l-y7;
488 if serifs: rt x6r=hround(w-4.4u+.5hair); y6=good.y(y5l+.6beak)+eps;
489 rt x9r=hround(w-.5u);
490 else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
491 arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0); % middle arm and serif
492 pos8(slab if not serifs:+2stem_corr fi,-90); pos9(hair,0);
493 bot y8r=0; x8=x2; y9=good.y(y8l+7/6beak)+eps;
494 arm(8,9,h,beak_darkness,1.5beak_jut); % lower arm and beak
495 if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif
496 nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi % lower serif
497 math_fit(0,.5ic#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
500 width.F:=11.5u-width_adj;
501 def F_(expr n, rotation_angle, moved_a, moved_b)=
502 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
503 cmchar "The letter F";
504 beginchar(n,11.5u#-width_adj#,cap_height#,0);
505 italcorr cap_height#*slant-beak_jut#-.25u#;
506 adjust_fit(cap_serif_fit#,0);
507 h:=vround(h-stem_corr);
508 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
509 lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
510 filldraw stroke z1e--z2e; % stem
511 pickup crisp.nib; pos3(slab,90); pos4(hair,0);
512 top y3r=h; x3=x1; rt x4r=hround(w-.75u); y4=good.y(y3l-beak)-eps;
513 arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak
514 pos5(cap_bar,-90); pos6(hair,0);
515 top y5l=vround(.5[y2,y1]+.5cap_bar); x5=x1;
516 pos0(cap_bar,90); pos7(hair,0);
517 z0=z5; x6=x7; y6-y5l=y0l-y7;
518 if serifs: rt x6r=hround(w-4u+.5hair); y6=good.y(y5l+.6beak)+eps;
519 rt x9r=hround(w-.5u);
520 else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
521 arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0); % middle arm and serif
522 if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif
523 dish_serif(2,1,c,1/3,cap_jut,d,1/3,1.25cap_jut); fi % lower serif
524 math_fit(0,ic#-2.5u#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
527 if serifs: width.G:=14u;
528 else: width.G:=12u; fi;
529 def G_(expr n, rotation_angle, moved_a, moved_b)=
530 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
531 cmchar "The letter G";
532 if serifs: beginchar(n,14u#,cap_height#,0);
533 italcorr cap_height#*slant-1.5u#-.5cap_serif_fit#;
534 adjust_fit(0,.5cap_serif_fit#);
535 pickup tiny.nib; pos0(cap_stem,0); pos7(cap_stem,0);
536 rt x0r=hround(w-2u); y0=good.y(.1[bar_height,x_height]+1); x7=x0;
538 if hefty: bot y7=0; pos5(cap_stem,0); x5=x0; top y5=tiny.top y0;
539 else: pos5(cap_hair,0); pos8(cap_stem,0);
540 y7=.5bar_height; z5l=z8l; z8=z7; x9=x8r; bot y9=0;
541 filldraw z8l{down}..{4(x9-x8),y9-y8}z9--z8r--cycle; fi % spur
542 pos1(cap_hair,0); pos2(cap_band,90);
543 pos3(cap_curve,180); pos4(cap_band,270);
544 rt x1r=hround(w-2u); lft x3r=hround u; x2=x4=.55[x3,x1];
545 top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
546 bot y1=min(vround max(.6h,x_height-.5vair),bot y2l-eps);
547 (x2l',y2l)=whatever[z2r,z1l]; x2l:=min(x2l',x2l+.5u);
548 (x4l',y4l)=whatever[z4r,z5l]; x4l:=min(x4l',x4l+.5u);
549 filldraw stroke z1e{x2-x1,10(y2-y1)}
550 ...pulled_arc.e(2,3) & pulled_arc.e(3,4)...z5e{up}; % arc
551 pos6(.3[fine.breadth,cap_hair],0); x6r=x1r; top y6=h+o;
552 x1r-x1'=2cap_curve-fine; y1'=y1;
553 path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..z2{left};
554 numeric t; t=xpart(upper_arc intersectiontimes (z6l--z1'));
555 filldraw z1r--z6r--z6l--subpath(t,0) of upper_arc--cycle; % barb
556 pickup tiny.nib; filldraw stroke z0e--z7e; % stem
557 dish_serif(0,7,a,1/3,max(cap_jut,2.25u),b,1/3,1.25u); % serif
558 math_fit(-.3cap_height#*slant-.5u#,ic#);
559 else: beginchar(n,12u#,cap_height#,0);
560 italcorr cap_height#*slant-.5u#;
562 pickup fine.nib; pos1(1.2flare,80); pos2(slab,90);
563 pos3(cap_curve,180); pos4(slab,270); pos5(flare,270);
564 rt x1r=hround(w-1.35u); x2=x4=.5w+u;
565 lft x3r=hround max(u,2u-.5cap_curve); rt x5l=hround(w-1.2u);
566 top y1r=vround .93h+o; top y2r=h+o; y3=.5h;
567 bot y4r=-o; bot y5r=vround .07h-o;
568 filldraw stroke rterm.e(2,1,right,.9,4)&super_arc.e(2,3)
569 & super_arc.e(3,4) & term.e(4,5,right,1,4); % arc and terminals
570 pos0(stem,0); pos7(stem,0);
571 z7r=z5r; x0=x7; top y0=1+vround .35[bar_height,x_height];
572 filldraw stroke z0e--z7e; % stem
573 pos8(cap_bar,90); pos9(cap_bar,90);
574 z0r=z9r; y8=y9; lft x8=hround x4;
575 filldraw stroke z8e--z9e; % bar
576 math_fit(-.3cap_height#*slant-.5u#,.5ic#); fi
577 penlabels(0,1,1',2,3,4,5,6,7,8,9); endchar;
580 width.H:=13u+width_adj;
581 def H_(expr n, rotation_angle, moved_a, moved_b)=
582 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
583 cmchar "The letter H";
584 beginchar(n,13u#+width_adj#,cap_height#,0);
585 italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
586 adjust_fit(cap_serif_fit#,cap_serif_fit#);
587 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
588 pos3(cap_stem,0); pos4(cap_stem,0);
589 lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
590 top y1=top y3=h; bot y2=bot y4=0;
591 filldraw stroke z1e--z2e; % left stem
592 filldraw stroke z3e--z4e; % right stem
593 penpos5(cap_bar,90); penpos6(cap_bar,90);
594 x5=x1; x6=x3; y5=y6=.52h;
595 fill stroke z5e--z6e; % bar
596 if serifs: numeric inner_jut;
597 if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
598 else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
599 dish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut); % upper left serif
600 dish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
601 dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut); % upper left serif
602 dish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut); fi % lower left serif
603 math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
606 width.I:=max(6u,4u+cap_stem);
607 def I_(expr n, rotation_angle, moved_a, moved_b)=
608 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
609 cmchar "The letter I";
610 beginchar(n,max(6u#,4u#+cap_stem#),cap_height#,0);
611 italcorr cap_height#*slant-.25u#;
612 adjust_fit(cap_serif_fit#,cap_serif_fit#);
613 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
614 lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0;
615 filldraw stroke z1e--z2e; % stem
616 if serifs: dish_serif(1,2,a,1/3,1.05cap_jut,b,1/3,1.05cap_jut); % upper serif
617 dish_serif(2,1,c,1/3,1.05cap_jut,d,1/3,1.05cap_jut); fi % lower serif
618 math_fit(0,.5ic#); penlabels(1,2); endchar;
622 def J_(expr n, rotation_angle, moved_a, moved_b)=
623 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
624 cmchar "The letter J";
625 beginchar(n,9u#,cap_height#,0);
626 italcorr cap_height#*slant-cap_serif_fit#
627 +.75cap_jut#-2.5u#+min(.5cap_stem#,u#);
628 adjust_fit(0,cap_serif_fit#);
629 pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
630 top y1=h; rt x1r=hround(w-2u); x2=x1; y2=.21h;
631 if serifs: pos3(vair,-90); pos4(cap_hair,-180);
632 pos5(flare+(cap_stem-stem),-180);
633 bot y3r=-o; x3=.5[x4,x2]; y5=1/6h; rt x5l=hround 2.75u; z5r=z4r;
634 filldraw stroke z1e--z2e&super_arc.e(2,3); % stem and arc
635 dish_serif(1,2,a,1/3,1.3cap_jut,b,1/3,.75cap_jut); % serif
636 pickup tiny.nib; bulb(3,4,5); % bulb
637 else: filldraw stroke z1e--z2e; % stem
638 pickup fine.nib; pos3(cap_stem',0); z3=z2;
639 pos4(flare,angle(6.5u,-h)); pos5(1.1flare,-100);
640 bot y4r=-o; x4r=.5[x5r,x3r]; lft x5r=hround.75u; bot y5r=vround.06h-o;
641 filldraw stroke z3e{down}....term.e(4,5,left,1,4); fi % arc and terminal
642 math_fit(0,.5ic#-.5u#); penlabels(1,2,3,4,5); endchar;
646 def K_(expr n, rotation_angle, moved_a, moved_b)=
647 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
648 cmchar "The letter K";
649 beginchar(n,13.5u#,cap_height#,0);
650 italcorr cap_height#*slant-.5u#;
651 adjust_fit(cap_serif_fit#,cap_serif_fit#);
652 numeric right_jut,stem[],alpha[];
653 if serifs: right_jut=.6cap_jut;
654 else: right_jut=.4tiny; fi
655 pickup tiny.nib; pos1(fudged.cap_stem,0); pos2(fudged.cap_stem,0);
656 lft x1l=lft x2l=hround max(2u,3u-.5fudged.cap_stem); top y1=h; bot y2=0;
657 filldraw stroke z1e--z2e; % stem
658 stem2=max(tiny.breadth,fudged.cap_stem-3stem_corr);
659 stem1=max(tiny.breadth,fudged.hair if hefty:-3stem_corr fi);
660 top y3=h; rt x3r=hround(r-letter_fit-u-right_jut);
661 bot y6=0; rt x6r=hround(r-letter_fit-.75u-right_jut);
663 alpha1=diag_ratio(1,.5(stem1-tiny),y3-y4,x3r-x4);
664 penpos3(alpha1*(stem1-tiny),0); penpos4(whatever,-90);
665 alpha2=diag_ratio(1,.5(stem2-tiny),y1-y6,x6r-x1);
666 penpos6(alpha2*(stem2-tiny),0);
667 forsuffixes $=l,r: y3'$=h; y6'$=0; z4$=z3'$+whatever*(z3-z4);
668 z5$=z6'$+whatever*(z1-z6)=whatever[z3,z4]; endfor
670 z3'r=z3r+penoffset z3-z4 of currentpen+whatever*(z3-z4);
671 % we have also |z3'l=z3l+penoffset z4-z3 of currentpen+whatever*(z3-z4)|;\]
672 z6'r=z6r+penoffset z1-z6 of currentpen+whatever*(z1-z6);
673 z6'l=z6l+penoffset z6-z1 of currentpen+whatever*(z1-z6);
674 fill z4r--diag_end(4r,3'r,1,.5,3'l,4l)--z4l--cycle; % upper diagonal
675 fill z5l--diag_end(5l,6'l,.5,1,6'r,5r)--z5r--cycle; % lower diagonal
676 if serifs: numeric inner_jut;
677 if rt x2r+cap_jut+.5u+1<=lft x6l-cap_jut: inner_jut=cap_jut;
678 else: rt x2r+cap_jut+.5u+1=lft x6l-inner_jut; fi
679 dish_serif(1,2,a,1/3,cap_jut,b,1/3,cap_jut); % upper stem serif
680 dish_serif(2,1,c,1/3,cap_jut,d,1/3,cap_jut); % lower stem serif
681 dish_serif(3,4,e,2/3,1.2cap_jut,f,1/2,right_jut)(dark); % upper diagonal serif
682 dish_serif(6,5,g,1/2,inner_jut,h,1/3,right_jut)(dark);fi % lower diagonal serif
683 math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
686 width.L:=11u-width_adj;
687 def L_(expr n, rotation_angle, moved_a, moved_b)=
688 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
689 cmchar "The letter L";
690 beginchar(n,11u#-width_adj#,cap_height#,0);
691 adjust_fit(cap_serif_fit#,0);
692 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
693 lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
694 filldraw stroke z1e--z2e; % stem
695 pickup crisp.nib; pos3(slab,-90); pos4(hair,0);
696 bot y3r=0; x3=x2; y4=y3l+7/6beak+eps; rt x4r=hround(w-.75u);
697 arm(3,4,e,1.2beak_darkness,beak_jut); % lower arm and beak
698 if serifs: dish_serif(1,2,a,1/3,cap_jut,b,1/3,1.25cap_jut); % upper serif
699 nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi % lower serif
700 math_fit(0,u#); penlabels(1,2,3,4); endchar;
703 width.M:=16u+width_adj;
704 def M_(expr n, rotation_angle, moved_a, moved_b)=
705 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
706 cmchar "The letter M";
707 beginchar(n,16u#+width_adj#,cap_height#,0);
708 italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
709 adjust_fit(cap_serif_fit#,cap_serif_fit#);
710 numeric stem[]; % thicknesses of the four strokes
711 stem1=hround(fudged.hair+stem_corr);
712 stem2=hround(fudged.cap_stem-4stem_corr);
713 stem3=hround(fudged.hair-stem_corr);
714 stem4=hround(fudged.cap_stem-3stem_corr);
715 if stem4<stem1: stem4:=stem1; fi
716 pickup tiny.nib; pos1(stem1,0); pos2(stem1,0);
717 pos3(stem4,0); pos4(stem4,0);
718 x1=x2; x3=x4; x1l=w-x3r; rt x3r=hround min(w-2u,w-3u+.5stem4);
719 top y1=top y3=h; bot y2=bot y4=0;
720 filldraw stroke z1e--z2e; % left stem
721 filldraw stroke z3e--z4e; % right stem
722 penpos5(stem2,0); penpos6(stem2,0); penpos7(stem3,0); penpos8(stem3,0);
723 x5l=x1; x6l=x7l; x8=lft x3l; x6-x5=x8-x7; y5=y8=h; y6=y7;
724 if hefty: y6=if monospace: vround 1/3h else: o fi;
725 numeric upper_notch,lower_notch;
726 upper_notch=h-cap_notch_cut; lower_notch=y6+cap_notch_cut;
727 x1'=rt x1r; z1'=whatever[z5l,z6l]; x3'=lft x3l; z3'=whatever[z7r,z8r];
728 z0=whatever[z5r,z6r]=whatever[z7l,z8l];
730 if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
731 {z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
732 if y3'<upper_notch: ...{up}(x3'-1,upper_notch){right} fi
733 ..z8r--diag_out(8r,1,8l,7l){z7-z8}
734 if y0<=lower_notch: ..{z7-z8}z0{z5-z6}..
735 else: ...{down}(x0+.5,lower_notch)--(x0-.5,lower_notch){up}... fi
736 {z5-z6}diag_in(6r,5r,1,5l)--cycle; % diagonals
737 else: y6=0; z0=whatever[z5r,z6r]=whatever[z7l,z8l];
738 fill z5l..{z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
739 ..z8r--diag_out(8r,1,8l,7l){z7-z8}..{z7-z8}z0{z5-z6}
740 ..{z5-z6}diag_in(6r,5r,1,5l)--cycle; fi % diagonals
741 if serifs: serif(1,2,a,1/3,-cap_jut); % upper left serif
742 dish_serif(2,1,b,1/2,cap_jut,c,1/2,cap_jut)(dark); % lower left serif
743 serif(3,4,d,1/3,cap_jut); % upper right serif
744 dish_serif(4,3,e,1/3,cap_jut,f,1/3,cap_jut); fi % lower right serif
745 math_fit(0,max(.5ic#-.5u#,0));
746 penlabels(0,1,1',2,3,3',4,5,6,7,8); endchar;
749 width.N:=13u+width_adj;
750 def N_(expr n, rotation_angle, moved_a, moved_b)=
751 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
752 cmchar "The letter N";
753 beginchar(n,13u#+width_adj#,cap_height#,0);
754 italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
755 adjust_fit(cap_serif_fit#,cap_serif_fit#);
756 numeric thin_stem; thin_stem=hround(fudged.hair+stem_corr);
757 pickup tiny.nib; pos1(thin_stem,0); pos2(thin_stem,0);
758 pos3(thin_stem,0); pos4(thin_stem,0);
759 pickup tiny.nib; top y1=top y3=h; bot y2=bot y4=0;
760 x1=x2; x3=x4; x1l=w-x3r;
761 rt x3r=hround min(w-2u,w-3u+.5fudged.cap_stem);
762 filldraw stroke z1e--z2e; % left stem
763 filldraw stroke z3e--z4e; % right stem
764 if hefty: penpos5(fudged.cap_stem,0); penpos6(fudged.cap_stem,0);
765 x5l=x1; x6r=x4; y5=h; y6=0;
766 numeric upper_notch,lower_notch;
767 upper_notch=h-cap_notch_cut; lower_notch=cap_notch_cut;
768 x1'=rt x1r; z1'=whatever[z5l,z6l]; x4'=lft x4l; z4'=whatever[z5r,z6r];
770 if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
771 {z6-z5}diag_in(5l,6l,1,6r)--z6r..
772 if y4'>lower_notch: {left}(x4'-1,lower_notch){up}... fi
773 {z5-z6}diag_in(6r,5r,1,5l)--cycle; % diagonal
774 else: penpos5(whatever,0); penpos6(whatever,90);
776 z7=z6l+(max(eps,cap_stem-3stem_corr-tiny),0) rotated (angle(z5l-z6l)-90);
777 z5r=z7+whatever*(z5l-z6l); z6r=z7+whatever*(z5l-z6l);
778 filldraw stroke z5e..z6e; fi % diagonal
779 if serifs: if hefty: serif(1,2,a,1/3,-cap_jut); % upper left serif
780 else: serif(5,6,a,1/3,-cap_jut); fi % upper left serif
781 dish_serif(2,1,b,1/2,cap_jut,c,1/2,cap_jut)(dark); % lower left serif
782 dish_serif(3,4,e,1/2,cap_jut,f,1/2,cap_jut)(dark); fi % upper right serif
783 math_fit(0,max(.5ic#-.5u#,0)); penlabels(1,1',2,3,4,4',5,6,7); endchar;
786 width.O:=14u-width_adj;
787 def O_(expr n, rotation_angle, moved_a, moved_b)=
788 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
789 cmchar "The letter O";
790 beginchar(n,14u#-width_adj#,cap_height#,0);
791 italcorr .7cap_height#*slant-.5u#;
793 penpos1(vair',90); penpos3(vround(vair+1.5vair_corr),-90);
794 penpos2(cap_curve,180); penpos4(cap_curve,0);
795 if monospace: x2r=hround 1.5u;
796 interim superness:=sqrt superness; % make |"O"|, not |"0"|
797 else: x2r=hround u; fi
798 x4r=w-x2r; x1=x3=.5w; y1r=h+o; y3r=-o;
799 y2=y4=.5h-vair_corr; y2l:=y4l:=.52h;
800 penstroke pulled_super_arc.e(1,2)(.5superpull)
801 & pulled_super_arc.e(2,3)(.5superpull)
802 & pulled_super_arc.e(3,4)(.5superpull)
803 & pulled_super_arc.e(4,1)(.5superpull) & cycle; % bowl
804 math_fit(-.3cap_height#*slant-.5u#,ic#-.5u#); penlabels(1,2,3,4); endchar;
808 def P_(expr n, rotation_angle, moved_a, moved_b)=
809 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
810 cmchar "The letter P";
811 beginchar(n,12u#,cap_height#,0);
812 italcorr .75cap_height#*slant-.5u#;
813 adjust_fit(cap_serif_fit#,0);
814 pickup tiny.nib; penpos1(cap_stem'-tiny,0); penpos2(cap_stem-tiny,0);
815 pos0(cap_stem',0); pos0'(cap_stem,0);
816 lft x1l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
817 x1l=x2l=x0l=x0'l; y0=y0'=y7;
818 penpos3(cap_band,90); penpos4(cap_band,90);
819 penpos5(cap_curve if hefty:-3stem_corr fi,0);
820 penpos6(.5[vair,cap_band],-90); penpos7(.5[vair,cap_band],-90);
821 z3r=top z1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
822 x7=x2; y7l=vround .5h; x4=x6=.5w+.75u; x5r=hround(w-u);
823 x4l:=x6l:=x4-.25cap_curve;
824 filldraw stroke z1e--z0e--z0'e--z2e; % stem
825 fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe
826 if serifs: nodish_serif(1,0,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif
827 dish_serif(2,0',c,1/3,cap_jut,d,1/3,cap_jut); fi % lower serif
828 math_fit(0,ic#-2.5u#); penlabels(0,1,2,3,4,5,6,7); endchar;
831 width.Q:=14u-width_adj;
832 def Q_(expr n, rotation_angle, moved_a, moved_b)=
833 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
834 cmchar "The letter Q";
835 beginchar(n,14u#-width_adj#,cap_height#,comma_depth#);
836 italcorr .7cap_height#*slant-.5u#;
838 numeric light_curve; light_curve=cap_curve-hround stem_corr;
839 penpos1(vair',90); penpos3(vair',-90);
840 penpos2(light_curve,180); penpos4(light_curve,0);
841 if monospace: x2r=hround 1.5u;
842 interim superness:=sqrt superness; % make |"Q"| like |"O"|
843 else: x2r=hround u; fi
844 x4r=w-x2r; x1=x3=.5w; y1r=h+o; y2=y4=.5h-vair_corr; y3r=-o;
845 penstroke pulled_super_arc.e(1,2)(.5superpull)
846 & pulled_super_arc.e(2,3)(.5superpull)
847 & pulled_super_arc.e(3,4)(.5superpull)
848 & pulled_super_arc.e(4,1)(.5superpull) & cycle; % bowl
850 if hefty: penpos5(1.2(.5[cap_bar,light_curve]),0); penpos6(1.2light_curve,0);
851 x5=.5w; x6r=hround(w-1.5u);
852 y5=vround .28h; y6=-d;
853 fill diag_end(6r,5r,.25,1,5l,6l)--diag_end(5l,6l,.5,1,6r,5r)--cycle; % tail
854 else: pos3'(vair,270); pos5(vair,180); pos6(vair,90);
855 pos7(cap_curve,85); penpos8(eps,180);
856 z3'=z3; x6=x3; top y6r=vround(.2h+.5vair);
857 lft x5r=hround(.5w-1.25u-.5vair); y5=.5[y3,y6];
858 bot y7l=-d; x7l=2/3[x6,x8]; y8=0; rt x8=hround(x4r+.1u);
859 filldraw stroke z3'e{left}...z5e{up}...z6e{right}
860 ..z7e{right}...z8e{up}; fi % tail
861 math_fit(-.3cap_height#*slant-.5u#,ic#);
862 penlabels(1,2,3,4,5,6,7,8); endchar;
865 width.R:=if serifs: 12u+.5max(2u,cap_curve) else: 12.5u-.5width_adj fi;
866 def R_(expr n, rotation_angle, moved_a, moved_b)=
867 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
868 cmchar "The letter R";
869 beginchar(n,if serifs: 12u#+.5max(2u#,cap_curve#)
870 else:12.5u#-.5width_adj# fi,cap_height#,0);
871 italcorr .75cap_height#*slant- if serifs: 1.75 else: .5 fi\\ u#;
872 adjust_fit(cap_serif_fit#,0);
873 pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
874 lft x1l=lft x2l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
875 filldraw stroke z1e--z2e; % stem
876 penpos3(cap_band,90); penpos4(cap_band,90);
877 penpos5(cap_curve if hefty:-3stem_corr fi,0);
878 penpos6(vair,-90); penpos7(vair,-90);
879 z3r=top z1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
880 x7=x2; y7l=vround(.5h+.5vair); x4=x6;
881 if serifs: x4=.5w-.5u; x5r=hround(w-2.25u);
882 else: x4=.5w+.5u; x5r=hround(w-u); fi
883 x4l:=x6l:=x4-.125cap_curve;
884 fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe
885 if serifs: pos6'(vair,-90); pos0(cap_stem,180);
886 pos8(cap_curve,180); pos9(vair,-90); pos10(hair,0);
887 z6'=z6; lft x0r=lft x8r=hround(x5-2/3u-.5cap_curve);
888 y8=1/3[y2,y7]; y0=3/5[y2,y7]; x9=.5[x8l,x10r];
889 bot y9r=-o; rt x10r=hround(w-.05u); y10=1/4[y2,y7];
890 filldraw stroke z6'e{right}..z0e---z8e....z9e{right}..z10e{up}; % tail
891 nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif
892 dish_serif(2,1,c,1/3,cap_jut,d,1/3,cap_jut); % lower serif
893 else: penpos8(cap_stem-2stem_corr,0); penpos9(cap_stem,0);
894 x8=x6+.5u; y8=y6; x9r=hround(w-.5u); y9=0;
895 fill z8l--diag_end(8l,9l,.5,1,9r,8r)--z8r--cycle; fi % tail
896 math_fit(0,.75ic#); penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;
900 def S_(expr n, rotation_angle, moved_a, moved_b)=
901 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
902 cmchar "The letter S";
903 beginchar(n,10u#,cap_height#,0);
904 italcorr cap_height#*slant-u#;
906 numeric theta; theta=90-angle(50u,h); slope:=-h/50u; % angle at middle
907 numeric s_slab; s_slab=if serifs:slab else:vround .2[slab,cap_stem] fi;
908 numeric ess'; ess'=max(fine.breadth,cap_ess);
909 pickup fine.nib; pos2(max(fine.breadth,s_slab-vround vair_corr),-90);
910 pos0(ess',theta); pos7(s_slab,-90);
911 x2+x7=2x0=w; x7-x2=if serifs: u else: 0 fi; top y2l=h+o; bot y7r=-o;
912 y0=.52h; lft x3l=hround u; rt x6r=hround(w-u);
913 x3r-x3l=x6r-x6l=hround .5[s_slab,ess']-fine;
914 ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r); y3=y3r;
915 ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r); y6=y6r;
916 filldraw stroke super_arc.e(2,3) & z3e{down}
917 ..z4e---z5e..z6e{down} & super_arc.e(6,7); % main stroke
918 if serifs: pos1(hair,180); pos8(hair,180);
919 rt x1l=hround(w-1.5u); lft x8r=hround u;
920 bot y1=vround 2/3h+1; top y8=vround 1/3h-1;
921 filldraw stroke z1e{x2-x1,10(y2-y1)}....{left}z2e; % upper arc
922 filldraw stroke z7e{left}....{up}z8e; % lower arc
923 path upper_arc, lower_arc;
924 upper_arc=z1{x2-x1,10(y2-y1)}....{left}z2;
925 lower_arc=z7{left}....{up}z8;
926 pos10(.3[fine.breadth,cap_hair],0); pos9(.3[fine.breadth,cap_hair],0);
927 x10r=x1l; top y10=top y2l; x9l=x8r; bot y9=bot y7r;
928 x1l-x1'=x8'-x8r=1.6cap_curve-fine; y1'=y1; y8'=y8;
929 numeric t; t=xpart(upper_arc intersectiontimes(z10l--z1'));
930 filldraw z1l--z10r--z10l--subpath(t,0) of upper_arc--cycle; % upper barb
931 t:=xpart(lower_arc intersectiontimes(z9r--z8'));
932 filldraw z8r--z9l--z9r--subpath(t,1) of lower_arc--cycle; % lower barb
933 else: pos1(1.2flare,-100); pos8(1.2flare,-100);
934 x1l=good.x(x1l+w-1.75u-rt x1); lft x8r=hround .8u;
935 top y1l=vround .93h+o; bot y8r=vround .1h-o;
936 filldraw stroke term.e(2,1,right,.9,4); % upper arc and terminal
937 filldraw stroke term.e(7,8,left,1,4); fi % lower arc and terminal
938 math_fit(0,.5ic#); penlabels(0,1,1',2,3,4,5,6,7,8,8',9,10); endchar;
941 width.T:=13u-width_adj;
942 def T_(expr n, rotation_angle, moved_a, moved_b)=
943 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
944 cmchar "The letter T";
945 beginchar(n,13u#-width_adj#,cap_height#,0);
946 italcorr cap_height#*slant-beak_jut#-.25u#;
948 h:=vround(h-2stem_corr);
949 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
950 lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0;
951 filldraw stroke z1e--z2e; % stem
952 pickup crisp.nib; pos3(slab,90); pos4(hair,0);
953 top y3r=h; x3=x1; rt x4r=hround(w-.65u); y4=good.y(y3l-beak)-eps;
954 arm(3,4,e,beak_darkness,.7beak_jut); % right arm and beak
955 pos5(hair,180); x5=w-x4; y5=y4;
956 arm(3,5,f,beak_darkness,-.7beak_jut); % left arm and beak
957 if serifs: dish_serif(2,1,c,1/3,1.414cap_jut,d,1/3,1.414cap_jut); % lower serif
958 nodish_serif(1,2,a,1/3,.5cap_jut,b,1/3,.5cap_jut); fi % upper bracketing
959 math_fit(-.75cap_height#*slant,ic#-2.5u#); penlabels(1,2,3,4,5,6); endchar;
962 width.U:=13u+0.5width_adj;
963 def U_(expr n, rotation_angle, moved_a, moved_b)=
964 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
965 cmchar "The letter U";
966 beginchar(n,13u#+.5width_adj#,cap_height#,0);
967 italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
968 if monospace: adjust_fit(cap_serif_fit#-.5u#,cap_serif_fit#-.5u#)
969 else: adjust_fit(cap_serif_fit#,cap_serif_fit#) fi;
970 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
971 pos2'(cap_stem,180); z2'=z2;
973 pos4(cap_hair,0); pos5(cap_hair,0);
974 x1=x2; x3=.5[x1,x5]; x4=x5; x1l=w-x5r;
975 top y1=top y5=h; y2=y4=1/3h; bot y3r=-o;
976 lft x1l=hround max(2u,3u-.5cap_stem);
977 filldraw stroke z1e--z2e; % left stem
978 filldraw stroke pulled_arc.e(2',3)
979 & pulled_arc.e(3,4)&z4e--z5e; % arc and right stem
980 if serifs: dish_serif(1,2,a,1/3,cap_jut,b,1/3,cap_jut); % left serif
981 dish_serif(5,4,c,1/2,cap_jut,d,1/2,cap_jut)(dark); fi % right serif
982 math_fit(-cap_serif_fit#-.3cap_height#*slant-min(cap_height#*slant,u#),
983 max(.5ic#-.5u#,0)); penlabels(1,2,3,4,5); endchar;
987 def V_(expr n, rotation_angle, moved_a, moved_b)=
988 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
989 cmchar "The letter V";
990 beginchar(n,13u#,cap_height#,0);
991 italcorr cap_height#*slant+.25u#;
992 adjust_fit(cap_serif_fit#,cap_serif_fit#);
993 numeric left_stem,right_stem,outer_jut,alpha;
994 left_stem=cap_stem-stem_corr;
995 right_stem=min(cap_hair if hefty:-2stem_corr fi,left_stem);
996 outer_jut=.75cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.25u; y1=y4=h;
997 x2-x1=x4-x3; x2l+apex_corr=x3l; y2=y3=-apex_o;
998 alpha=diag_ratio(2,right_stem,y1-y2,x4r-x1l-apex_corr);
999 penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
1000 penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
1001 z0=whatever[z1r,z2r]=whatever[z3l,z4l];
1002 if y0>cap_notch_cut: y0:=cap_notch_cut;
1003 fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
1004 --diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
1005 ...{down}z0+.5left--cycle; % left and right diagonals
1006 else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
1007 --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
1008 if serifs: numeric inner_jut; pickup tiny.nib;
1009 prime_points_inside(1,2); prime_points_inside(4,3);
1010 if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
1011 else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
1012 dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut); % left serif
1013 dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); fi % right serif
1014 math_fit(.75u#-cap_height#*slant,ic#-4u#); penlabels(0,1,2,3,4); endchar;
1018 def W_(expr n, rotation_angle, moved_a, moved_b)=
1019 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
1020 cmchar "The letter W";
1021 beginchar(n,18u#,cap_height#,0);
1022 italcorr cap_height#*slant+.25u#;
1023 adjust_fit(cap_serif_fit#,cap_serif_fit#);
1024 numeric stem[],outer_jut,upper_notch,alpha,mid_corr;
1025 outer_jut=.7cap_jut; x1l=w-x8r=l+letter_fit+outer_jut+.25u;
1026 stem1=fudged.cap_stem-stem_corr;
1027 stem4=min(fudged.hair if hefty:-2stem_corr fi,stem1);
1028 stem2=stem4 if hefty:-2stem_corr fi;
1029 stem3=stem1 if hefty:-2stem_corr fi;
1030 x2-x1=x4-x3=x6-x5=x8-x7; x2l+apex_corr=x3l; x6l+apex_corr=x7l;
1031 y1=y8=h; y2=y3=y6=y7=-apex_o; y4=y5=if monospace: vround .6 fi\\ h;
1032 mid_corr=if monospace or hefty:-apex_corr else: 1/3jut fi;
1033 alpha=diag_ratio(4,stem2-stem3+stem4,y1-y2,x8r-x1l+mid_corr-2apex_corr);
1034 penpos1(alpha*stem1,0); penpos2(alpha*stem1,0);
1035 penpos3(alpha*stem2,0); penpos4(alpha*stem2,0);
1036 penpos5(alpha*stem3,0); penpos6(alpha*stem3,0);
1037 penpos7(alpha*stem4,0); penpos8(alpha*stem4,0);
1038 x4l-x1l=floor(x4l-x1l+.5(x5r+mid_corr-x4r)); % |x5r+mid_corr| $\approx$ |x4r|
1039 z23=whatever[z1r,z2r]=whatever[z3l,z4l];
1040 z45=whatever[z3r,z4r]=whatever[z5l,z6l];
1041 z67=whatever[z5r,z6r]=whatever[z7l,z8l]; upper_notch=y4-cap_notch_cut;
1042 fill diag_end(1l,2l,1,1,3r,4r){z4-z3}
1043 ...if y45<upper_notch:(x45,upper_notch)+.5left{up}
1044 --(x45,upper_notch)+.5right{down} else: z45&z45 fi
1045 ...{z6-z5}diag_end(5l,6l,1,1,7r,8r)--diag_end(7r,8r,1,1,8l,7l){z7-z8}
1046 ...if y67>cap_notch_cut:(x67,cap_notch_cut)+.5right{down}
1047 --(x67,cap_notch_cut)+.5left{up} else: z67&z67 fi
1048 ...{z5-z6}special_diag_end(6,5,4,3){z3-z4}
1049 ...if y23>cap_notch_cut:(x23,cap_notch_cut)+.5right{down}
1050 --(x23,cap_notch_cut)+.5left{up} else: z23&z23 fi
1051 ...{z1-z2}diag_end(2r,1r,1,1,1l,2l)--cycle; % diagonals
1052 if serifs: numeric inner_jut[]; pickup tiny.nib;
1053 prime_points_inside(1,2); prime_points_inside(5,6); prime_points_inside(8,7);
1054 if monospace: inner_jut1=inner_jut4=1.5cap_jut;
1055 elseif hefty: inner_jut1=inner_jut4=cap_jut;
1056 else: fill diag_end(6r,5r,1,1,5l,6l)--.9[z5l,z6l]
1057 ..{z5-z6}.1[z5r,z6r]--cycle; % middle stem
1058 inner_jut2=.7inner_jut1; inner_jut4=1.1inner_jut3;
1059 if rt x1'r+cap_jut+.5u+1<=lft x5'l-.7cap_jut: inner_jut1=cap_jut;
1060 else: rt x1'r+inner_jut1+.5u+1=lft x5'l-inner_jut2; fi
1061 if rt x5'r+cap_jut+.5u+1<=lft x8'l-1.1cap_jut: inner_jut3=cap_jut;
1062 else: rt x5'r+inner_jut3+.5u+1=lft x8'l-inner_jut4; fi
1063 dish_serif(5',6,e,1/3,inner_jut2,f,1/2,inner_jut3); fi % middle serif
1064 dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut1); % left serif
1065 dish_serif(8',7,c,.6,inner_jut4,d,1/2,outer_jut)(dark); fi % right serif
1066 math_fit(.75u#-cap_height#*slant,ic#-2.5u#);
1067 penlabels(0,1,2,3,4,5,6,7,8,23,45,67); endchar;
1071 def X_(expr n, rotation_angle, moved_a, moved_b)=
1072 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
1073 cmchar "The letter X";
1074 beginchar(n,13u#,cap_height#,0);
1075 italcorr cap_height#*slant-.25u#;
1076 adjust_fit(cap_serif_fit#,cap_serif_fit#);
1077 numeric stem[],outer_jut,xjut,alpha[];
1078 stem1=cap_stem-2stem_corr; stem2=min(cap_hair,stem1);
1079 outer_jut=.75cap_jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi;
1080 x1l=l+letter_fit+.5u+outer_jut; x2r=r-letter_fit-u-outer_jut-xjut;
1081 x3l=l+letter_fit+.25u+outer_jut+xjut; x4r=r-letter_fit-.25u-outer_jut;
1083 alpha1=diag_ratio(1,stem1,h,x4r-x1l);
1084 alpha2=diag_ratio(1,stem2,h,x2r-x3l);
1085 penpos1(alpha1*stem1,0); penpos2(alpha2*stem2,0);
1086 penpos3(alpha2*stem2,0); penpos4(alpha1*stem1,0);
1087 if hefty: z0=whatever[z1,z4]=whatever[z2,z3];
1088 x12=x34=x0; y13=y24=y0;
1089 z12=whatever[z2l,z3l]; z13=whatever[z2l,z3l];
1090 z24=whatever[z2r,z3r]; z34=whatever[z2r,z3r];
1091 forsuffixes $=13,24,34: z$'=.1[z$,z0]; endfor
1092 fill diag_end(12,1r,.5,1,1l,13')--z13'--diag_end(13',3l,1,.5,3r,34')--z34'
1093 --diag_end(34',4l,.5,1,4r,24')--z24'
1094 --diag_end(24',2r,1,.5,2l,12)--z12--cycle; % diagonals
1095 else: fill diag_end(4r,1r,.5,1,1l,4l)
1096 --diag_end(1l,4l,.5,1,4r,1r)--cycle; % left diagonal
1097 fill diag_end(2l,3l,.5,1,3r,2r)
1098 --diag_end(3r,2r,.5,1,2l,3l)--cycle; fi % right diagonal
1099 if serifs: numeric inner_jut[]; pickup tiny.nib;
1100 prime_points_inside(1,4); prime_points_inside(2,3);
1101 prime_points_inside(3,2); prime_points_inside(4,1);
1102 if rt x1'r+cap_jut+.5u+1<=lft x2'l-cap_jut-xjut: inner_jut1=cap_jut;
1103 else: rt x1'r+inner_jut1+.5u+1=lft x2'l-inner_jut1-xjut; fi
1104 if rt x3'r+cap_jut+.5u+1<=lft x4'l-cap_jut-xjut: inner_jut2=cap_jut;
1105 else: rt x3'r+inner_jut2+.5u+1=lft x4'l-inner_jut2-xjut; fi
1106 dish_serif(1',4,a,1/3,outer_jut,b,2/3,inner_jut1); % upper left serif
1107 dish_serif(4',1,c,2/3,inner_jut2,d,1/3,outer_jut); % lower right serif
1108 dish_serif(2',3,e,2/3,inner_jut1+xjut,
1109 f,1/2,outer_jut+xjut)(dark); % upper right serif
1110 dish_serif(3',2,g,1/2,outer_jut+xjut,
1111 h,2/3,inner_jut2+xjut)(dark); fi % lower left serif
1112 math_fit(0,.5ic#); penlabels(0,1,2,3,4,12,13,24,34); endchar;
1116 def Y_(expr n, rotation_angle, moved_a, moved_b)=
1117 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
1118 cmchar "The letter Y";
1119 beginchar(n,13u#,cap_height#,0);
1120 italcorr cap_height#*slant+.45u#;
1121 adjust_fit(cap_serif_fit#,cap_serif_fit#);
1122 numeric left_stem,right_stem,outer_jut,dy,alpha;
1123 left_stem=cap_stem-stem_corr;
1124 right_stem=min(cap_hair if hefty:-2stem_corr fi,left_stem);
1125 outer_jut=.75cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.05u;
1126 x2l=x5l=hround(.5w-.5left_stem); x3r=x5r; y1=y4=h; y2=y3=y5=.4h;
1127 dy=y1-y2; alpha=((x2l-x1l)++dy)/dy;
1128 penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
1129 penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
1130 penpos5(left_stem,0); penpos6(left_stem,0); x5=x6; y6=0;
1131 z0=whatever[z1r,z2r]=whatever[z3l,z4l];
1132 if y0>y2+cap_notch_cut: y0:=y2+cap_notch_cut;
1133 fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)--z5r
1134 --diag_end(5r,6r,1,1,6l,5l)--z5l--diag_end(2l,1l,1,1,1r,2r){z2-z1}
1135 ...{down}z0+.5left--cycle; % diagonals and stem
1136 else: fill z0--diag_end(0,4l,1,1,4r,3r)--z5r
1137 --diag_end(5r,6r,1,1,6l,5l)--z5l
1138 --diag_end(2l,1l,1,1,1r,0)--cycle; fi % diagonals and stem
1139 if serifs: numeric inner_jut; pickup tiny.nib;
1140 prime_points_inside(1,2); prime_points_inside(4,3); prime_points_inside(6,5);
1141 if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
1142 else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
1143 dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut); % upper left serif
1144 dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); % upper right serif
1145 dish_serif(6',5,e,1/3,cap_jut,f,1/3,cap_jut); fi % lower serif
1146 math_fit(.5u#-cap_height#*slant,ic#-4u#);
1147 penlabels(0,1,2,3,4,5,6); endchar;
1151 def Z_(expr n, rotation_angle, moved_a, moved_b)=
1152 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
1153 cmchar "The letter Z";
1154 beginchar(n,11u#,cap_height#,0);
1155 italcorr cap_height#*slant-.5u#;
1157 numeric arm_thickness[],z_stem;
1158 if hefty: arm_thickness1=Vround(slab-vair_corr); arm_thickness2=slab;
1159 z_stem=.8[vair,cap_stem];
1160 else: arm_thickness1=slab; arm_thickness2=vround(slab+vair_corr);
1161 z_stem=.9[vair,cap_stem]; fi
1162 pickup tiny.nib; x3l=x4l=w-x1r=w-x2r; lft x3l=hround u;
1163 top y1=h; y2=min(y1,h-2/3arm_thickness1);
1164 bot y4=0; y3=max(y4,2/3arm_thickness2);
1165 numeric alpha; alpha=diag_ratio(1,z_stem-tiny,y2-y3,x2r-x3l);
1166 penpos1(alpha*(z_stem-tiny),0); penpos2(alpha*(z_stem-tiny),0);
1167 penpos3(alpha*(z_stem-tiny),0); penpos4(alpha*(z_stem-tiny),0);
1168 pair delta; delta=penoffset z3-z2 of currentpen;
1169 fill top lft z1l--z2l+delta---z3l+delta..lft z3l---lft z4l..bot z4l
1170 ---bot rt z4r--z3r-delta---z2r-delta..rt z2r---rt z1r..top z1r
1171 ---cycle; % diagonal
1172 pickup crisp.nib; pos5(arm_thickness1,90); pos6(hair,180);
1173 top y5r=h; x5=x1; lft x6r=hround 1.25u; y6=good.y(y5l-beak)-eps;
1174 arm(5,6,a,beak_darkness**.8,-.4beak_jut); % upper arm and beak
1175 pos7(arm_thickness2,-90); pos8(hair,0);
1176 bot y7r=0; x7=x4; rt x8r=hround(w-.9u); y8=good.y(y7l+1.2beak)+eps;
1177 arm(7,8,b,beak_darkness**.9,.6beak_jut); % lower arm and beak
1178 math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8); endchar;
1183 %%%input romspu; % uppercase specials (\AE, \OE, \O)
1186 % This file contains special letters and letter combinations,
1187 % compatible with the alphabet `{\tt romanu}'.
1189 % Codes \0035--\0037 are generated.
1192 def AE_(expr n, rotation_angle, moved_a, moved_b)=
1193 currenttransform:=identity yscaled taller_letters rotated rotation_angle shifted(moved_a,moved_b);
1194 cmchar "The ligature AE";
1195 beginchar(n,16u#,cap_height#,0);
1196 italcorr cap_height#*slant-beak_jut#-.5u#;
1197 adjust_fit(cap_serif_fit#,0);
1198 numeric left_stem,mid_stem,outer_jut,alpha;
1199 mid_stem=max(tiny.breadth,hround .9[mfudged.hair,mfudged.cap_stem]);
1200 pickup tiny.nib; pos1(mid_stem,0); pos2(mid_stem,0);
1201 lft x1l=lft x2l=hround(if monospace or hefty:.55 else:.5 fi\\w-.75u);
1203 filldraw stroke z1e--z2e; % stem
1204 pickup crisp.nib; pos3(slab,90); pos4(mfudged.hair,0);
1205 top y3r=h; x3=x1; rt x4r=hround(w-u); y4=good.y(y3l-beak)-eps;
1206 arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak
1207 pos5(cap_bar,-90); pos6(mfudged.hair,0); x5=x1;
1208 top y5l=vround(if hefty:.52 else:.48 fi\\[y2,y1]+.5cap_bar);
1209 pos0(cap_bar,90); pos7(mfudged.hair,0);
1210 z0=z5; x6=x7; y6-y5l=y0l-y7;
1211 if serifs and not(monospace and hefty): rt x6r=hround(w-3.65u+.5mfudged.hair);
1212 y6=good.y(y5l+.6beak)+eps; rt x9r=hround(w-.5u);
1213 else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
1214 arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0); % middle arm and serif
1215 pos8(slab if not serifs:+2stem_corr fi,-90);
1216 pos9(mfudged.hair,0); bot y8r=0; x8=x2; y9=good.y(y8l+7/6beak)+eps;
1217 arm(8,9,h,beak_darkness,1.5beak_jut); % lower arm and beak
1218 left_stem=if monospace:fudged.hair else: cap_hair fi if hefty: -3stem_corr fi;
1219 outer_jut=.8cap_jut; x11l=l+letter_fit+outer_jut+.5u; y11=0;
1220 x12=x1l-apex_corr-if monospace:2 fi\\u; y12=h;
1221 alpha=diag_ratio(1,.5left_stem,y12-y11,x12-x11l);
1222 penpos11(alpha*left_stem,0); penpos12(alpha*left_stem,0);
1223 fill diag_end(12l,11l,1,1,11r,12r)
1224 --diag_end(11r,12r,1,1,12l,11l)--cycle; % diagonal
1225 y10=h-slab; z10=whatever[z11,z12];
1226 fill z10--(x1,y10)--(x1,h)--z12--cycle; % link
1227 penpos13(whatever,angle(z2-z1)); z13=whatever[z11,z12];
1228 penpos14(cap_band,90); x14=x0; y13l=y14l; y13r=y14r;
1229 if hefty: y14r=.4h; else: y14=y0; fi
1230 penstroke z13e--z14e; % bar line
1231 if serifs: numeric inner_jut; pickup tiny.nib;
1232 prime_points_inside(11,12);
1233 if rt x11'r+cap_jut+.5u+1<=lft x2l-.75cap_jut: inner_jut=cap_jut;
1234 else: rt x11'r+inner_jut+.5u+1=lft x2l-.75inner_jut; fi
1235 dish_serif(11',12,i,1/2,outer_jut,j,.6,inner_jut)(dark); % lower left serif
1236 nodish_serif(1,2,a,1/3,cap_jut+x1l-x12,b,1/3,.5cap_jut); % upper serif
1237 nodish_serif(2,1,c,1/3,.75inner_jut,d,1/3,.5cap_jut); fi % lower middle serif
1238 penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14); endchar;
1245 k#:=-.5u#; kk#:=-1.5u#; kkk#:=-2u#; % three degrees of kerning
1246 define_pixels(k,kk,kkk);
1247 % ligtable "P": "T": "Y": "a" kern kk#, "A" kern kk#;
1248 % ligtable "F": "V": "W": if serifs: "a" kern kkk#, "A" kern kkk#,
1249 % else: "a" kern kk#, "A" kern kk#, fi
1250 % "K": "X": "o" kern k#, "O" kern k#, "c" kern k#, "C" kern k#,
1251 % "g" kern k#, "G" kern k#, "q" kern k#, "Q" kern k#;
1252 % ligtable "O": "D": "x" kern k#, "X" kern k#, "w" kern k#, "W" kern k#,
1253 % "a" kern k#, "A" kern k#, "v" kern k#, "V" kern k#, "y" kern k#, "Y"
1255 % ligtable "A": if serifs: "R": fi "c" kern k#, "C" kern k#,
1256 % "o" kern k#, "O" kern k#, "g" kern k#, "G" kern k#,
1257 % "u" kern k#, "U" kern k#, "q" kern k#, "Q" kern k#,
1258 % "L": "T" kern kk#, "t" kern kk#, "Y" kern kk#, "y" kern kk#,
1259 % "V" kern kkk#, "v" kern kkk#, "W" kern kkk#, "w" kern kkk#;
1260 % ligtable "I": "I" kern -k#; fi % Richard III
1318 %%radius#:=scaling_factor*80u#;
1319 %%define_pixels(radius);
1322 e[1]:= radius * dir (d[0]);
1325 halfdist:= radius +-+ half;
1326 d[i] := d[i-1] - 2 * angle (halfdist, half);
1327 e[i+1] := radius * dir d[i];
1328 f[i] := angle (e[i+1]-e[i]);
1330 d[0]:= 180 - 1/2 d[26];
1333 pair hi[],hii[],hiii[],hiv[];
1336 e[54]:= (radius+cap_height*taller_letters) * dir (d[54]);
1339 halfdist:= radius +-+ half;
1340 d[i] := d[i+1] - 2 * angle (halfdist, half);
1341 hi[i]:=radius*(dir(d[i+1]-angle (halfdist, half)));
1342 hii[i]:=(radius+cap_height*taller_letters)*(dir(d[i+1]-angle (halfdist, half)));
1343 hiii[i]:=radius*dir(d[i]);
1344 hiv[i]:=hiii[i]+hii[i]-hi[i];
1346 f[i] := angle (e[i]-e[i+1])+180;
1348 d[54]:= d[54] - 1/2*(180 + d[31]);
1351 F_(1,f[1],xpart e[1], ypart e[1]);
1352 A_(2,f[2],xpart e[2], ypart e[2]);
1353 C_(3,f[3],xpart e[3], ypart e[3]);
1354 U_(4,f[4],xpart e[4], ypart e[4]);
1355 L_(5,f[5],xpart e[5], ypart e[5]);
1356 T_(6,f[6],xpart e[6], ypart e[6]);
1357 A_(7,f[7],xpart e[7], ypart e[7]);
1358 S_(8,f[8],xpart e[8], ypart e[8]);
1359 A_(10,f[10],xpart e[10], ypart e[10]);
1360 R_(11,f[11],xpart e[11], ypart e[11]);
1361 T_(12,f[12],xpart e[12], ypart e[12]);
1362 I_(13,f[13],xpart e[13], ypart e[13]);
1363 S_(14,f[14],xpart e[14], ypart e[14]);
1364 I_(16,f[16],xpart e[16], ypart e[16]);
1365 N_(17,f[17],xpart e[17], ypart e[17]);
1366 F_(18,f[18],xpart e[18], ypart e[18]);
1367 O_(19,f[19],xpart e[19], ypart e[19]);
1368 R_(20,f[20],xpart e[20], ypart e[20]);
1369 M_(21,f[21],xpart e[21], ypart e[21]);
1370 A_(22,f[22],xpart e[22], ypart e[22]);
1371 T_(23,f[23],xpart e[23], ypart e[23]);
1372 I_(24,f[24],xpart e[24], ypart e[24]);
1373 C_(25,f[25],xpart e[25], ypart e[25]);
1374 AE_(26,f[26],xpart e[26], ypart e[26]);
1377 U_(31,f[31],xpart e[31], ypart e[31]);
1378 N_(32,f[32],xpart e[32], ypart e[32]);
1379 I_(33,f[33],xpart e[33], ypart e[33]);
1380 V_(34,f[34],xpart e[34], ypart e[34]);
1381 E_(35,f[35],xpart e[35], ypart e[35]);
1382 R_(36,f[36],xpart e[36], ypart e[36]);
1383 S_(37,f[37],xpart e[37], ypart e[37]);
1384 I_(38,f[38],xpart e[38], ypart e[38]);
1385 T_(39,f[39],xpart e[39], ypart e[39]);
1386 A_(40,f[40],xpart e[40], ypart e[40]);
1387 S_(41,f[41],xpart e[41], ypart e[41]);
1388 M_(43,f[43],xpart e[43], ypart e[43]);
1389 A_(44,f[44],xpart e[44], ypart e[44]);
1390 S_(45,f[45],xpart e[45], ypart e[45]);
1391 A_(46,f[46],xpart e[46], ypart e[46]);
1392 R_(47,f[47],xpart e[47], ypart e[47]);
1393 Y_(48,f[48],xpart e[48], ypart e[48]);
1394 K_(49,f[49],xpart e[49], ypart e[49]);
1395 I_(50,f[50],xpart e[50], ypart e[50]);
1396 A_(51,f[51],xpart e[51], ypart e[51]);
1397 N_(52,f[52],xpart e[52], ypart e[52]);
1398 A_(53,f[53],xpart e[53], ypart e[53]);
1400 beginchar(60,0,0,0);
1401 currenttransform:=identity;
1403 zl:= 0.5[e[31],e[1]];
1404 zr:= 0.5[e[27],e[54]];
1405 fill fullcircle scaled 3cap_curve shifted 0.5[e[31],e[1]];
1406 fill fullcircle scaled 3cap_curve shifted 0.5[e[27],e[54]];
1407 f[3]dvips:=0.5[e[31],e[1]];
1410 beginchar("S",0,0,0); endchar;
1411 beginchar("L",0,0,0); endchar;
1412 beginchar("C",0,0,0); endchar;
1413 beginchar("I",0,0,0); endchar;
1415 let endchar = ENDCHAR;
1416 beginchar(127,scaling_factor*radius#+cap_height#,
1417 scaling_factor*radius#+cap_height#,
1418 scaling_factor*radius#+cap_height#);
1419 fill unitsquare shifted (f[1]dvips+(scaling_factor*radius+cap_height,0));
1421 beginchar(126,scaling_factor*radius#+cap_height#,
1422 scaling_factor*radius#+cap_height#,
1423 scaling_factor*radius#+cap_height#);
1424 fill unitsquare shifted (f[2]dvips+(scaling_factor*radius+cap_height,0));
1426 beginchar(125,scaling_factor*radius#+cap_height#,
1427 scaling_factor*radius#+cap_height#,
1428 scaling_factor*radius#+cap_height#);
1429 fill unitsquare shifted (f[3]dvips+(scaling_factor*radius+cap_height,0));
1431 beginchar(124,scaling_factor*radius#+cap_height#,
1432 scaling_factor*radius#+cap_height#,
1433 scaling_factor*radius#+cap_height#);
1434 fill unitsquare shifted f[1]dvips;
1436 beginchar(123,scaling_factor*radius#+cap_height#,
1437 scaling_factor*radius#+cap_height#,
1438 scaling_factor*radius#+cap_height#);
1439 fill unitsquare shifted f[2]dvips;
1441 beginchar(122,scaling_factor*radius#+cap_height#,
1442 scaling_factor*radius#+cap_height#,
1443 scaling_factor*radius#+cap_height#);
1444 fill unitsquare shifted f[3]dvips;
1446 beginchar(121,0,0,0);
1447 fill unitsquare shifted f[1]dvips;
1449 beginchar(120,0,0,0);
1450 fill unitsquare shifted f[2]dvips;
1452 beginchar(119,0,0,0);
1453 fill unitsquare shifted f[3]dvips;
1455 beginchar(118,0,0,0);
1458 boundarychar:= ASCII "]";
1464 %"[": "S" |=:|> "S",
1544 font_size 2(scaling_factor*radius#+cap_height#);