%Boisik Latin letters in Roman form
%(plus blackboard-bold and sans-serif variants for math only!)

numeric bbs; bbs:=if cap_hair+eps>tiny-eps: 2 else 1 fi; %correction for BB letters 

charscription(14u,cap_height,0)(
numeric alpha, right_stem, left_stem;
lft x1l=2u; rt x2r=w-2u; bot y1l=bot y2r=0;
x3l=.5w; top y3l=h+apex_o;
left_stem=cap_hair;
right_stem=cap_stem;
alpha=diag_ratio(2,left_stem,y3l-y1l,x3l-x1l);
pos1(alpha*left_stem,0); pos2(alpha*right_stem,0);
pos1'(alpha*left_stem,0); pos2'(alpha*right_stem,0);
y4=y5=.35h; z1'l=z3l=z2'r;
z3'=whatever[z1'r,z1r]=whatever[z2'l,z2l]; y3'l=y3'r=y3'-.25[cap_hair,cap_stem]; 
z3'l=whatever[z3',z1r]; z3'r=whatever[z3',z2l];
pos4(cap_bar,angle(z3'-z1r)); pos5(cap_bar,angle(z3'-z2l));
z4l=whatever[z1'r,z3']; z5l=whatever[z2'l,z3'];
cap_serifs_bl(1l); cap_serifs_br(1r); cap_serifs_br_p(2r,.8); cap_serifs_bl(2l);
y3''=y1r.b if bold_face: -hair fi; z3''=whatever[z1r,z3'];
filldraw z1l+ser_boule*up..{left}z1l.a{left}..{right}z1l.c..diag_serif(1l,3l)---z3l---
         diag_serif(2r,3l)..{right}z2r.c..z2r.a{left}..z2r+ser_boule*up..
	 {left}z2l.a..{right}z2l.c..diag_serif(2l,3')---obl(5l,2l,4l)---
         obl(4l,5l,1l)---z3'' ..z1r.c{right}..
         z1r.a{left}..cycle;
infill z3'r..z3'l---obl(4r,3'l,5r)---obl(5r,4r,3'r)---cycle;
penlabels(1,1',2,2',3,3',4,5); labels(3'');
);

iff known chars.latin_A:
bskchar "The letter A";
beginchar(chars.latin_A,14u#,cap_height#,0); uni "0x0041";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_Aacute:
bskchar "The letter A with acute";
beginchar(chars.latin_Aacute,14u#,Acc_height#,0); uni "0x00C1";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2'l;
acute(100,101).capital;
endchar;

iff known chars.latin_Agrave:
bskchar "The letter A with grave";
beginchar(chars.latin_Agrave,14u#,Acc_height#,0); uni "0x00C0";
pickup tiny.nib;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
usechar;
x101=x3l+(x3l-x2'l);
grave(100,101).capital;
endchar;

iff known chars.latin_Adoublegrave:
bskchar "The letter A with doublegrave";
beginchar(chars.latin_Adoublegrave,14u#,Acc_height#,0); uni "0x0200";
pickup tiny.nib;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
usechar;
x102-x100=3u; .5[x101,x103]=x3l;
d_grave(100,101,102,103,whatever).capital;
endchar;

iff known chars.latin_Aumlaut:
bskchar "The letter A with umlaut";
beginchar(chars.latin_Aumlaut,14u#,Acc_height#,0); uni "0x00C4";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
.5[x100,x101]=x3l; x101-x100=2/3(x5-x4);
umlaut(100,101);
endchar;

iff known chars.latin_Acircumflex:
bskchar "The letter A with circumflex";
beginchar(chars.latin_Acircumflex,14u#,Acc_height#,0); uni "0x00C2";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x3l;
circumflex(100,101,102).capital;
endchar;

iff known chars.latin_Acaron:
bskchar "The letter A with caron";
beginchar(chars.latin_Acaron,14u#,Acc_height#,0); uni "0x01CD";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x1'r; bot y101l=cap_height+apex_o;
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Abreve:
bskchar "The letter A with breve";
beginchar(chars.latin_Abreve,14u#,Acc_height#+apex_o#,0); uni "0x0102";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x1'r; x102-x100=5u; bot y101l=top cap_height+apex_o;
breve(100,101,102).capital;
endchar;

iff known chars.latin_Ainvbreve:
bskchar "The letter A with inverted breve";
beginchar(chars.latin_Ainvbreve,14u#,Acc_height#,0); uni "0x0202";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x1'r; x102-x100=5u;
tieacc(100,101,102).capital;
endchar;

iff known chars.latin_Amacron:
bskchar "The letter A with macron";
beginchar(chars.latin_Amacron,14u#,Acc_height#-.1x_height#,0); uni "0x0100";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
macron(100,101);
endchar;

iff known chars.latin_Atilde:
bskchar "The letter A with tilde";
beginchar(chars.latin_Atilde,14u#,Acc_height#,0); uni "0x00C3";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101-x100=6u; bot y100=top y3l;
tilde(100,101).capital;
endchar;

iff known chars.latin_Aring:
bskchar "The letter A with ring";
beginchar(chars.latin_Aring,14u#,Acc_height#,0); uni "0x00C5";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=x3l; x100-x101=1.3u;
ring(100,101).capital;
endchar;

iff known chars.latin_Adotabove:
bskchar "The letter A with dot above";
beginchar(chars.latin_Adotabove,14u#,Acc_height#,0); uni "0x0226";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=x3l;
dotabove(100);
endchar;

iff known chars.latin_A_BB:
bskchar "The blackboard-bold letter A";
beginchar(chars.latin_A_BB,14u#,cap_height#,0); uni "0x1D538";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
numeric oblu.more; oblu.more:=2oblu;
bot y100=y2r.c; z100=whatever[z3l,z2r];
infill ifobl(3',3l,2r,2l,,more)---obl(100,3l,2r.c)..z2r---obl(2l,2r,3')---cycle;
labels(100);
endchar;

iff known chars.latin_Aogonek:
bskchar "The letter A with ogonek";
beginchar(chars.latin_Aogonek,14u#,cap_height#,.85desc_depth#); uni "0x0104";
adjust_fit(0,0);
pickup tiny.nib;
numeric alpha, right_stem, left_stem;
lft x1l=2u; rt x2r=w-2u; bot y1l=bot y2r=0;
x3l=.5w; top y3l=h+apex_o;
left_stem=cap_hair;
right_stem=cap_stem;
alpha=diag_ratio(2,left_stem,y3l-y1l,x3l-x1l);
pos1(alpha*left_stem,0); pos2(alpha*right_stem,0);
pos1'(alpha*left_stem,0); pos2'(alpha*right_stem,0);
pos6(stem,0); pos7(curve,0); pos8(hair,45); pos9(hair,160);
y4=y5=.35h; z1'l=z3l=z2'r;
z3'=whatever[z1'r,z1r]=whatever[z2'l,z2l]; y3'l=y3'r=y3'-.25[cap_hair,cap_stem]; 
z3'l=whatever[z3',z1r]; z3'r=whatever[z3',z2l];
pos4(cap_bar,angle(z3'-z1r)); pos5(cap_bar,angle(z3'-z2l));
z4l=whatever[z1'r,z3']; z5l=whatever[z2'l,z3'];
cap_serifs_bl(1l); cap_serifs_br(1r); cap_serifs_br_p(2r,.8); cap_serifs_bl(2l);
y3''=y1r.b if bold_face: -hair fi; z3''=whatever[z1r,z3'];
x6=x7l+1.5u=x2l.a; x8-x7l=3u; rt x9l=x8+1.5u;
bot y6=0; y7=-.5d; bot y8l=-d; y9=-2/3d;
filldraw z1l+ser_boule*up..{left}z1l.a{left}..{right}z1l.c..diag_serif(1l,3l)--z3l--
         diag_serif(2r,3l)..{right}z2r.c..z2r.a{left}..z2+ser_boule*up..
	 {left}z6r&z6r..z7r..z8r..{z6-z7}z9r..z9l{z7-z6}..z8l..z7l..{z6r-z7l}z6l..{right}z2l.c..diag_serif(2l,3')---obl(5l,2l,4l)---
         obl(4l,5l,1l)---z3'' ..z1r.c{right}..
         z1r.a{left}..cycle;
infill z3'r..z3'l---obl(4r,3'l,5r)---obl(5r,4r,3'r)---cycle;
penlabels(1,1',2,2',3,3',4,5,6,7,8,9); labels(3'');
endchar;

iff known chars.latin_A_SS:
bskchar "The sans-serif letter A";
beginchar(chars.latin_A_SS,14u#,cap_height#,0); uni "0x1D5A0";
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
numeric alpha, right_stem, left_stem;
lft x1l=2u; rt x2r=w-2u; bot y1l=bot y2r=0;
x3l=.5w; top y3l=h+apex_o;
left_stem=cap_hair;
right_stem=cap_stem;
alpha=diag_ratio(2,left_stem,y3l-y1l,x3l-x1l);
pos1(alpha*left_stem,0); pos2(alpha*right_stem,0);
pos1'(alpha*left_stem,0); pos2'(alpha*right_stem,0);
y4=y5=.35h; z1'l=z3l=z2'r;
z3'=whatever[z1'r,z1r]=whatever[z2'l,z2l]; y3'l=y3'r=y3'-.25[cap_hair,cap_stem]; 
z3'l=whatever[z3',z1r]; z3'r=whatever[z3',z2l];
pos4(cap_bar,angle(z3'-z1r)); pos5(cap_bar,angle(z3'-z2l));
z4l=whatever[z1'r,z3']; z5l=whatever[z2'l,z3'];
cap_serifs_bl(1l); cap_serifs_br(1r); cap_serifs_br_p(2r,.8); cap_serifs_bl(2l);
y3''=y1r.b if bold_face: -hair fi; z3''=whatever[z1r,z3'];
y100l=y100r=y101l=y101r=.5[y1l.b,y1];
z100l=whatever[z1l,z3l]; z100r=whatever[z1r,z4l];
z101l=whatever[z2l,z5l]; z101r=whatever[z2r,z3l];
oblu:=cap_bar;
filldraw z100l---z3l---z101r..z2..z101l---obl(5l,2l,4l)---obl(4l,5l,1l)---z100r...z1...cycle;
infill z3'r..z3'l---obl(4r,3'l,5r)---obl(5r,4r,3'r)---cycle;
penlabels(1,1',2,2',3,3',4,5,100,101); labels(3'');
endchar;

charscription(13u,cap_height,0)(
numeric tim[]; path p[];
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l= lft x2l= 2u;
pos3(ser_height,270); pos4(cap_hair,270); pos5(cap_curve,0);
pos6(.75cap_hair,90); pos7(ser_height,90);
pos8(.7ser_height,270); pos9(cap_hair,270); pos10(.95cap_curve,180);
x3=x7=x1r; y7=y6=com_height; rt x5r=w-u; y5=.45[y4,y6];
bot y3r=bot y4r=0; x6=.5[x7,x9]; x4=.5[x1r,x5l];
y8l+serif_o=y9l; top y9l=h+drop_stem; x8=x3; x9=.5[x6,x4];
x5-x10=.3cap_curve; y10=.45[y9,y6];
cap_serifs_tl(2l); cap_serifs_bl(1l);
p0=z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..z3r---z4r..z5r..z6r---z7;
p1=z7l{dir90}..{right}z6l..z5l..{left}z4l..{up}z3l;
p2=z2l.b{up}..{left}z2l.c..{right}z2l.a..z9l..z10l..z6---z7;
p3=z7r{dir-90}..{right}z6r..z10r..z9r{left}..{down}z8r;
z0=bsktouch(p0,2up,p2,2down);
tim1=xpart(p0 intersectiontimes (z0--(x0,bar_height)));
tim2=xpart(p2 intersectiontimes (z0--(x0,x_height)));
filldraw subpath(0,rundy(p0,tim1).zpet) of p0
         ..(reverse subpath(0,rundy(p2,tim2).zpet) of p2)--cycle;
infill p1---cycle;
infill p3---cycle;
penlabels(0,1,2,3,4,5,6,7,8,9,10);
);

iff known chars.latin_B:
bskchar "The letter B";
beginchar(chars.latin_B,13u#,cap_height#,0); uni "0x0042";
italcorr .5[x_height#,cap_height#]*slant-.25u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
math_fit(0,.75ic#);
endchar;

iff known chars.latin_B_BB:
bskchar "The blackboard-bold letter B";
beginchar(chars.latin_B_BB,13u#,cap_height#,0); uni "0x1D539";
italcorr .5[x_height#,cap_height#]*slant-.25u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
bot z100=(x1l,y1l.c); top z101=(x2l,y2l.c);
infill obl(2r,2l,1r)---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---obl(101,1l,2l.c)...z2l---cycle;
z102=bsktouch(subpath(3,4) of p2,bbs*dir-90,p3,dir60);
z103=bsktouch(subpath(5,6) of p0,bbs*dir90,p1,dir-60);
tim100-5=xpart(subpath(5,6) of p0 intersectiontimes (z103--(x103,y4r)));
tim101-3=xpart(subpath(3,4) of p2 intersectiontimes (z102--(x102,y9l+5)));
tim102=xpart(p3 intersectiontimes (z102--(x102,y10)));
tim103=xpart(p3 intersectiontimes ((x0-hair-1,y0)--(x0-hair-1,y10)));
tim104=xpart(p1 intersectiontimes ((x0-hair-1,y0)--(x0-hair-1,y5)));
tim105=xpart(p1 intersectiontimes (z4+u*right--(x4+u,y5)));
tim106=xpart(p1 intersectiontimes (z103--(x103,y5)));
infill subpath(rundy(p0,(tim100,bbw)),rundy(p0,tim1).zpet) of p0
       ..(reverse subpath(rundy(p2,(tim101,bbw)),rundy(p2,tim2).zpet) of p2)
       ..(reverse subpath(tim103,rundy(p3,(tim102,bbw)).zpet) of p3)
       ..subpath(tim104,rundy(p1,(tim106,bbw)).zpet) of p1..cycle;
labels(102,103);
endchar;

iff known chars.latin_B_SS:
bskchar "The sans-serif letter B";
beginchar(chars.latin_B_SS,13u#,cap_height#,0); uni "0x1D5A1";
italcorr .5[x_height#,cap_height#]*slant-.25u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
numeric tim[]; path p[];
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l= lft x2l= 2u;
pos3(1.5cap_stem,270); pos4(cap_hair,270); pos5(cap_curve,0);
pos6(cap_hair,90); pos7(1.5cap_stem,90);
pos8(ser_height,270); pos9(cap_hair,270); pos10(.95cap_curve,180);
x3=x7=x1r; y7=y6=com_height; rt x5r=w-u; y5=.45[y4,y6];
bot y3r=bot y4r=0; x6=.5[x7,x9]; x4=.5[x1r,x5l];
y8l+serif_o=y9l; top y9l=h+drop_stem; x8=x3; x9=.5[x6,x4];
x5-x10=.3cap_curve; y10=.45[y9,y6];
cap_serifs_tl(2l); cap_serifs_bl(1l);
p0=z1l.b{down}..z1..z3r---z4r..z5r..z6r---z7;
p1=z7l{dir90}..{right}z6l..z5l..{left}z4l..{up}z3l;
p2=z2l.b{up}..z2---z9l..z10l..z6---z7;
p3=z7r{dir-90}..{right}z6r..z10r..z9r{left}..{down}z8r;
z0=bsktouch(p0,2up,p2,2down);
tim1=xpart(p0 intersectiontimes (z0--(x0,bar_height)));
tim2=xpart(p2 intersectiontimes (z0--(x0,x_height)));
filldraw subpath(0,rundy(p0,tim1).zpet) of p0
         ..(reverse subpath(0,rundy(p2,tim2).zpet) of p2)--cycle;
infill p1---cycle;
infill p3---cycle;
penlabels(0,1,2,3,4,5,6,7,8,9,10);
endchar;

iff known chars.sign_baht:
bskchar "Baht sign";
beginchar(chars.sign_baht,13u#,Acc_height#,Acc_height#-cap_height#); uni "0x0E3F";
italcorr .5[x_height#,cap_height#]*slant-.25u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
numeric tim[]; path p[];
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=cap_height-drop_stem;
lft x1l= lft x2l= 2u;
pos3(ser_height,270); pos4(cap_hair,270); pos5(cap_curve,0);
pos6(.75cap_hair,90); pos7(ser_height,90);
pos8(.7ser_height,270); pos9(cap_hair,270); pos10(.95cap_curve,180);
pos11(hair,0); pos12(hair,0);
x3=x7=x1r; y7=y6=com_height; rt x5r=w-u; y5=.45[y4,y6];
bot y3r=bot y4r=0; x6=.5[x7,x9]; x4=.5[x1r,x5l];
y8l+serif_o=y9l; top y9l=cap_height+drop_stem; x8=x3; x9=.5[x6,x4];
x5-x10=.3cap_curve; y10=.45[y9,y6];
x11=x12=.5[x4,x9]; top y11=h; bot y12=-d;
cap_serifs_tl(2l); cap_serifs_bl(1l);
p0=z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..z3r---z4r..z5r..z6r---z7;
p1=z7l{dir90}..{right}z6l..z5l..{left}z4l..{up}z3l;
p2=z2l.b{up}..{left}z2l.c..{right}z2l.a..z9l..z10l..z6---z7;
p3=z7r{dir-90}..{right}z6r..z10r..z9r{left}..{down}z8r;
p4=z12l--z11l;
p5=z11r--z12r;
z0=bsktouch(p0,2up,p2,2down);
tim1=xpart(p0 intersectiontimes (z0--(x0,bar_height)));
tim2=xpart(p2 intersectiontimes (z0--(x0,x_height)));
(tim3,tim4)=p2 intersectiontimes p4;
(tim5,tim6)=p2 intersectiontimes p5;
(tim7,tim8)=p0 intersectiontimes p4;
(tim9,tim10)=p0 intersectiontimes p5;
(tim11,tim12)=p1 intersectiontimes p4;
(tim13-2,tim14)=subpath(2,infinity) of p1 intersectiontimes p4;
(tim15,tim16)=p1 intersectiontimes p5;
(tim17-2,tim18)=subpath(2,infinity) of p1 intersectiontimes p5;
(tim19,tim20)=p3 intersectiontimes p4;
(tim21-2,tim22)=subpath(2,infinity) of p3 intersectiontimes p4;
(tim23,tim24)=p3 intersectiontimes p5;
(tim25-2,tim26)=subpath(2,infinity) of p3 intersectiontimes p5;
filldraw subpath(0,rundy(p0,tim7).zpet) of p0
         ..(reverse (subpath(rundy(p5,tim10),infinity) of p5
	    ..subpath(0,rundy(p4,tim8).zpet) of p4))
	 ..subpath(rundy(p0,tim9),rundy(p0,tim1).zpet) of p0
         ..(reverse (subpath(0,rundy(p2,tim3).zpet) of p2
	    ..subpath(rundy(p4,tim4),infinity) of p4
	    ..subpath(0,rundy(p5,tim6).zpet) of p5
	    ..subpath(rundy(p2,tim5),rundy(p2,tim2).zpet) of p2))
	 --cycle;
infill subpath(0,rundy(p1,tim11).zpet) of p1
       ..subpath(rundy(p4,tim12).zpet,rundy(p4,tim14)) of p4
       ..subpath(rundy(p1,tim13),infinity) of p1---cycle;
infill subpath(rundy(p1,tim15),rundy(p1,tim17).zpet) of p1
       ..subpath(rundy(p5,tim18).zpet,rundy(p5,tim16)) of p5..cycle;
infill subpath(0,rundy(p3,tim19).zpet) of p3
       ..subpath(rundy(p4,tim20),rundy(p4,tim22).zpet) of p4
       ..subpath(rundy(p3,tim21),infinity) of p3---cycle;
infill subpath(rundy(p3,tim23),rundy(p3,tim25).zpet) of p3
       ..subpath(rundy(p5,tim26),rundy(p5,tim24).zpet) of p5..cycle;
penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12);
endchar;

charscription(13.3u,cap_height,0)(
path p[]; numeric tim[], sersh;
sersh=.15tiny;
pos1(cap_curve,0); pos2(1.1cap_hair,90); pos3(cap_hair,180); pos4(cap_hair,270);
lft x1l=u-o; rt x3r=w-u; y1=y3=.5h; x2=x4=.5[x1,x3]; bot y2l=-o; top y4l=h+o;
p0:=z1r{down}..z2r..z3r..z4r..{down}cycle;
p1:=z1l{down}..z2l..z3l..z4l..{down}cycle;
z5'=((.5w,y3+.2h)--(2w,y3+.2h)) intersectionpoint p0; tim1= ypart(((.5w,y3+.2h)--(2w,y3+.2h)) intersectiontimes reverse p0);
z5''=((.5w,y3-.2h+o)--(2w,y3-.2h+o)) intersectionpoint p0; tim2= ypart(((.5w,y3-.2h)--(2w,y3-.2h)) intersectiontimes p0);
z5'a=z5'+serif_o*right; z5'b=(x5'a-sersh,h+o); z5'c=(.35[x4,x3r],y3);
z5'd=(z5'c--z5'b) intersectionpoint p1; z5'e=.35[z5'b,z5'd];
tim3=ypart(((.5w,y5'e+.15ser_height)--(w,y5'e+.15ser_height)) intersectiontimes p1);
z5''a=z5''+serif_o*right; z5''b=(x5''a-sersh,0); z5''c=(.15[x4,x3r],y3);
z5''d=(z5''c--z5''b) intersectionpoint p1; z5''e=.5[z5''b,z5''d];
tim4=ypart(((.5w,y5''e-.25ser_height)--(w,y5''e-.25ser_height)) intersectiontimes p1);
p2:=counterclockwise (subpath(0,tim1) of reverse p0..z5'a--z5'b---z5'e..subpath (tim3,5) of p1..
         reverse (subpath(0,tim2) of p0..z5''a--z5''b---z5''e..
	 reverse subpath (1,tim4) of p1) & cycle);
bskcharscriptcmd;
filldraw p2;
penlabels(1,2,3,4); labels(5,5',5'a,5'b,5'c,5'd,5'e,5'',5''a,5''b,5''c,5''d,5''e,);
);

iff known chars.latin_C:
bskchar "The letter C";
beginchar(chars.latin_C,13.3u#,cap_height#,0); uni "0x0043";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
math_fit(-.5cap_height#*slant+.5u#,.75ic#);
endchar;

iff known chars.latin_Ccaron:
bskchar "The letter C with caron";
beginchar(chars.latin_Ccaron,13.3u#,Acc_height#,0); uni "0x010C";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4;
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Cacute:
bskchar "The letter C with acute";
beginchar(chars.latin_Cacute,13.3u#,Acc_height#,0); uni "0x0106";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4-u;
acute(100,101).capital;
endchar;

iff known chars.latin_Ccircumflex:
bskchar "The letter C with circumflex";
beginchar(chars.latin_Ccircumflex,13.3u#,Acc_height#,0); uni "0x0108";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4;
circumflex(100,101,102).capital;
endchar;

iff known chars.latin_Cdotabove:
bskchar "The letter C with dot above";
beginchar(chars.latin_Cdotabove,13.3u#,Acc_height#,0); uni "0x010A";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x4;
dotabove(100);
endchar;

iff known chars.latin_C_BB:
bskchar "The blackboard-bold letter C";
beginchar(chars.latin_C_BB,13.3u#,cap_height#,0); uni "0x2102";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
p100:=subpath(-1,1) of p0;
p101:=reverse subpath(-1,1) of p1;
oblu:=1.25bbw;
z100=bsktouch(subpath(0,1) of p100,bbs*up,p101,down);
z101=bsktouch(p100,bbs*down,subpath(0,1) of p101,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y1)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y4l+5)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y1)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y2l-5)));
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103),rundy(p101,tim101).zpet) of p101..cycle;
labels(100,101);
endchar;

iff known chars.sign_centigrade:
bskchar "Centigrade sign";
beginchar(chars.sign_centigrade,17.3u#,asc_height#+o#,0); uni "0x2103";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar shifted (4u*right);
save x,y;
pos1a(hair,0); pos1b(hair,90);
pos1c(hair,180); pos1d(hair,270);
z0=(3u,h-2u)=.5[z1a,z1c]=.5[z1b,z1d];
x1b=x1d; y1a=y1c; y1d-y1b=(x1c-x1a); x1a.l=x1; lft x1=u;
filldraw z1a.l{down}..z1b.l..z1c.l..z1d.l..cycle;
infill z1a.r{down}..z1b.r..z1c.r..z1d.r..cycle;
penlabels(1a,1b,1c,1d); labels(0);
endchar;

iff known chars.sign_copyright:
bskchar "Copyright sign (circled C)";
beginchar(chars.sign_copyright,15u#,asc_height#,0); uni "0x00A9";
italcorr x_height#*slant+.25u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric zv; zv=.66;
lft x6=u; x2=w-x6; y2=.5h; top y8=h;
lft x11=3u; x12+x11=w; x13=x11; x14=x12;
y11=y12; y13=y14; .5[y11,y13]=y2; y11-y13=spread;
circle_points(rule_thickness);
filldraw draw_circle.l;
infill draw_circle.r;
save x,y;
multiply(1.5*zv)(cap_curve,cap_hair,ser_height,serif_o);
usechar shifted -z5''c scaled zv shifted (.5WW+.33u,.5HH);
endchar;

iff known chars.sign_copyleft:
bskchar "Copyleft sign (circled turned C)";
beginchar(chars.sign_copyleft,15u#,asc_height#,0); uni "non";
italcorr x_height#*slant+.25u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric zv; zv=.66;
lft x6=u; x2=w-x6; y2=.5h; top y8=h;
lft x11=3u; x12+x11=w; x13=x11; x14=x12;
y11=y12; y13=y14; .5[y11,y13]=y2; y11-y13=spread;
circle_points(rule_thickness);
filldraw draw_circle.l;
infill draw_circle.r;
save x,y;
def bskcharscriptcmd:= 
    save counterclockwise; 
    vardef counterclockwise primary c:= reverse c 
    enddef 
enddef;
multiply(1.5*zv)(cap_curve,cap_hair,ser_height,serif_o);
usechar slanted (-slant) shifted -z5''c reflectedabout (origin,(0,h)) slanted (slant) scaled zv shifted (.5WW+slant*5u,.5HH);
endchar;

iff known chars.sign_euro:
bskchar "The Euro sign";
beginchar(chars.sign_euro,12u#,cap_height#,0); uni "0x20AC";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[], sersh;
sersh=.15tiny;
pos1(cap_curve,0); pos2(1.1cap_hair,90); pos3(cap_hair,180); pos4(cap_hair,270);
pos6(cap_bar,90); pos7(cap_bar,90);
pos8(.5[cap_stem,cap_hair],90); pos9(.5[cap_stem,cap_hair],90);
lft x1l=2u; rt x3r=w-o; y1=y3=.5h; x2=x4=.5[x1,x3]; bot y2l=-o; top y4l=h+o;
lft x8=.75u; lft x6=u; x9=x4; z6-z8=z7-z9; .5[y6,y8]=bot y1-o; y6l-y8r=cap_bar+cap_stem; 
z9-z8=whatever*dir(10);
p0:=z1r{down}..z2r..z3r..z4r..{down}cycle;
p1:=z1l{down}..z2l..z3l..z4l..{down}cycle;
z5'=((.5w,y3+.3h)--(2w,y3+.3h)) intersectionpoint p0; tim1= ypart(((.5w,y3+.3h)--(2w,y3+.3h)) intersectiontimes reverse p0);
z5''=((.5w,y3-.3h+o)--(2w,y3-.3h+o)) intersectionpoint p0; tim2= ypart(((.5w,y3-.3h)--(2w,y3-.3h)) intersectiontimes p0);
z5'a=z5'+serif_o*right; z5'b=(x5'a-sersh,h+o); z5'c=(.35[x4,x3r],y3);
z5'd=(z5'c--z5'b) intersectionpoint p1; z5'e=.35[z5'b,z5'd];
tim3=ypart(((.5w,y5'e+.15ser_height)--(w,y5'e+.15ser_height)) intersectiontimes p1);
z5''a=z5''+serif_o*right; z5''b=(x5''a-sersh,0); z5''c=(.15[x4,x3r],y3);
z5''d=(z5''c--z5''b) intersectionpoint p1; z5''e=.5[z5''b,z5''d];
tim4=ypart(((.5w,y5''e-.25ser_height)--(w,y5''e-.25ser_height)) intersectiontimes p1);
bskpoints(6,7,hair,hair); bskpoints(8,9,hair,hair);
p2:=subpath(0,tim1) of reverse p0..z5'a--z5'b{dir225}..subpath (tim3,5) of p1..
    reverse (subpath(0,tim2) of p0..z5''a--z5''b{dir135}..
    reverse subpath (1,tim4) of p1) & cycle;
p3:=z6l--z7ll;
p4:=z7r--z6r;
p5:=z8l--z9ll;
p6:=z9r--z8r;
(tim5,tim6)=subpath(0,1) of p2 intersectiontimes p3;
(tim7,tim8)=subpath(0,1) of p2 intersectiontimes p4;
(tim9-1,tim10)=subpath(1,length p2) of p2 intersectiontimes p4;
(tim11-1,tim12)=subpath(1,length p2) of p2 intersectiontimes p3;
(tim13-1,tim14)=subpath(1,length p2) of p2 intersectiontimes p6;
(tim15-1,tim16)=subpath(1,length p2) of p2 intersectiontimes p5;
(tim17-10,tim18)=subpath(10,length p2) of p2 intersectiontimes p5;
(tim19-10,tim20)=subpath(10,length p2) of p2 intersectiontimes p6;
filldraw subpath(0,rundy(p2,tim5).zpet) of p2
         ..subpath(rundy(p3,tim6),infinity) of p3
	 ..subpath(0,rundy(p4,tim8).zpet) of p4
	 ..subpath(rundy(p2,tim7),rundy(p2,tim9).zpet) of p2
	 ..subpath(rundy(p4,tim10), infinity) of p4
	 ..subpath(0,rundy(p3,tim12).zpet) of p3
	 ..subpath(rundy(p2,tim11),rundy(p2,tim13).zpet) of p2
	 ..subpath(rundy(p6,tim14),infinity) of p6
	 ..subpath(0,rundy(p5,tim16).zpet) of p5
	 ..subpath(rundy(p2,tim15),rundy(p2,tim17).zpet) of p2
	 ..subpath(rundy(p5,tim18),infinity) of p5
	 ..subpath(0,rundy(p6,tim20).zpet) of p6
	 ..subpath(rundy(p2,tim19),length p2) of p2..cycle;
penlabels(1,2,3,4,6,7,8,9); labels(5,5',5'a,5'b,5'c,5'd,5'e,5'',5''a,5''b,5''c,5''d,5''e,);
endchar;

iff known chars.latin_Ccedilla:
bskchar "The letter C with cedilla";
beginchar(chars.latin_Ccedilla,13.3u#,cap_height#,.65desc_depth#); uni "0x00C7";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[],po; numeric tim[], sersh;
sersh=.15tiny;
pos1(cap_curve,0); pos2(1.1cap_hair,90); pos3(cap_hair,180); pos4(cap_hair,270);
pos6(.5stem,0); pos7(.5stem,0); pos8(stem,0); pos9(.5stem,-110);
lft x1l=u-o; rt x3r=w-u; y1=y3=.5h; x2=x4=.5[x1,x3]; bot y2l=-o; top y4l=h+o;
p0:=z1r{down}..z2r..z3r..z4r..{down}cycle;
p1:=z1l{down}..z2l..z3l..z4l..{down}cycle;
z5'=((.5w,y3+.2h)--(2w,y3+.2h)) intersectionpoint p0; tim1= ypart(((.5w,y3+.2h)--(2w,y3+.2h)) intersectiontimes reverse p0);
z5''=((.5w,y3-.2h+o)--(2w,y3-.2h+o)) intersectionpoint p1; tim2= ypart(((.5w,y3-.2h)--(2w,y3-.2h)) intersectiontimes p1);
z5'a=z5'+serif_o*right; z5'b=(x5'a-sersh,h+o); z5'c=(.35[x4,x3r],y3);
z5'd=(z5'c--z5'b) intersectionpoint p1; z5'e=.35[z5'b,z5'd];
tim3=ypart(((.5w,y5'e+.15ser_height)--(w,y5'e+.15ser_height)) intersectiontimes p1);
z5''a=z5''+serif_o*right; z5''b=(x5''a-sersh,0); z5''c=(.15[x4,x3r],y3);
z5''d=(z5''c--z5''b) intersectionpoint p1; z5''e=.5[z5''b,z5''d];
tim4=ypart(((.5w,y5''e-.25ser_height)--(w,y5''e-.25ser_height)) intersectiontimes p1);
x6l=x7l=x2; y6=0; y7=-hair; y8=-.5d;
rt x8r-lft x9r=4u; x6r-lft x9r=2u; y9r=-d;
p3:=z7r..{down}z8r..{left}z9r..{right}z9l..{up}z8l..z7l--z6l;
p4:=reverse(z6r{down}..subpath (rundy(p3,(0,curve)),infinity) of p3);
filldraw subpath(0,tim1) of reverse p0..z5'a--z5'b---z5'e
         ..subpath (tim3,length p1) of p1
	 & subpath(0,rundy(p1,1).zpet) of p1
	 ..subpath(rundy(p4,0),rundy(p4,infinity).zpet) of p4
	 ..reverse (subpath(0,tim2) of p0..z5''a--z5''b---z5''e
	 ..reverse subpath (rundy(p1,1),tim4) of p1) & cycle;
penlabels(1,2,3,4,6,7,8,9); labels(5,5',5'a,5'b,5'c,5'd,5'e,5'',5''a,5''b,5''c,5''d,5''e,);
penlabels();
endchar;

iff known chars.sign_cedi:
bskchar "Cedi sign";
beginchar(chars.sign_cedi,13.3u#,Acc_height#,Acc_height#-cap_height#); uni "0x20B5";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[], sersh;
sersh=.15tiny;
pos1(cap_curve,0); pos2(1.1cap_hair,90); pos3(cap_hair,180); pos4(cap_hair,270);
pos7(hair,0); pos8(hair,0);
lft x1l=u-o; rt x3r=w-u; y1=y3=.5cap_height; x2=x4=.5[x1,x3]; bot y2l=-o; top y4l=cap_height+o;
x7=x8=x4; top y7=h; bot y8=-d;
p0:=z1r{down}..z2r..z3r..z4r..{down}z1r;
p1:=z1l{up}..z4l..z3l..z2l..{up}z1l;
p2:=z7r--z8r;
p3:=z8l--z7l;
z5'=((.5w,y3+.2cap_height)--(2w,y3+.2cap_height)) intersectionpoint p0; 
tim1= ypart(((.5w,y3+.2cap_height)--(2w,y3+.2cap_height)) intersectiontimes p0);
z5''=((.5w,y3-.2cap_height+o)--(2w,y3-.2cap_height+o)) intersectionpoint p0; 
tim2= ypart(((.5w,y3-.2cap_height)--(2w,y3-.2cap_height)) intersectiontimes p0);
z5'a=z5'+serif_o*right; z5'b=(x5'a-sersh,cap_height+o); z5'c=(.35[x4,x3r],y3);
z5'd=(z5'c--z5'b) intersectionpoint p1; z5'e=.35[z5'b,z5'd];
tim3=ypart(((.5w,y5'e+.15ser_height)--(w,y5'e+.15ser_height)) intersectiontimes p1);
z5''a=z5''+serif_o*right; z5''b=(x5''a-sersh,0); z5''c=(.15[x4,x3r],y3);
z5''d=(z5''c--z5''b) intersectionpoint p1; z5''e=.5[z5''b,z5''d];
tim4=ypart(((.5w,y5''e-.25ser_height)--(w,y5''e-.25ser_height)) intersectiontimes p1);
(tim5-2,tim6)=subpath(2,infinity) of p0 intersectiontimes p2;
(tim7-2,tim8)=subpath(2,infinity) of p0 intersectiontimes p3;
(tim9,tim10)=subpath(0,3) of p0 intersectiontimes p2;
(tim11-2,tim12)=subpath(2,infinity) of p1 intersectiontimes p2;
(tim13-2,tim14)=subpath(2,infinity) of p1 intersectiontimes p3;
(tim15,tim16)=subpath(0,2) of p1 intersectiontimes p3;
(tim17,tim18)=subpath(0,2) of p1 intersectiontimes p2;
(tim19,tim20)=subpath(0,3) of p0 intersectiontimes p3;
filldraw z5'e---z5'b--z5'a..subpath(tim1,rundy(p0,tim5).zpet) of p0
         ..subpath(rundy(p2,tim6),rundy(p2,tim10).zpet) of p2
	 ..subpath(rundy(p0,tim9),tim2) of p0..z5''a--z5''b---z5''e
	 ..subpath(tim4,rundy(p1,tim11).zpet) of p1
	 ..subpath(rundy(p2,tim12),infinity) of p2
	 ..subpath(0,rundy(p3,tim14).zpet) of p3
	 ..subpath(rundy(p1,tim13),infinity) of p1
	 ..subpath(0,rundy(p1,tim15).zpet) of p1
	 ..subpath(rundy(p3,tim16),infinity) of p3
	 ..subpath(0,rundy(p2,tim18).zpet) of p2
	 ..subpath(rundy(p1,tim17),tim3) of p1..cycle;
infill subpath(rundy(p3,tim20),rundy(p3,tim8).zpet) of p3
       ..subpath(rundy(p0,tim7),infinity) of p0
       ..subpath(0,rundy(p0,tim19).zpet) of p0..cycle;
penlabels(1,2,3,4,7,8); labels(5,5',5'a,5'b,5'c,5'd,5'e,5'',5''a,5''b,5''c,5''d,5''e,);
endchar;

iff known chars.latin_C_SS:
bskchar "The sans-serif letter C";
beginchar(chars.latin_C_SS,12.5u#,cap_height#,0); uni "0x1D5A2";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[];
pos1(cap_curve,0); pos2(cap_hair,90); pos3(cap_hair,180); pos4(1.1cap_hair,270);
lft x1l=u-o; rt x3r=w-u; y1=y3=.5h; x2=x4=.5[x1,x3]; bot y2l=-o; top y4l=h+o;
p0:=z1r{down}..z2r..z3r..z4r..{down}cycle;
p1:=z1l{down}..z2l..z3l..z4l..{down}cycle;
z5'=((.5w,y3+.2h)--(2w,y3+.2h)) intersectionpoint p0; 
tim1= ypart(((.5w,y3+.2h)--(2w,y3+.2h)) intersectiontimes reverse p0);
z5''=((.5w,y3-.2h+o)--(2w,y3-.2h+o)) intersectionpoint p0; 
tim2= ypart(((.5w,y3-.2h)--(2w,y3-.2h)) intersectiontimes p0);
tim3=ypart(((.5w,y3+.2h)--(w,y3+.2h)) intersectiontimes p1);
tim4=ypart(((.5w,y3-.2h)--(w,y3-.2h)) intersectiontimes p1);
filldraw subpath(0,tim1) of reverse p0
         ..subpath (tim3,5) of p1
	 ..reverse (subpath(0,tim2) of p0..reverse subpath (1,tim4) of p1) & cycle;
penlabels(1,2,3,4); labels(5,5',5'');
endchar;

charscription(15u,cap_height,0)(
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l= lft x2l= 2u;
pos3(ser_height,270); pos4(cap_hair,270); pos5(cap_curve,0);
pos6(cap_hair,90); pos7(.75ser_height,90);
x3=x7=x1r; y7r+serif_o=y6r; top y6r=h+drop_stem; rt x5r=w-u; y5=.52[y4,y6];
bot y3r=bot y4r=0; x6=x4 if not monospace:+u fi; x6=.5[x1r,x5l]-u;
cap_serifs_tl(2l); cap_serifs_bl(1l);
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..z3r---
         z4r..z5r..{left}z6r..z2l.a{left}..z2l.c{right}..{down}z2l.b---cycle;
infill z7l..{right}z6l..z5l..{left}z4l..z3l---cycle;
penlabels(1,2,3,4,5,6,7);
);

iff known chars.latin_D:
bskchar "The letter D";
beginchar(chars.latin_D,15u#,cap_height#,0); uni "0x0044";
italcorr x_height#*slant-.25u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
math_fit(0,.75ic#);
endchar;

iff known chars.latin_Dcaron:
bskchar "The letter D with caron";
beginchar(chars.latin_Dcaron,15u#,Acc_height#,0); uni "0x010E";
italcorr x_height#*slant-.25u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x101=.6[x2r,x6];
hacek(100,101,102).capital;
endchar;

iff known chars.latin_D_BB:
bskchar "The blackboard-bold letter D";
beginchar(chars.latin_D_BB,15u#,cap_height#,0); uni "0x1D53B";
italcorr x_height#*slant-.25u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
path p[]; numeric tim[];
bot z100=(x1l,y1l.c); top z101=(x2l,y2l.c);
infill obl(2r,2l,1r)---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---obl(101,1l,2l.c)...z2l---cycle;
p100=z4r{right}..z5r..{left}z6r;
p101=z6l{right}..z5l..{left}z4l;
z102=bsktouch(subpath (0,1) of p100,bbs*up,p101,down);
z103=bsktouch(subpath (0,1) of p101,bbs*up,p100,down);
tim100=xpart(p100 intersectiontimes (z102--(x102,y4r)));
tim101=xpart(p101 intersectiontimes (z102--(x102,y5)));
tim102=xpart(p100 intersectiontimes (z103--(x103,y6r)));
tim103=xpart(p101 intersectiontimes (z103--(x103,y5)));
oblu:=1.25bbw;
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103),rundy(p101,tim101).zpet) of p101..cycle;
labels(102,103);
endchar;

iff known chars.latin_D_SS:
bskchar "The sans-serif letter D";
beginchar(chars.latin_D_SS,14u#,cap_height#,0); uni "0x1D5A3";
italcorr x_height#*slant-.25u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l= lft x2l= 2u;
pos3(1.5cap_stem,270); pos4(cap_hair,270); pos5(cap_curve,0);
pos6(cap_hair,90); pos7(1.5cap_stem,90);
x3=x7=x1r; y7r+serif_o=y6r; top y6r=h+drop_stem; rt x5r=w-u; y5=.52[y4,y6];
bot y3r=bot y4r=0; x6=x4 if not monospace and ((substring(0,5) of font_identifier_) <> "BSKHC"):+u fi; x6=.5[x1r,x5l]-u;
cap_serifs_tl(2l); cap_serifs_bl(1l);
filldraw z1l.b{down}..z1..z3r---z4r..z5r..{left}z6r---z2..z2l.b---cycle;
infill z7l..{right}z6l..z5l..{left}z4l..z3l---cycle;
penlabels(1,2,3,4,5,6,7);
endchar;

charscription(15.5u,cap_height,0)(
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l= lft x2l= 2.5u;
pos3(ser_height,270); pos4(cap_hair,270); pos5(cap_curve,0);
pos6(cap_hair,90); pos7(.75ser_height,90);
pos8(bar,90); pos8'(bar,90); pos9(bar,90); pos9'(bar,90);
x3=x7=x1r; y7r+serif_o=y6r; top y6r=h+drop_stem; rt x5r=w-u; y5=.52[y4,y6];
bot y3r=bot y4r=0; x6=x4 if not monospace:+u fi; x6=.5[x1r,x5l]-u;
cap_serifs_tl(2l); cap_serifs_bl(1l);
x9-x8=4u if bold_face:+u fi; y9=y9'=y8=y8'=.8[bar_height,x_height]; lft x8=u;
x8'=x1l; x9'=x1r; bskpoints(8,9,hair,hair);
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..z3r
         ---z4r..z5r..{left}z6r..z2l.a{left}..z2l.c{right}..{down}z2l.b
	 ---obl(8'r,2l,8rr)---z8rr..z8l---obl(8'l,8l,1l)---cycle;
infill z7l..{right}z6l..z5l..{left}z4l..z3l---obl(9'l,1l,9l)---z9ll..z9r---obl(9'r,9r,2r)---cycle;
penlabels(1,2,3,4,5,6,7,8,8',9,9'); labels(8rr,9ll);
);

iff known chars.latin_Dstroke:
bskchar "The letter D with stroke";
beginchar(chars.latin_Dstroke,15.5u#,cap_height#,0); uni "0x0110";
italcorr x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_Eth:
bskchar "The letter Eth";
beginchar(chars.latin_Eth,15.5u#,cap_height#,0); uni "0x00D0";
italcorr x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

charscription(13.5u, cap_height,0)(
path p;
pos1(cap_stem,0); pos2(cap_stem,0);
pos5(cap_bar,90); pos6(cap_bar,90); pos5'(ser_height,90); pos6'(1.21beak,90);
bot y1=0; top y2=h; bot y3r=0; rt x3r=w-u;
top y4r=h; rt x4r=w-2.5u;
lft x1l=lft x2l=2u;
y5=y5'=y6=y6'=.52[y1,y2]; x5=x2r+cap_hair; x6=x2r+3/8(x4-x2r); x5'=x2r; x6'-x6=1.5u;
cap_serifs_tl(2l); cap_serifs_bl(1l); 
p=reverse arm_top_r_points(2r,4);
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         arm_bot_r_points(1r,3).alt---z5'l{dir80}..z5l---z6l..
	 z6'l+.5serif_o*left{down}..z6'l{dir87}..{dir93}z6'r..
	 {down}z6'r+.5serif_o*left..z6r---z5r..{dir100}z5'r---
	 p---z2l.a..{right}z2l.c..z2l.b---cycle;
penlabels(1,2,5,5',6,6');
);

iff known chars.latin_E:
bskchar "The letter E";
beginchar(chars.latin_E,13.5u#,cap_height#,0); uni "0x0045";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
math_fit(0,ic#);
endchar;

iff known chars.latin_Eacute:
bskchar "The letter E with acute";
beginchar(chars.latin_Eacute,13.5u#,Acc_height#,0); uni "0x00C9";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x101=x6-u;
acute(100,101).capital;
endchar;

iff known chars.latin_Ecaron:
bskchar "The letter E with caron";
beginchar(chars.latin_Ecaron,13.5u#,Acc_height#,0); uni "0x011A";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x101=x6;
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Egrave:
bskchar "The letter E with grave";
beginchar(chars.latin_Egrave,13.5u#,Acc_height#,0); uni "0x00C8";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x101=.5[x4d,x6];
grave(100,101).capital;
endchar;

iff known chars.latin_Edoublegrave:
bskchar "The letter E with double grave";
beginchar(chars.latin_Edoublegrave,13.5u#,Acc_height#,0); uni "0x0204";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x102-x100=3u; .5[x100,x101]=x2r;
d_grave(100,101,102,103,whatever).capital;
endchar;

iff known chars.latin_Ecircumflex:
bskchar "The letter E with circumflex";
beginchar(chars.latin_Ecircumflex,13.5u#,Acc_height#,0); uni "0x00CA";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x101=x6;
circumflex(100,101,102).capital;
endchar;

iff known chars.latin_Eumlaut:
bskchar "The letter E with umlaut";
beginchar(chars.latin_Eumlaut,13.5u#,Acc_height#,0); uni "0x00CB";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
.5[x100,x101]=x6l; x101-x100=x6'-x2r;
umlaut(100,101);
endchar;

iff known chars.latin_Emacron:
bskchar "The letter E with macron";
beginchar(chars.latin_Emacron,13.5u#,Acc_height#-.1x_height#,0); uni "0x0112";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
lft x100=rt x2r; x101-x100=5u;
macron(100,101);
endchar;

iff known chars.latin_Edotabove:
bskchar "The letter E with dot above";
beginchar(chars.latin_Edotabove,13.5u#,Acc_height#,0); uni "0x0116";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x100=x6;
dotabove(100);
endchar;

iff known chars.latin_Ebreve:
bskchar "The letter E with breve";
beginchar(chars.latin_Ebreve,13.5u#,Acc_height#,0); uni "0x0114";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x101=x6; x102-x100=5u;
bot bot y101l=cap_height;
breve(100,101,102).capital;
endchar;

iff known chars.latin_Einvbreve:
bskchar "The letter E with inverted breve";
beginchar(chars.latin_Einvbreve,13.5u#,Acc_height#+o#,0); uni "0x0206";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x101=x6; x102-x100=5u;
bot bot y100=cap_height+o;
tieacc(100,101,102).capital;
endchar;

iff known chars.latin_E_BB:
bskchar "The blackboard-bold letter E";
beginchar(chars.latin_E_BB,13.5u#,cap_height#,0); uni "0x1D53C";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
bot z100=(x1l,y1l.c); top z101=(x2l,y2l.c);
infill obl(2r,2l,1r)---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---obl(101,1l,2l.c)...z2l---cycle;
endchar;

iff known chars.latin_Eogonek:
bskchar "The letter E with ogonek";
beginchar(chars.latin_Eogonek,13.5u#,cap_height#,.85desc_depth#); uni "0x0118";
italcorr cap_height#*slant-1.75u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[];
pos1(cap_stem,0); pos2(cap_stem,0);
pos5(cap_bar,90); pos6(cap_bar,90); pos5'(ser_height,90); pos6'(1.21beak,90);
pos7(stem,0); pos8(curve,0); pos9(hair,45); pos10(hair,160);
bot y1=0; top y2=h; bot y3r=0; rt x3r=w-u;
top y4r=h; rt x4r=w-2.5u;
lft x1l=lft x2l=2u;
y5=y5'=y6=y6'=.52[y1,y2]; x5=x2r+cap_hair; x6=x2r+3/8(x4-x2r);
x5'=x2r; x6'-x6=1.5u;
x7=x8l+1.5u=x3a-o; x9-x8l=3u; rt x10l=x9+1.5u;
bot y7=0; y8=-.5d; bot y9l=-d; y10=-2/3d;
cap_serifs_tl(2l); cap_serifs_bl(1l); 
p0=reverse arm_top_r_points(2r,4);
p1=arm_bot_r_points(1r,3).alt;
p2=z7l{z8l-z7r}..z8l...z9l..{z7-z8}z10l..z10r{z8-z7}..z9r..z8r..z7r
   &z7r..z7+.5o*up;
(tim1,tim2)=p1 intersectiontimes p2;
(tim3,tim4-2)=p1 intersectiontimes subpath(2,infinity) of p2;
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         subpath(0,rundy(p1,(tim1,2hair)).zpet) of p1
	 ..subpath(rundy(p2,(tim2,2hair)),rundy(p2,tim4).zpet) of p2
	 ..subpath(rundy(p1,tim3),infinity) of p1---z5'l{dir80}..z5l---z6l..
	 z6'l+.5serif_o*left{down}..z6'l{dir87}..{dir93}z6'r..
	 {down}z6'r+.5serif_o*left..z6r---z5r..{dir100}z5'r---
	 p0---z2l.a..{right}z2l.c..z2l.b---cycle;
penlabels(1,2,5,5',6,6',7,8,9,10);
endchar;

iff known chars.latin_Ecedilla:
bskchar "The letter E with cedilla";
beginchar(chars.latin_Ecedilla,13.5u#,cap_height#,.65desc_depth#); uni "0x0228";
italcorr cap_height#*slant-1.75u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[];
pos1(cap_stem,0); pos2(cap_stem,0);
pos5(cap_bar,90); pos6(cap_bar,90); pos5'(ser_height,90); pos6'(1.21beak,90);
pos7(.5stem,0); pos8(.5stem,0); pos9(stem,0); pos10(.5stem,-110);
bot y1=0; top y2=h; bot y3r=0; rt x3r=w-u;
top y4r=h; rt x4r=w-2.5u;
lft x1l=lft x2l=2u;
y5=y5'=y6=y6'=.52[y1,y2]; x5=x2r+cap_hair; x6=x2r+3/8(x4-x2r); x5'=x2r; x6'-x6=1.5u;
cap_serifs_tl(2l); cap_serifs_bl(1l); 
p0=reverse arm_top_r_points(2r,4);
x7l=x8l=x6'; bot y7=0; y8=-hair; y9=-.5d;
rt x9r-lft x10r=4u; x7r-lft x10r=2u; y10r=-d;
p1:=z8r..{down}z9r..{left}z10r..{right}z10l..{up}z9l..z8l--z7l;
p2:=reverse(z7r{down}..subpath (rundy(p1,(0,curve)),infinity) of p1);
p3:=arm_bot_r_points(1r,3).alt;
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..{right}z7l+hair*left..subpath(rundy(p2,0),rundy(p2,infinity).zpet) of p2..z7r+stem*right---subpath(1,infinity) of p3---z5'l{dir80}..z5l---z6l..z6'l+.5serif_o*left{down}..z6'l{dir87}..{dir93}z6'r..{down}z6'r+.5serif_o*left..z6r---z5r..{dir100}z5'r---p0---z2l.a..{right}z2l.c..z2l.b---cycle;
penlabels(1,2,5,5',6,6',7,8,9,10);
endchar;

iff known chars.latin_E_SS:
bskchar "The sans-serif letter E";
beginchar(chars.latin_E_SS,12u#,cap_height#,0); uni "0x1D5A4";
italcorr cap_height#*slant-1.75u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_hair,-90); pos4(cap_hair,90);
pos5(cap_bar,90); pos6(cap_bar,90); pos5'(1.5cap_stem,90);
bot y1=0; top y2=h; bot y3r=0; rt x3r=w-u;
top y4r=h; rt x4r=w-2.5u;
lft x1l=lft x2l=2u;
y5=y5'=y6=y6'=.52[y1,y2]; x5=x2r+cap_hair; x6=x2r+4/8(x4-x2r); x5'=x2r; x6'-x6=u;
cap_serifs_tl(2l); cap_serifs_bl(1l);
z1'=(x1r,y3l); z2'=(x2r,y4l);
oblu:=cap_hair;
filldraw z1l.b{down}..z1---z3r+cap_stem*left...z3...z3l+cap_stem*left---obl(1',3l,5'l)
         ---z5'l{dir80}..z5l---z6l...z6'...z6r---z5r..{dir100}z5'r---obl(2',5'r,4l)
	 ---z4l+cap_stem*left...z4...z4r+cap_stem*left---z2..z2l.b---cycle;
penlabels(1,2,3,4,5,5',6); labels(1',2',6');
endchar;

charscription(18u,cap_height,0)(
numeric alpha;
path p; oblu.more:=3oblu;
pos1(cap_stem,0); pos2(cap_stem,0); 
pos5(cap_bar,90); pos6(cap_bar,90); pos5'(ser_height,90); pos6'(1.21beak,90);
bot y1=0; top y2=h; bot y3r=0; rt x3r=w-u;
top y4r=h; rt x4r=w-2u;
lft x1l=lft x2l=8.5u;
lft x7l=2u; y7l=y1;
alpha=diag_ratio(2,cap_hair,y2l-y7l,x2l-x7l);
pos7(alpha*cap_hair,0);
y5=y5'=y6=y6'=.475[y1,y2]; x5=x2r+cap_hair; x6=x2r+3/8(x4-x2r); x5'=x2r; x6'-x6=1.5u;
cap_serifs_tl(2l); cap_serifs_bl(1l); 
cap_serifs_bl(7l); cap_serifs_br(7r);
if monospace: 
   pos3(beak,-90); %Bottom arm
   z3c=(x3-2/3u,y3); z3d=(.5[x3e,x3c],y3e);
   z3e=z1r+(alt_cap_hair-currentbreadth,cap_jut); 
   z3f=z1r+.75ser_height*up;
   penlabels(3); labels(3c,3d,3e,3f);
   pos4(.65beak,90); %Top arm
   z4a=z2r+.55ser_height*down; z4b=z2r+(cap_jut,-cap_hair+currentbreadth);
   z4c=z4l+serif_o*left;
   penlabels(4); labels(4a,4b,4c);
else: p=reverse arm_top_r_points(2r,4);
fi; 
x2l'=x2l; z2l'=whatever[z2l+alpha*(cap_hair-.5currentbreadth)*right,z7];
pos9(cap_bar,90); y8r-y8l=cap_bar-tiny; .5[y8r,y8l]=y9=y5;
x1l-x9=x5-x5'; z8r=whatever[z7,z2l']; z8l=whatever[z7,z2l'];
y8'r=y8r; y8'l=y8l; x8'l=x8'r=.5[x8l,x8r]+(x5-x5');
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         if monospace: z1r---z3r+o*left..z3r+o*up---z3l..z3l+o*left{down}
	               ..z3c..z3d---z3e..{up}z3f
	 else: arm_bot_r_points(1r,3).alt fi
         ---z5'l{dir80}..z5l---z6l..z6'l+.5serif_o*left{down}..
	 z6'l{dir87}..{dir93}z6'r..{down}z6'r+.5serif_o*left..
	 z6r---z5r..{dir100}z5'r---
	 if monospace: z4a{up}..z4b---z4b+o*right..{dir-45}z4c..z4l
	               ---z4r+o*down..z4r+o*left---z2r
	 else: p fi
	 ---obl(2l,2r,7l)---
	 diag_serif(7l,2l)..{left}z7l.c..z7l.a{right}..
	 z7+ser_boule*up..{right}z7r.a..{left}z7r.c..
	 diag_serif(7r,2r)---obl(8l,7r,9l)---z9l{right}..(x1l,y5'l)---cycle;
oblu:=2oblu; if x8r+oblu>x9r: oblu:=f_obl; fi
infill (x1l,y5'r)..{left}z9r---obl(8r,9r,2l')---
       obl(2l',7l,1l).more--cycle;
penlabels(1,2,2l',5,5',6,6',7,8,8',9);
);

iff known chars.latin_AE:
bskchar "The ligature AE";
beginchar(chars.latin_AE,18u#,cap_height#,0); uni "0x00C6";
italcorr cap_height#*slant-u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_AEmacron:
bskchar "The ligature AE with macron";
beginchar(chars.latin_AEmacron,18u#,Acc_height#-.1x_height#,0); uni "0x01E2";
italcorr cap_height#*slant-u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
.5[x100,x101]=x6;
macron(100,101);
endchar;

iff known chars.latin_AEacute:
bskchar "The ligature AE with acute";
beginchar(chars.latin_AEacute,18u#,Acc_height#,0); uni "0x01FC";
italcorr cap_height#*slant-u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x101=x2;
acute(100,101).capital;
endchar;

iff known chars.latin_OE:
bskchar "The ligature OE";
beginchar(chars.latin_OE,19u#,cap_height#,0); uni "0x0152";
italcorr cap_height#*slant-1.5u#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
numeric alpha;
path p;
pos1(cap_stem,0); pos2(cap_stem,0); 
pos5(cap_bar,90); pos6(cap_bar,90); pos5'(ser_height,90); pos6'(1.21beak,90);
bot y1=0; top y2=h; bot y3r=0; rt x3r=w-u;
top y4r=h; rt x4r=w-2.5u;
lft x1l=lft x2l=8.5u;
pos7(cap_curve,0); lft x7l=u-o; y7=.5h;
y5=y5'=y6=y6'=.5[y1,y2]; x5=x2r+cap_hair; x6=x2r+3/8(x4-x2r); x5'=x2r; x6'-x6=1.5u;
cap_serifs_tl(2l); cap_serifs_bl(1l); 
if monospace: 
   pos3(beak,-90); %Bottom arm
   z3c=(x3-2/3u,y3); z3d=(.5[x3e,x3c],y3e);
   z3e=z1r+(alt_cap_hair-currentbreadth,cap_jut); 
   z3f=z1r+.75ser_height*up;
   penlabels(3); labels(3c,3d,3e,3f);
   pos4(.65beak,90); %Top arm
   z4a=z2r+.55ser_height*down; z4b=z2r+(cap_jut,-cap_hair+currentbreadth);
   z4c=z4l+serif_o*left;
   penlabels(4); labels(4a,4b,4c);
else: p=reverse arm_top_r_points(2r,4);
fi; 
filldraw z2l.a+o*up..z7l..z1l.a+o*down{right}..z1+ser_boule*up..
         if monospace: z1r---z3r+o*left..z3r+o*up---z3l..z3l+o*left{down}
	               ..z3c..z3d---z3e..{up}z3f
	 else: arm_bot_r_points(1r,3).alt fi
         ---z5'l{dir80}..z5l---z6l..
	 z6'l+.5serif_o*left{down}..z6'l{dir87}..{dir93}z6'r..
	 {down}z6'r+.5serif_o*left..z6r---z5r..{dir100}z5'r---
	 if monospace: z4a{up}..z4b---z4b+o*right..{dir-45}z4c..z4l
	               ---z4r+o*down..z4r+o*left---z2r
	 else: p fi
         ..z2..cycle;
infill z1l.b{down}..{left}z1l.c+top o*down..z7r..{right}z2l.c+top o*up..z2l.b---cycle;
penlabels(1,2,2l',5,5',6,6',7);
endchar;

charscription(12u,cap_height,0)(
path p;
pos1(cap_stem,0); pos2(cap_stem,0);
pos5(cap_bar,90); pos6(cap_bar,90); pos5'(ser_height,90); pos6'(1.21beak,90);
bot y1=0; top y2=h; 
top y3r=h; rt x3r=w-u;
lft x1l=lft x2l=2u;
y5=y5'=y6=y6'=.52[y1,y2]; x5=x2r+cap_hair; x6=x2r+3/8(x3-x2r); x5'=x2r; x6'-x6=1.5u;
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br_p(1r,1.1);
p=reverse arm_top_r_points(2r,3);
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..{left}z1r.c..z1r.b---z5'l{dir80}..z5l---
	 z6l..z6'l+.5serif_o*left{down}..z6'l{dir87}..{dir93}z6'r..
	 {down}z6'r+.5serif_o*left..z6r---z5r..{dir100}z5'r---
	 p--z2l.a..{right}z2l.c..z2l.b---cycle;
penlabels(1,2,5,5',6,6');
);

iff known chars.latin_F:
bskchar "The letter F";
beginchar(chars.latin_F,12u#,cap_height#,0); uni "0x0046";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
math_fit(0,ic#-4u#);
endchar;

iff known chars.latin_F_BB:
bskchar "The blackboard-bold letter F";
beginchar(chars.latin_F_BB,12u#,cap_height#,0); uni "0x1D53D";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
bot z100=(x1l,y1l.c); top z101=(x2l,y2l.c);
infill obl(2r,2l,1r)---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---obl(101,1l,2l.c)...z2l---cycle;
math_fit(0,ic#-3u#);
endchar;

iff known chars.latin_F_SS:
bskchar "The sans-serif letter F";
beginchar(chars.latin_F_SS,11u#,cap_height#,0); uni "0x1D5A5";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
path p;
pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_hair,90); 
pos5(cap_bar,90); pos6(cap_bar,90); pos5'(ser_height,90);
bot y1=0; top y2=h; 
top y3r=h; rt x3r=w-u;
lft x1l=lft x2l=2u;
y5=y5'=y6=y6'=.52[y1,y2]; x5=x2r+cap_hair; x6=x2r+4/8(x3-x2r); x5'=x2r; x6'-x6=u;
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br_p(1r,1.1);
z2'=(x2r,y3l);
oblu:=cap_hair;
filldraw z1l.b{down}..z1..z1r.b---z5'l{dir80}..z5l---
	 z6l...z6'...z6r---z5r..{dir100}z5'r---obl(2',5'r,3l)---z3l+cap_stem*left
	 ...z3...z3r+cap_stem*left---z2..z2l.b---cycle;
penlabels(1,2,3,5,5',6); labels(2',6');
math_fit(0,ic#-3u#);
endchar;

charscription(14.3u,cap_height,0)(
path p[]; numeric tim[], sersh;
sersh=.15tiny;
pos1(cap_curve,0); pos2(1.1cap_hair,90); pos3(cap_hair,180); pos4(cap_hair,270);
lft x1l=u-o; rt x3r=w-2.3u; y1=y3=.5h; x2=x4=.5[x1,x3]; bot y2l=-o; top y4l=h+o;
penpos6(beak,0); rt x6r=w-u;
p0:=z1r{down}..z2r..z3r..z4r..{down}cycle;
p1:=z1l{down}..z2l..z3l..z4l..{down}cycle;
tim1= ypart(((.5w,y3+.2h)--(2w,y3+.2h)) intersectiontimes reverse p0);
z5'=(x6,y3+.2h);
z5'a=z5'+serif_o*right; z5'b=(x5'a-sersh,h+o); z5'c=(.35[x4,x3r],y3);
z5'd=(z5'c--z5'b) intersectionpoint p1; z5'e=.35[z5'b,z5'd];
tim3=ypart(((.5w,y5'e+if monospace: .1 else: .15 fi \\ser_height)--(w,y5'e+if monospace: .15 else: .25 fi\\ser_height)) intersectiontimes p1);
x5''a=x6r-.5cap_stem; y5''a=y3-.2h; z5''=z5''a+serif_o*left;
y6=y5''a+cap_hair;
z5''b=(x5''a-sersh,cap_hair); z5''c=(.5[x4,x1r],y3);
z5''d=(z5''c--z5''b) intersectionpoint p1; z5''e=.5[z5''b,z5''d]; z5''f=z5''a+cap_stem*left;
tim4=ypart(((.5w,y5''e-.25ser_height)--(w,y5''e-.25ser_height)) intersectiontimes p1);
tim5=ypart((z5''f--(x5''f,0)) intersectiontimes p0);
if x6l>x5''f: x6l:=x5''f-(x6r-x5''a); fi
filldraw z1r{up}..z4r..{direction tim1 of reverse p0}z5'..z5'a--z5'b---z5'e
         ..subpath (tim3,5) of p1..
         reverse (subpath(0,tim5) of p0---z5''f..{left}z6l..z6l+serif_o*up
	 --z6r+serif_o*up..z6r{left}..z5''a---z5''b---z5''e..
	 reverse subpath (1,tim4) of p1) & cycle;
penlabels(1,2,3,4,6); labels(5,5',5'a,5'b,5'c,5'd,5'e,5'',5''a,5''b,5''c,5''d,5''e,5''f);
);

iff known chars.latin_G:
bskchar "The letter G";
beginchar(chars.latin_G,14.3u#,cap_height#,0); uni "0x0047";
italcorr cap_height#*slant-2u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
math_fit(-.5cap_height#*slant+.5u#,ic#);
endchar;

iff known chars.latin_Gacute:
bskchar "The letter G with acute";
beginchar(chars.latin_Gacute,14.3u#,Acc_height#,0); uni "0x01F4";
italcorr cap_height#*slant-2u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
.5[x100,x101]=x4;
acute(100,101).capital;
endchar;

iff known chars.latin_Gcaron:
bskchar "The letter G with caron";
beginchar(chars.latin_Gcaron,14.3u#,Acc_height#,0); uni "0x01E6";
italcorr cap_height#*slant-2u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4;
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Gcircumflex:
bskchar "The letter G with circumflex";
beginchar(chars.latin_Gcircumflex,14.3u#,Acc_height#,0); uni "0x011C";
italcorr cap_height#*slant-2u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4;
circumflex(100,101,102).capital;
endchar;

iff known chars.latin_Gcedilla:
bskchar "The letter G with cedilla (treated as comma)";
beginchar(chars.latin_Gcedilla,14.3u#,cap_height#,.75comma_depth#); uni "0x0122";
italcorr cap_height#*slant-2u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x2; top y100''r=-2o;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_Gdotabove:
bskchar "The letter G with dot above";
beginchar(chars.latin_Gdotabove,14.3u#,Acc_height#,0); uni "0x0120";
italcorr cap_height#*slant-2u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x4;
dotabove(100);
endchar;

iff known chars.latin_Gbreve:
bskchar "The letter G with breve";
beginchar(chars.latin_Gbreve,14.3u#,Acc_height#+o#,0); uni "0x011E";
italcorr cap_height#*slant-2u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4; x102-x100=5u; bot y101l=top y4l+o;
breve(100,101,102).capital;
endchar;

iff known chars.latin_G_BB:
bskchar "The blackboard-bold letter G";
beginchar(chars.latin_G_BB,14.3u#,cap_height#,0); uni "0x1D53E";
italcorr cap_height#*slant-2u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[];
usechar;
oblu.more:=2oblu;
infill obl(5''a,5''f,5''b)---obl(5''b,5''a,5''d).more
       ---obl(5''d,5''b,5''f)---obl(5''f,5''e,5''a)---cycle;
p100:=subpath(-1,1) of p0;
p101:=reverse subpath(-1,1) of p1;
oblu:=1.25bbw;
z100=bsktouch(subpath(0,1) of p100,bbs*up,p101,down);
z101=bsktouch(p100,bbs*down,subpath(0,1) of p101,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y1)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y4l+5)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y1)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y2l-5)));
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103),rundy(p101,tim101).zpet) of p101..cycle;
labels(100,101);
endchar;

iff known chars.latin_G_SS:
bskchar "The sans-serif letter G";
beginchar(chars.latin_G_SS,12.5u#,cap_height#,0); uni "0x1D5A6";
italcorr cap_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[], sersh;
sersh=.15tiny;
pos1(cap_curve,0); pos2(1.1cap_hair,90); pos3(cap_hair,180); pos4(cap_hair,270);
lft x1l=u-o; rt x3r=w-1.5u; y1=y3=.5h; x2=x4=.5[x1,x3]; bot y2l=-o; top y4l=h+o;
penpos6(cap_stem,0); rt x6r=w-u;
p0:=z1r{down}..z2r..z3r..z4r..{down}cycle;
p1:=z1l{down}..z2l..z3l..z4l..{down}cycle;
tim1= ypart(((.5w,y3+.2h)--(2w,y3+.2h)) intersectiontimes p0);
tim3= ypart(((.5w,y3+.2h)--(2w,y3+.2h)) intersectiontimes p1);
z5'=(x3r,y3+.2h);
y6=bar_height;
z5''b=(x6r,cap_hair); z5''c=(.5[x4,x1r],y3);
z5''d=(z5''c--z5''b) intersectionpoint p1; z5''e=.5[z5''b,z5''d]; z5''f=z5''a+cap_stem*left;
tim4=ypart(((.5w,y5''e-.25ser_height)--(w,y5''e-.25ser_height)) intersectiontimes p1);
tim5=ypart((z6l--(x6l,0)) intersectiontimes p0);
filldraw reverse subpath (tim1,length(p0)) of p0
         ..subpath (tim3,5) of p1..reverse (subpath(0,tim5) of p0---z6l--z6r---z5''b---z5''e
	 ..reverse subpath (1,tim4) of p1) & cycle;
penlabels(1,2,3,4,6); labels(5,5',5'a,5'b,5'c,5'd,5'e,5'',5''a,5''b,5''c,5''d,5''e,5''f);
endchar;

iff known chars.sign_guarani:
bskchar "Guarani sign";
beginchar(chars.sign_guarani,14.3u#,Acc_height#,Acc_height#-cap_height#); uni "0x20B2";
italcorr cap_height#*slant-2u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[], sersh;
sersh=.15tiny;
pos1(cap_curve,0); pos2(1.1cap_hair,90); pos3(cap_hair,180); pos4(cap_hair,270);
pos7(hair,0); pos8(hair,0);
lft x1l=u-o; rt x3r=w-2.3u; y1=y3=.5cap_height; x2=x4=.5[x1,x3]; bot y2l=-o; top y4l=cap_height+o;
penpos6(beak,0); rt x6r=w-u; x7=x8=x4; top y7=h; bot y8=-d;
p0:=z1r{down}..z2r..z3r..z4r..{down}z1r;
p1:=z1l{up}..z4l..z3l..z2l..{up}z1l;
p2:=z7r--z8r;
p3:=z8l--z7l;
tim1= ypart(((.5w,y3+.2cap_height)--(2w,y3+.2cap_height)) intersectiontimes p0);
z5'=(x6,y3+.2cap_height);
z5'a=z5'+serif_o*right; z5'b=(x5'a-sersh,cap_height+o); z5'c=(.35[x4,x3r],y3);
if xpart(point tim1 of p0) > x5'a: x5'a:=xpart(point tim1 of p0)+1 fi;
z5'd=(z5'c--z5'b) intersectionpoint p1; z5'e=.35[z5'b,z5'd];
tim3=ypart(((.5w,y5'e+if monospace: .1 else: .15 fi \\ser_height)--(w,y5'e+if monospace: .15 else: .25 fi\\ser_height)) intersectiontimes p1);
x5''a=x6r-.5cap_stem; y5''a=y3-.2h; z5''=z5''a+serif_o*left;
y6=y5''a+cap_hair;
z5''b=(x5''a-sersh,cap_hair); z5''c=(.5[x4,x1r],y3);
z5''d=(z5''c--z5''b) intersectionpoint p1; z5''e=.5[z5''b,z5''d]; z5''f=z5''a+cap_stem*left;
tim4=ypart(((.5w,y5''e-.25ser_height)--(w,y5''e-.25ser_height)) intersectiontimes p1);
tim2=ypart((z5''f--(x5''f,0)) intersectiontimes p0);
if x6l>x5''f: x6l:=x5''f-(x6r-x5''a); fi
(tim5-2,tim6)=subpath(2,infinity) of p0 intersectiontimes p2;
(tim7-2,tim8)=subpath(2,infinity) of p0 intersectiontimes p3;
(tim9,tim10)=subpath(0,3) of p0 intersectiontimes p2;
(tim11-2,tim12)=subpath(2,infinity) of p1 intersectiontimes p2;
(tim13-2,tim14)=subpath(2,infinity) of p1 intersectiontimes p3;
(tim15,tim16)=subpath(0,2) of p1 intersectiontimes p3;
(tim17,tim18)=subpath(0,2) of p1 intersectiontimes p2;
(tim19,tim20)=subpath(0,3) of p0 intersectiontimes p3;
filldraw z5'e---z5'b--z5'a..subpath(tim1,rundy(p0,tim5).zpet) of p0
         ..subpath(rundy(p2,tim6),rundy(p2,tim10).zpet) of p2
	 ..subpath(rundy(p0,tim9),tim2) of p0---z5''f..{left}z6l
	 ..z6l+serif_o*up--z6r+serif_o*up..z6r{left}..z5''a---z5''b---z5''e
	 ..subpath(tim4,rundy(p1,tim11).zpet) of p1
	 ..subpath(rundy(p2,tim12),infinity) of p2
	 ..subpath(0,rundy(p3,tim14).zpet) of p3
	 ..subpath(rundy(p1,tim13),infinity) of p1
	 ..subpath(0,rundy(p1,tim15).zpet) of p1
	 ..subpath(rundy(p3,tim16),infinity) of p3
	 ..subpath(0,rundy(p2,tim18).zpet) of p2
	 ..subpath(rundy(p1,tim17),tim3) of p1..cycle;
infill subpath(rundy(p3,tim20),rundy(p3,tim8).zpet) of p3
       ..subpath(rundy(p0,tim7),infinity) of p0
       ..subpath(0,rundy(p0,tim19).zpet) of p0..cycle;
penlabels(1,2,3,4,6,7,8); labels(5,5',5'a,5'b,5'c,5'd,5'e,5'',5''a,5''b,5''c,5''d,5''e,5''f);
endchar;

charscription(15u,cap_height,0)(
pos1(cap_stem,0); pos2(cap_stem,0);
pos3(cap_stem,0); pos4(cap_stem,0);
bot y1=0; top y2=h;
lft x1l=lft x2l=2u;
cap_serifs_tl(2l); cap_serifs_tr(2r); cap_serifs_bl(1l); cap_serifs_br(1r);
bot y3=0; top y4=h;
rt x3r=rt x4r=w-2u;
cap_serifs_tl(4l); cap_serifs_tr(4r); cap_serifs_bl(3l); cap_serifs_br(3r);
pos5(cap_hair,90); pos6(cap_hair,90);
pos7(ser_height,90); pos8(ser_height,90);
y5=y6=.52h; x5=x1r.a; x6=x3l.a;
y7=y8=y5; x7=x1r; x8=x3l;
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..z1r.c{left}..z1r.b---z7l{dir80}..z5l---z6l..
	 {dir-80}z8l---z3l.b{down}..{left}z3l.c..z3l.a{right}..
	 z3+ser_boule*up..{right}z3r.a..z3r.c{left}..z3r.b---z4r.b..
	 {right}z4r.c..z4r.a---z4l.a..{right}z4l.c..z4l.b---
	 z8r{dir-100}..z6r---z5r..{dir100}z7r---z2r.b..{right}z2r.c..
	 z2r.a---z2l.a..{right}z2l.c..z2l.b---cycle;
penlabels(1,2,3,4,5,6,7,8);
);

iff known chars.latin_H:
bskchar "The letter H";
beginchar(chars.latin_H,15u#,cap_height#,0); uni "0x0048";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
math_fit(0,.75ic#);
endchar;

iff known chars.latin_Hcaron:
bskchar "The letter H with caron";
beginchar(chars.latin_Hcaron,15u#,Acc_height#,0); uni "0x021E";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=.5w;
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Hcircumflex:
bskchar "The letter H with circumflex";
beginchar(chars.latin_Hcircumflex,15u#,Acc_height#,0); uni "0x0124";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=.5w;
circumflex(100,101,102).capital;
endchar;

iff known chars.latin_H_BB:
bskchar "The blackboard-bold letter H";
beginchar(chars.latin_H_BB,15u#,cap_height#,0); uni "0x210D";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
bot z100=(x1l,y1l.c); top z101=(x2l,y2l.c);
bot z102=(x3r,y3r.c); top z103=(x4r,y4r.c);
infill obl(2r,2l,1r)---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---obl(101,1l,2l.c)...z2l---cycle;
infill obl(4l,4r,3l)---obl(3l,4l,3r)---z3r...obl(102,3r.c,4r)---obl(103,3r,4r.c)...z4r---cycle;
endchar;

iff known chars.latin_Hstroke:
bskchar "The letter H with stroke";
beginchar(chars.latin_Hstroke,15u#,cap_height#,0); uni "0x0126";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0);
pos3(cap_stem,0); pos4(cap_stem,0);
bot y1=0; top y2=h;
lft x1l=lft x2l=2u;
cap_serifs_tl(2l); cap_serifs_tr(2r); cap_serifs_bl(1l); cap_serifs_br(1r);
bot y3=0; top y4=h;
rt x3r=rt x4r=w-2u;
cap_serifs_tl(4l); cap_serifs_tr(4r); cap_serifs_bl(3l); cap_serifs_br(3r);
pos5(cap_hair,90); pos6(cap_hair,90);
pos7(ser_height,90); pos8(ser_height,90);
y5=y6=.52h; x5=x1r.a; x6=x3l.a;
y7=y8=y5; x7=x1r; x8=x3l;
forsuffixes i=10,11,12,13,14,15: pos.i(bar,90); y[i]=.35[x_height,h]; endfor;
lft x10=.75u; x15=w-x10; x11=x1l; x12=x1r; x13=x3l; x14=x3r;
bskpoints(10,15,.5hair,.5hair);
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..z1r.c{left}..z1r.b---z7l{dir80}..z5l---z6l..
	 {dir-80}z8l---z3l.b{down}..{left}z3l.c..z3l.a{right}..
	 z3+ser_boule*up..{right}z3r.a..z3r.c{left}..z3r.b---
	 obl(14l,3r,15l)---z15ll..z15r---obl(14r,15r,4r)---
	 z4r.b..{right}z4r.c..z4r.a---z4l.a..{right}z4l.c..z4l.b---
	 obl(13r,4l,12r)---obl(12r,13r,2r)---
	 z2r.b..{right}z2r.c..z2r.a---z2l.a..{right}z2l.c..z2l.b---
	 obl(11r,2l,10r)---z10rr..z10l---obl(11l,10l,1l)---cycle;
infill obl(13l,12l,8r)---z8r{dir-100}..z6r---z5r..{dir100}z7r---obl(12l,7r,13l)---cycle;
penlabels(1,2,3,4,5,6,7,8,10,11,12,13,14,15); labels(15ll,10rr);
endchar;

iff known chars.latin_H_SS:
bskchar "The sans-serif letter H";
beginchar(chars.latin_H_SS,13.5u#,cap_height#,0); uni "0x1D5A7";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0);
pos3(cap_stem,0); pos4(cap_stem,0);
bot y1=0; top y2=h;
lft x1l=lft x2l=2u;
cap_serifs_tl(2l); cap_serifs_tr(2r); cap_serifs_bl(1l); cap_serifs_br(1r);
bot y3=0; top y4=h;
rt x3r=rt x4r=w-2u;
cap_serifs_tl(4l); cap_serifs_tr(4r); cap_serifs_bl(3l); cap_serifs_br(3r);
pos5(cap_hair,90); pos6(cap_hair,90);
pos7(1.5cap_stem,90); pos8(1.5cap_stem,90);
y5=y6=.52h; x5=x1r.a; x6=x3l.a;
y7=y8=y5; x7=x1r; x8=x3l;
filldraw z1l.b{down}..z1..z1r.b---z7l{dir80}..z5l---z6l..
	 {dir-80}z8l---z3l.b..z3..z3r.b---z4r.b..
	 z4..z4l.b---z8r{dir-100}..z6r---z5r..{dir100}z7r---z2r.b..z2..z2l.b---cycle;
penlabels(1,2,3,4,5,6,7,8);
endchar;

charscription(6u,cap_height,0)(
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h;
x1=x2=.5w;
cap_serifs_tl(2l); cap_serifs_tr(2r); cap_serifs_bl(1l); cap_serifs_br(1r);
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..z1r.c{left}..z1r.b---z2r.b..{right}z2r.c..
	 z2r.a---z2l.a..{right}z2l.c..z2l.b---cycle;
penlabels(1,2);
);

iff known chars.latin_I:
bskchar "The letter I";
beginchar(chars.latin_I,6u#,cap_height#,0); uni "0x0049";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
math_fit(0,.75ic#);
endchar;

iff known chars.latin_I_dotless:
bskchar "The letter I (dotless I for Small Caps)";
beginchar(chars.latin_I_dotless,6u#,cap_height#,0); uni "non";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_Iacute:
bskchar "The letter I with acute";
beginchar(chars.latin_Iacute,6u#,Acc_height#,0); uni "0x00CD";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
.5[x100,x101]=x2; x100r-x101=3u;
acute(100,101).capital;
endchar;

iff known chars.latin_Igrave:
bskchar "The letter I with grave";
beginchar(chars.latin_Igrave,6u#,Acc_height#,0); uni "0x00CC";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
.5[x100,x101]=x2;
grave(100,101).capital;
endchar;

iff known chars.latin_Idoublegrave:
bskchar "The letter I with double grave";
beginchar(chars.latin_Idoublegrave,6u#,Acc_height#,0); uni "0x0208";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x102-x100=3u;
d_grave(100,101,102,103,x1l).capital;
endchar;

iff known chars.latin_Imacron:
bskchar "The letter I with macron";
beginchar(chars.latin_Imacron,6u#,Acc_height#-.1x_height#,0); uni "0x012A";
italcorr (Acc_height#-.1x_height#)*slant+.2u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
macron(100,101);
endchar;

iff known chars.latin_Icircumflex:
bskchar "The letter I with circumflex";
beginchar(chars.latin_Icircumflex,6u#,Acc_height#,0); uni "0x00CE";
italcorr (cap_height#+.75u#)*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2;
circumflex(100,101,102).capital;
endchar;

iff known chars.latin_Iumlaut:
bskchar "The letter I with umlaut";
beginchar(chars.latin_Iumlaut,6u#,Acc_height#,0); uni "0x00CF";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
.5[x100,x101]=x2; x100-x101=3u;
umlaut(100,101);
endchar;

iff known chars.latin_Idotabove:
bskchar "The letter I with dot above";
beginchar(chars.latin_Idotabove,6u#,Acc_height#,0); uni "0x0130";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=x2;
dotabove(100);
endchar;

iff known chars.latin_Ibreve:
bskchar "The letter I with breve";
beginchar(chars.latin_Ibreve,6u#,Acc_height#,0); uni "0x012C";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2+o;
breve(100,101,102).capital;
endchar;

iff known chars.latin_Iinvbreve:
bskchar "The letter I with inverted breve";
beginchar(chars.latin_Iinvbreve,6u#,Acc_height#+o#,0); uni "0x020A";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2+o;
bot bot y100=cap_height+o;
tieacc(100,101,102).capital;
endchar;

iff known chars.latin_Itilde:
bskchar "The letter I with tilde";
beginchar(chars.latin_Itilde,6u#,Acc_height#,0); uni "0x0128";
italcorr Acc_height#*slant+.5u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101-x100=6u; bot y100=top y2+o;
tilde(100,101).capital;
endchar;

iff known chars.latin_Icaron:
bskchar "The letter I with caron";
beginchar(chars.latin_Icaron,6u#,Acc_height#,0); uni "0x01CF";
italcorr Acc_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2;
hacek(100,101,102).capital;
endchar;

iff known chars.latin_I_BB:
bskchar "The blackboard-bold letter I";
beginchar(chars.latin_I_BB,6u#,cap_height#,0); uni "0x1D540";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
bot z100=(x1l,y1l.c); top z101=(x2l,y2l.c);
infill obl(2r,2l,1r)---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---obl(101,1l,2l.c)...z2l---cycle;
endchar;

iff known chars.latin_Iogonek:
bskchar "The letter I with ogonek";
beginchar(chars.latin_Iogonek,7u#,cap_height#,.85desc_depth#); uni "0x012E";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p;
pos1(cap_stem,0); pos2(cap_stem,0);
pos3(stem,0); pos4(curve,0); pos5(hair,45); pos6(hair,160);
bot y1=0; top y2=h;
x1=x2=.5w;
x3=x4l+1.5u; x3=x1l; x5-x4l=3u; rt x6l=x5+1.5u;
bot y3=0; y4=-.5d; bot y5l=-d; y6=-2/3d;
cap_serifs_tl(2l); cap_serifs_tr(2r); cap_serifs_bl(1l); cap_serifs_br(1r);
p:=z3l{z4l-z3r}..z4l...z5l..{z3-z4}z6l..z6r{z4-z3}..z5r..z4r..z3r;
filldraw z1l.b{down}..{left}z1l.c..z3l+hair*left
         ..subpath(rundy(p,0),rundy(p,length p).zpet) of p
	 ..z3r+hair*right---z1r.a..z1r.c{left}..z1r.b
	 ---z2r.b..{right}z2r.c..
	 z2r.a---z2l.a..{right}z2l.c..z2l.b---cycle;
penlabels(1,2,3,4,5,6);
endchar;

iff known chars.latin_I_SS:
bskchar "The sans-serif letter I";
beginchar(chars.latin_I_SS,6u#,cap_height#,0); uni "0x1D5A8";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h;
x1=x2=.5w;
cap_serifs_tl(2l); cap_serifs_tr(2r); cap_serifs_bl(1l); cap_serifs_br(1r);
filldraw z1l.b{down}..z1..z1r.b---z2r.b..z2..z2l.b---cycle;
penlabels(1,2);
endchar;

charscription(7u,cap_height,.6desc_depth)(
pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_hair,-90);
bot y1=-cap_hair; top y2=h; rt x1r=rt x2r=w-2u;
bot y3r=-d; x3=if monospace: .3w else: u fi; top y4=-.3d; x4l=if monospace: cap_stem else: -u fi;
cap_serifs_tl(2l); cap_serifs_tr(2r); 
filldraw z3r{right}...z1r--- z2r.b..{right}z2r.c..z2r.a---z2l.a..{right}z2l.c..z2l.b---
         z1l...{left}z3l..reverse smitko(4,cap_stem)..cycle;
penlabels(1,2,3,4); labels(4',4'',4''');
);

iff known chars.latin_J:
bskchar "The letter J";
beginchar(chars.latin_J,7u#,cap_height#,.6desc_depth#); uni "0x004A";
italcorr cap_height#*slant+.5u#;
adjust_fit(0,cap_serif_fit#);
pickup tiny.nib;
usechar;
math_fit(.6desc_depth#*slant+1.5u#,ic#-3u#);
endchar;

iff known chars.latin_J_dotless:
bskchar "The letter J (dotless J for Small Caps)";
beginchar(chars.latin_J_dotless,7u#,cap_height#,.6desc_depth#); uni "non";
italcorr cap_height#*slant+.5u#;
adjust_fit(0,cap_serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_Jcircumflex:
bskchar "The letter J with circumflex";
beginchar(chars.latin_Jcircumflex,7u#,Acc_height#,.6desc_depth#); uni "0x0134";
italcorr (cap_height#+.75u#)*slant+.5u#;
adjust_fit(0,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2;
circumflex(100,101,102).capital;
endchar;

iff known chars.latin_J_BB:
bskchar "The blackboard-bold letter J";
beginchar(chars.latin_J_BB,7u#,cap_height#,.6desc_depth#); uni "0x1D541";
italcorr cap_height#*slant+.5u#;
adjust_fit(0,cap_serif_fit#);
pickup tiny.nib;
usechar;
path p[]; numeric tim[];
top z100=(x2r,y2r.c);
p100=z1l{down}..{left}z3l;
p101=z3r{right}..{up}z1r;
z101=bsktouch(p100,bbs*down,p101,up);
tim100=xpart(p100 intersectiontimes (z101--(x101,y1)));
tim101=xpart(p101 intersectiontimes (z101--(x101,y3r)));
infill obl(2l,2r,1l)---subpath(0,rundy(p100,(tim100,.75bbw)).zpet) of p100
       ..subpath(rundy(p101,(tim101,.75bbw)),infinity) of p101---obl(100,1r,2r.c)...z2r---cycle;
labels(101);
endchar;

iff known chars.latin_J_SS:
bskchar "The sans-serif letter J";
beginchar(chars.latin_J_SS,7u#,cap_height#,.6desc_depth#); uni "0x1D5A9";
italcorr cap_height#*slant+.5u#;
adjust_fit(0,cap_serif_fit#);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_hair,-90); pos4(cap_stem,160);
bot y1=-cap_hair; top y2=h; rt x1r=rt x2r=w-2u;
bot y3r=-d; x3=u; top y4=-.3d; x4l=-u; z4'=z4+.75currentbreadth*(unitvector(z4l-z4r) rotated 90);
cap_serifs_tl(2l); cap_serifs_tr(2r); 
filldraw z3r{right}...z1r---z2r.b..z2..z2l.b---z1l...{left}z3l..{up}z4l..
         if (substring(0,5) of font_identifier_) <> "BSKHC": z4'.. fi {down}z4r..cycle;
penlabels(1,2,3,4); labels(4');
endchar;

iff known chars.latin_IJ:
bskchar "The letter IJ";
beginchar(chars.latin_IJ,12.5u#,cap_height#,.6desc_depth#); uni "0x0132";
italcorr cap_height#*slant+.5u#;
adjust_fit(0,cap_serif_fit#);
pickup tiny.nib;
numeric shift; shift=w-7u;
usechar shifted (shift*right);
pos5(cap_stem,0); pos6(cap_stem,0);
bot y5=0; top y6=h;
lft x5l=2u; x5=x6;
cap_serifs_tl(6l); cap_serifs_tr(6r); cap_serifs_bl(5l); cap_serifs_br(5r);
filldraw z5l.b{down}..{left}z5l.c..z5l.a{right}..z5+ser_boule*up..
         {right}z5r.a..z5r.c{left}..z5r.b---z6r.b..{right}z6r.c..
	 z6r.a---z6l.a..{right}z6l.c..z6l.b---cycle;
penlabels(5,6);
endchar;

charscription(14u,cap_height,0)(
pos1(cap_stem,0); pos2(cap_stem,0);
pos3(whatever,0); pos5(whatever,0);
bot y1=0; top y2=h; lft x1l=lft x2l=2u;
rt x3r=w-3.5u; top y3=h; rt x5r=w-2u; bot y5r=0;
y4r=.4h; x4r=x2r; z4l=z4r+(cap_hair-tiny,0) rotated (angle(z3r-z4r)+90);
z3l=z4l+whatever*(z3r-z4r);
x6l=x4r+cap_hair+.5u; z6l=whatever[z4r,z3r]; z6'=z6l+(cap_stem-tiny,0) rotated (angle(z5r-z6l)+90);
z5l=z6l+whatever*(z5r-z6'); z6r=whatever[z5r,z6']=whatever[z4r,z3r];
x4'=x2r; z4'=whatever[z3l,z4l];
cap_serifs_tl(2l); cap_serifs_tr(2r); cap_serifs_bl(1l); cap_serifs_br(1r);
cap_serifs_tl(3l); cap_serifs_tr(3r); cap_serifs_br(5r); cap_serifs_bl(5l);
z4r'=z4r+.5u*down; z4r''=z4r+(u,0) rotated (angle(z3r-z4r));
z6l'=z6l+(-u,0) rotated (angle(z3r-z4r));
z6l''=z6l+(u,0) rotated (angle(z5l-z6l));
z6r'=z6r+(u,0) rotated (angle(z5r-z6r)); z6r''=z6r+(u,0) rotated (angle(z3r-z4r));
x2'=x6l; z2'=whatever[z3l,z4l]; z2''=z4'+(0,2u);
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..z1r.c{left}..z1r.b---z4r..z4r'' 
	 if x6l'>x4r'': ..z6l' fi ..z6l''---diag_serif(5l,6l)..
	 {left}z5l.c..z5l.a{right}..z5+ser_boule*up..{right}z5r.a..
	 {left}z5r.c..diag_serif(5r,6r)---z6r'..z6r''---
	 diag_serif(3r,4r)..{dir0}z3r.c..z3r.a---z3l.a..
	 z3l.c{dir0}..diag_serif(3l,4l)---z2'..z2''---
	 z2r.b..{right}z2r.c..z2r.a---z2l.a..{right}z2l.c..z2l.b---cycle;
penlabels(1,2,3,4,5,6); labels(2',2'',4',4r',4r'',6l',6l'',6r',6r'');
);

iff known chars.latin_K:
bskchar "The letter K";
beginchar(chars.latin_K,14u#,cap_height#,0); uni "0x004B";
italcorr cap_height#*slant-u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
math_fit(0,.75ic#);
endchar;

iff known chars.latin_Kcaron:
bskchar "The letter K with caron";
beginchar(chars.latin_Kcaron,14u#,Acc_height#,0); uni "0x01E8";
italcorr cap_height#*slant-u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=.5[x2r.a,x3l.a];
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Kcedilla:
bskchar "The letter K with cedilla (treated as comma)";
beginchar(chars.latin_Kcedilla,14u#,cap_height#,.75comma_depth#); uni "0x0136";
italcorr cap_height#*slant-u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=.5[x1r.a,x5l.a]; top y100''r=0;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_K_BB:
bskchar "The blackboard-bold letter K";
beginchar(chars.latin_K_BB,14u#,cap_height#,0); uni "0x1D542";
italcorr cap_height#*slant-u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
path p[]; numeric tim[];
bot z100=(x1l,y1l.c); top z101=(x2l,y2l.c);
infill obl(2r,2l,1r)---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---obl(101,1l,2l.c)...z2l---cycle;
bot z102=(lft x5r,y5r.c);
p100=ifobl(6r,6l,5r,5l,,)---obl(5l,6l,5)---z5r...obl(102,5r.c,6r)---cycle;
infill p100;
endchar;

iff known chars.latin_K_SS:
bskchar "The sans-serif letter K";
beginchar(chars.latin_K_SS,13u#,cap_height#,0); uni "0x1D5AA";
italcorr cap_height#*slant-u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0);
pos3(whatever,0); pos5(whatever,0);
bot y1=0; top y2=h; lft x1l=lft x2l=2u;
rt x3r=w-3u; top y3=h; rt x5r=w-1.5u; bot y5r=0;
y4r=.4h; x4r=x2r; z4l=z4r+(cap_hair-tiny,0) rotated (angle(z3r-z4r)+90);
z3l=z4l+whatever*(z3r-z4r);
x6l=x4r+cap_hair+.5u; z6l=whatever[z4r,z3r]; z6'=z6l+(cap_stem-tiny,0) rotated (angle(z5r-z6l)+90);
z5l=z6l+whatever*(z5r-z6'); z6r=whatever[z5r,z6']=whatever[z4r,z3r];
x4'=x2r; z4'=whatever[z3l,z4l];
cap_serifs_tl(2l); cap_serifs_tr(2r); cap_serifs_bl(1l); cap_serifs_br(1r);
cap_serifs_tl(3l); cap_serifs_tr(3r); cap_serifs_br(5r); cap_serifs_bl(5l);
z4r'=z4r+.5u*down; z4r''=z4r+(u,0) rotated (angle(z3r-z4r));
z6l'=z6l+(-u,0) rotated (angle(z3r-z4r));
z6l''=z6l+(u,0) rotated (angle(z5l-z6l));
z6r'=z6r+(u,0) rotated (angle(z5r-z6r)); z6r''=z6r+(u,0) rotated (angle(z3r-z4r));
x2'=x6l; z2'=whatever[z3l,z4l]; z2''=z4'+(0,2u);
y100l=y100r=.5[y3l.b,y3]; y101l=y101r=.5[y5l.b,y5];
z100l=whatever[z3l,z4l]; z100r=whatever[z3r,z4r];
z101l=whatever[z5l,z6l]; z101r=whatever[z5r,z6r];
filldraw z1l.b{down}..z1..z1r.b---z4r..z4r'' 
	 if x6l'>x4r'': ..z6l' fi ..z6l''---z101l..z5..z101r---z6r'..z6r''---
	 z100r...z3...z100l---z2'..z2''---z2r.b..z2..z2l.b---cycle;
penlabels(1,2,3,4,5,6,100,101); labels(2',2'',4',4r',4r'',6l',6l'',6r',6r'');
endchar;

charscription(12.5u,cap_height,0)(
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h; bot y3r=0; rt x3r=w-u;
lft x1l=lft x2l=2u;
cap_serifs_tl(2l); cap_serifs_tr(2r); cap_serifs_bl(1l); 
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         arm_bot_r_points(1r,3).alt---z2r.b..{right}z2r.c..z2r.a---
	 z2l.a..{right}z2l.c..z2l.b---cycle;
penlabels(1,2);
);

iff known chars.latin_L:
bskchar "The letter L";
beginchar(chars.latin_L,12.5u#,cap_height#,0); uni "0x004C";
italcorr .5bar_height#*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
math_fit(0,ic#);
endchar;

iff known chars.latin_Ldot:
bskchar "The letter L with middle dot";
beginchar(chars.latin_L,14u#,cap_height#,0); uni "0x013F";
italcorr x_height#*slant+.35dot_size#;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
top y100=x_height; rt x100+.5dot_size=w-.5u;
dot(100);
endchar;

iff known chars.latin_Lacute:
bskchar "The letter L with acute";
beginchar(chars.latin_Lacute,12.5u#,Acc_height#,0); uni "0x0139";
italcorr .5bar_height#*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x101=x2l;
acute(100,101).capital;
endchar;

iff known chars.latin_Lcaron:
bskchar "The letter L with caron (treated like comma)";
beginchar(chars.latin_Lcaron,12.5u#,asc_height#,0); uni "0x013D";
italcorr .5bar_height#*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
y100''r=h; lft x100'l=rt x2r.a+stem;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_Lcedilla:
bskchar "The letter L with cedilla (treated as comma)";
beginchar(chars.latin_Lcedilla,12.5u#,cap_height#,.75comma_depth#); uni "0x013B";
italcorr .5bar_height#*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x100=.5w; top y100''r=-o;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_Ldotabove:
bskchar "The letter L with dot above";
beginchar(chars.latin_Ldotabove,12.5u#,Acc_height#,0); uni "non";
italcorr .5bar_height#*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
x100=x2;
dotabove(100);
endchar;

iff known chars.latin_L_BB:
bskchar "The blackboard-bold letter L";
beginchar(chars.latin_L_BB,12.5u#,cap_height#,0); uni "0x1D543";
italcorr .5bar_height#*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
bot z100=(x1l,y1l.c); top z101=(x2l,y2l.c);
infill obl(2r,2l,1r)---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---obl(101,1l,2l.c)...z2l---cycle;
endchar;

iff known chars.latin_L_SS:
bskchar "The sans-serif letter L";
beginchar(chars.latin_L_SS,12u#,cap_height#,0); uni "0x1D5AB";
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_hair,-90);
bot y1=0; top y2=h; bot y3r=0; rt x3r=w-u;
lft x1l=lft x2l=2u; z1'=(x1r,y3l);
cap_serifs_tl(2l); cap_serifs_tr(2r); cap_serifs_bl(1l);
oblu:=cap_hair;
filldraw z1l.b{down}..z1---z3r+cap_stem*left...z3...z3l+cap_stem*left---obl(1',3l,2r)
         ---z2r.b..z2..z2l.b---cycle;
penlabels(1,2,3); labels(1');
endchar;

iff known chars.latin_Lslash:
bskchar "The letter L with slash";
beginchar(chars.latin_Lslash,12.5u#,cap_height#,0); uni "0x0141";
italcorr .5bar_height#*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
numeric theta;
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h; bot y3r=0; rt x3r=w-u;
lft x1l=lft x2l=2u;
cap_serifs_tl(2l); cap_serifs_tr(2r); cap_serifs_bl(1l); 
x5-x4=4u; x4r=x2l.a; y5-y4=stem; .5[y4,y5]=.8[bar_height,x_height];
theta=angle(z5-z4)+90;
pos4(bar,theta); pos5(bar,theta);  
x4'l=x4'r=x1l; x5'l=x5'r=x1r; 
z4'l=whatever[z4l,z5l]; z5'l=whatever[z4l,z5l];
z4'r=whatever[z4r,z5r]; z5'r=whatever[z4r,z5r];
bskpoints(4,5,bar,bar);
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         arm_bot_r_points(1r,3).alt---obl(5'l,1r,5l)---z5ll..z5r---obl(5'r,5r,2r)---
	 z2r.b..{right}z2r.c..z2r.a---
	 z2l.a..{right}z2l.c..z2l.b---obl(4'r,2l,4r)---z4rr..z4l---obl(4'l,4l,1l)---cycle;
penlabels(1,2,4,4',5,5'); labels(4rr,5ll);
endchar;

charscription(17u,cap_height,0)(
pos1(cap_hair,0); pos2(cap_hair,0);
pos3(cap_stem,0); pos4(cap_stem,0);
penpos5(whatever,0); penpos6(whatever,90);
penpos10(whatever,0); penpos11(whatever,90);
bot y1=0; top y2=h; lft x1l=lft x2l=2u;
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br(1r);
bot y3=0; top y4=h; rt x3r=rt x4r=w-2u;
cap_serifs_bl_p(3l,.9); cap_serifs_br(3r); cap_serifs_tr(4r);
z5r=z2l; z6l=(.49w, if monospace and (x3l-x1r<3cap_stem): 2/3(x3l-x1r) else: -apex_o fi);
z7=z6l+(cap_stem,0) rotated (angle(z5r-z6l)-90);
z5l=z7+whatever*(z5r-z6l); z6r=z7+whatever*(z5r-z6l);
y2'=y5'=y2l.b-cap_hair-o; x2'=x2r; z5'=whatever[z6l,z5r]; z5''=(.5[x2',x5'],y2'+o);
z8=z5l+(cap_hair,0) rotated (angle(z6l-z5r));
z10r=z4l; z11l=z6l;
z12=z11l+(cap_hair-tiny,0) rotated (angle(z10r-z11l)+90);
z10l=z12+whatever*(z10r-z11l); z11r=z12+whatever*(z10r-z11l);
z4''=whatever[z10l,z11r]=whatever[z5l,z6r];
y4'=y6'=y4''+cap_hair; z4'=whatever[z10l,z11r]; z6'=whatever[z6r,z5l];
y3'=y3''=y2'; x3'=x3l; z3''=whatever[z11l,z10r];
z10'=z10l+(cap_hair,0) rotated(angle(z11l-z10r));
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..{right}z1r.a..
         z1r.c{left}..z1r.b---z2'..if not bold_face:z5''.. fi z5'---z6l---z3''..z3'---z3l.b..
	 {left}z3l.c..z3l.a{right}..z3+ser_boule*up..{right}z3r.a..{left}z3r.c..
	 z3r.b---z4r.b..{right}z4r.c..z4r.a---z4..z10'---z4'..z6'---z8..z5---z2l.a..
	 {right}z2l.c..z2l.b---cycle;
penlabels(1,2,3,4,5,6,10,11); labels(2',3',3'',4',4'',5',5'',6',7,8,9,10',12);
);

let _saved_char_m=_saved_char;
numeric _saved_w_m; _saved_w_m:=_saved_w;

iff known chars.latin_M:
bskchar "The letter M";
beginchar(chars.latin_M,17u#,cap_height#,0); uni "0x004D";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
math_fit(0,.75ic#);
endchar;

iff known chars.latin_M_BB:
bskchar "The blackboard-bold letter M";
beginchar(chars.latin_M_BB,17u#,cap_height#,0); uni "0x1D544";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
oblu.more:=3oblu;
bot z100=(x3r,y3r.c); top z101=(x4r,y4r.c);
top y102=y2l.c; rt z102=whatever[z5',z6l];
infill obl(4l,4r,3l)---obl(3l,4l,3r)---z3r...obl(100,3r.c,4r)---obl(101,3r,4r.c)...z4r---cycle;
infill z5'---ifobl(6l,4'',5',8,more,)---z8..z5---z2l...obl(102,2l.c,5')---cycle;
endchar;

iff known chars.latin_M_SS:
bskchar "The sans-serif letter M";
beginchar(chars.latin_M_SS,17u#,cap_height#,0); uni "0x1D5AC";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
pos1(cap_hair,0); pos2(cap_hair,0);
pos3(cap_stem,0); pos4(cap_stem,0);
penpos5(whatever,0); penpos6(whatever,90);
penpos10(whatever,0); penpos11(whatever,90);
bot y1=0; top y2=h; lft x1l=lft x2l=2u;
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br(1r);
bot y3=0; top y4=h; rt x3r=rt x4r=w-2u;
cap_serifs_bl_p(3l,.9); cap_serifs_br(3r); cap_serifs_tr(4r);
z5r=z2l; z6l=(.49w, if monospace and (x3l-x1r<3cap_stem): 2/3(x3l-x1r) else: -apex_o fi);
z7=z6l+(cap_stem-tiny,0) rotated (angle(z5r-z6l)-90);
z5l=z7+whatever*(z5r-z6l); z6r=z7+whatever*(z5r-z6l);
y2'=y5'=y2l.b-cap_hair-o; x2'=x2r; z5'=whatever[z6l,z5r]; z5''=(.5[x2',x5'],y2'+o);
z8=z5l+(cap_hair,0) rotated (angle(z6l-z5r));
z10r=z4l; z11l=z6l;
z12=z11l+(cap_hair-tiny,0) rotated (angle(z10r-z11l)+90);
z10l=z12+whatever*(z10r-z11l); z11r=z12+whatever*(z10r-z11l);
z4''=whatever[z10l,z11r]=whatever[z5l,z6r];
y4'=y6'=y4''+cap_hair; z4'=whatever[z10l,z11r]; z6'=whatever[z6r,z5l];
y3'=y3''=y2'; x3'=x3l; z3''=whatever[z11l,z10r];
z10'=z10l+(cap_hair,0) rotated(angle(z11l-z10r));
y100l=y100r=.5[y1l.b,y1]; x100l=x1l; x100r=x1r;
filldraw z100l...z1...z100r---z2'+cap_hair*down..z5'+cap_hair*unitvector(z6l-z5')---z6l
         ---z3''..z3'---z3l.b..z3..z3r.b---z4r.b..z4..z10'---z4'..z6'---z8..z5..z2l.b---cycle;
penlabels(1,2,3,4,5,6,10,11); labels(2',3',3'',4',4'',5',5'',6',7,8,9,10',12);
endchar;

charscription(14u,cap_height,0)(
pos1(cap_hair,0); pos2(cap_hair,0);
pos3(cap_hair,0); pos4(cap_hair,0);
penpos5(whatever,0); penpos6(whatever,90);
bot y1=0; top y2=h;
lft x1l=lft x2l=2u;
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br(1r);
bot y3=-apex_o; top y4=h;
rt x3r=rt x4r=w-2u;
cap_serifs_tl(4l); cap_serifs_tr(4r); 
z5r=z2l; z6l=z3l;
z7=z6l+(cap_stem,0) rotated (angle(z5r-z6l)-90);
z5l=z7+whatever*(z5r-z6l); z6r=z7+whatever*(z5r-z6l);
y2'+o=y5'=y2l.b-cap_hair; x2'=x2r; z5'=whatever[z6l,z5r];
y4'-o=y6'=y6r+2cap_hair; x4'=x4l; z6'=whatever[z6r,z5l];
z8=z5l+(cap_hair,0) rotated (angle(z6l-z5r));
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..z1r.c{left}..z1r.b---z2'..z5'---z6l..z3r---
	 z4r.b..{right}z4r.c..z4r.a---z4l.a..{right}z4l.c..z4l.b---
	 z4'..z6'---z8..z5---z2l.a..{right}z2l.c..z2l.b---cycle;
penlabels(1,2,3,4,5,6); labels(2',4',5',6',7,8,9);
);

iff known chars.latin_N:
bskchar "The letter N";
beginchar(chars.latin_N,14u#,cap_height#,0); uni "0x004E";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
math_fit(0,.75ic#-.5u#);
endchar;

iff known chars.latin_Ncaron:
bskchar "The letter N with caron";
beginchar(chars.latin_Ncaron,14u#,Acc_height#,0); uni "0x0147";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=.5w; y101l=y4;
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Nacute:
bskchar "The letter N with acute";
beginchar(chars.latin_Nacute,14u#,Acc_height#,0); uni "0x0143";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100r=x4l.a;
acute(100,101).capital;
endchar;

iff known chars.latin_Ngrave:
bskchar "The letter N with grave";
beginchar(chars.latin_Ngrave,14u#,Acc_height#,0); uni "0x01F8";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
lft x100l=x5l;
grave(100,101).capital;
endchar;

iff known chars.latin_Ntilde:
bskchar "The letter N with tilde";
beginchar(chars.latin_Ntilde,14u#,Acc_height#,0); uni "0x00D1";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101-x100=6u; bot y100=top y5+hair;
tilde(100,101).capital;
endchar;

iff known chars.latin_Ncedilla:
bskchar "The letter N with cedilla (treated as comma)";
beginchar(chars.latin_N,14u#,Acc_height#,.75comma_depth#); uni "0x0145";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=.5w; top y100''r=0;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_N_BB:
bskchar "The blackboard-bold letter N";
beginchar(chars.latin_N_BB,14u#,cap_height#,0); uni "0x2115";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
oblu.more:=3oblu;
top y100=y2l.c; rt z100=whatever[z5',z6l];
infill z5'---obl(6l,5',6r).more---obl(6r,6l,8)---z8..z5---z2...obl(100,2l.c,5')---cycle;
endchar;

iff known chars.latin_N_SS:
bskchar "The sans-serif letter N";
beginchar(chars.latin_N_SS,14u#,cap_height#,0); uni "0x1D5AD";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
pos1(cap_hair,0); pos2(cap_hair,0);
pos3(cap_hair,0); pos4(cap_hair,0);
penpos5(whatever,0); penpos6(whatever,90);
bot y1=0; top y2=h;
lft x1l=lft x2l=2u;
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br(1r);
bot y3=-apex_o; top y4=h;
rt x3r=rt x4r=w-2u;
cap_serifs_tl(4l); cap_serifs_tr(4r); 
z5r=z2l; z6l=z3l;
z7=z6l+(cap_stem-tiny,0) rotated (angle(z5r-z6l)-90);
z5l=z7+whatever*(z5r-z6l); z6r=z7+whatever*(z5r-z6l);
y2'+o=y5'=y2l.b-cap_hair; x2'=x2r; z5'=whatever[z6l,z5r];
y4'-o=y6'=y6r+2cap_hair; x4'=x4l; z6'=whatever[z6r,z5l];
z8=z5l+(cap_hair,0) rotated (angle(z6l-z5r));
y100l=y100r=.5[y1l.b,y1]; x100l=x1l; x100r=x1r;
filldraw z100l...z1...z100r---z2'..z5'---z6l..z3r---
	 z4r.b...z4...z4l.b---z4'..z6'---z8..z5..z2l.b---cycle;
penlabels(1,2,3,4,5,6,100); labels(2',4',5',6',7,8,9);
endchar;

iff known chars.sign_naira:
bskchar "Naira sign";
beginchar(chars.sign_naira,14u#,cap_height#,0); uni "0x20A6";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
pos1(cap_hair,0); pos2(cap_hair,0);
pos3(cap_hair,0); pos4(cap_hair,0);
penpos5(whatever,0); penpos6(whatever,90);
pos9(hair,90); pos10(hair,90); pos11(hair,90); pos12(hair,90);
bot y1=0; top y2=h;
lft x1l=lft x2l=2u;
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br(1r);
bot y3=-apex_o; top y4=h;
rt x3r=rt x4r=w-2u;
cap_serifs_tl(4l); cap_serifs_tr(4r); 
z5r=z2l; z6l=z3l;
z7=z6l+(cap_stem,0) rotated (angle(z5r-z6l)-90);
z5l=z7+whatever*(z5r-z6l); z6r=z7+whatever*(z5r-z6l);
y2'+o=y5'=y2l.b-cap_hair; x2'=x2r; z5'=whatever[z6l,z5r];
y4'-o=y6'=y6r+2cap_hair; x4'=x4l; z6'=whatever[z6r,z5l];
z8=z5l+(cap_hair,0) rotated (angle(z6l-z5r));
y9=y10=x_height; y11=y12=bar_height;
lft x9=lft x11=.5u; rt x10=rt x12=w-.5u;
y9'r=y10'r=y10''r=y10'''r=y9r; y9'l=y10'l=y10''l=y10'''l=y9l;
y11'r=y11''r=y11'''r=y12'r=y11r; y11'l=y11''l=y11'''l=y12'l=y11l;
x9'r=x9'l=x11'l=x11'r=x1l; x11''r=x11''l=x1r; x10'r=x10'l=x12'r=x12'l=x4r;
x10''r=x10''l=x4l;
z11'''l=whatever[z5',z6l]; z11'''r=whatever[z5',z6l];
z10'''l=whatever[z6',z8]; z10'''r=whatever[z6',z8];
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..{right}z1r.a
         ..z1r.c{left}..z1r.b---obl(11''l,1r,11'''l)---obl(11'''l,11''l,6l)---z6l
	 ..z3r---obl(12'l,3r,12l)---z12l..z12r---obl(12'r,12r,10'l)---obl(10'l,12'r,10l)
	 ---z10l..z10r---obl(10'r,10r,4r)---z4r.b..{right}z4r.c..z4r.a---z4l.a
	 ..{right}z4l.c..z4l.b---obl(10''r,4l,10'''r)---obl(10'''r,10''r,8)---z8..z5
	 ---z2l.a..{right}z2l.c..z2l.b---obl(9'r,2l,9r)---z9r..z9l---obl(9'l,9l,11'r)
	 ---obl(11'r,9'l,11r)---z11r..z11l---obl(11'l,11l,1l)---cycle;
infill obl(11''r,11'''r,2')---z2'..z5'---obl(11'''r,5',11''r)---cycle;
infill obl(10''l,10'''l,4')---z4'..z6'---obl(10'''l,6',10''l)---cycle;
penlabels(1,2,3,4,5,6,9,10,11,12); labels(2',4',5',6',7,8,9);
endchar;

iff known chars.latin_Eng:
bskchar "The letter Eng";
beginchar(chars.latin_Eng,14u#, cap_height#, desc_depth#); uni "0x014A";
italcorr .75cap_height#*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[];
pos1(cap_stem,0); pos2(cap_stem,0);
pos3(cap_stem,0); pos4(cap_stem,0); pos5(1.5cap_hair,90); pos6(cap_hair,180);
pos7(cap_hair,-90);
lft x1l=2u; bot y1=0; top y2=h+apex_o; x1=x2;
rt x3r=w-u; y3=.5bar_height; 
x4=x3; y4=.75h; y5r=h; x5=.5[x3l,x1r];
x6l=x1r; y6=.6h; y6l:=y6l-hair;
bot y7r=-o; x3-x7=3u; top y8=y7+like_curve; x7-x8l=2u;
cap_serifs_bl(1l); cap_serifs_br(1r); drop_serif(2,cap_jut);
p1:=z6l{up}..z5l..z4l---z3l...{left}z7l..reverse smitko(8,cap_stem)..{right}z7r..{up}z3r;
p2:=z3r---z4r..z5r..{down}z6r;
p3:=z1r.b--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+tiny)*up; if y1'>y5l: y1':=y5l; fi
filldraw p1..subpath (0,rundy(p2,(tim1,2u)).zpet) of p2..{up}z1'
         --z2r+.2u*left..{(x1l.a-x1l,-.25serif_drop)}z2a&z2a
	 ---z2b+.75u*left..z2b+u*down---z1l.b..z1l.c{left}
	 ..{right}z1l.a..z1+ser_boule*up..{right}z1r.a..{left}z1r.c
	 ..{up}z1r.b---cycle;
penlabels(1,2,3,4,5,6,7,8); labels(1');
endchar;

charscription(14.3u,cap_height,0)(
pos1(cap_curve,0); pos2(cap_hair,90); pos3(cap_curve,180); pos4(cap_hair,270);
lft x1l=u-o; rt x3l=w-u+o; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; x2-x4=.5u; bot y2l=-o; top y4l=h+o;
filldraw z1l{down}..z2l..z3l..z4l..{down}cycle;
infill z1r{up}..z4r..z3r..z2r..{up}cycle;
penlabels(1,2,3,4);
);

iff known chars.latin_O:
bskchar "The letter O";
beginchar(chars.latin_O,14.3u#,cap_height#,0); uni "0x004F";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
math_fit(-.5cap_height#*slant+.5u#,.5cap_height#*slant);
endchar;

iff known chars.latin_Ograve:
bskchar "The letter O with grave";
beginchar(chars.latin_Ograve,14.3u#,Acc_height#,0); uni "0x00D2";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4+u;
grave(100,101).capital;
endchar;

iff known chars.latin_Odoublegrave:
bskchar "The letter O with double grave";
beginchar(chars.latin_Odoublegrave,14.3u#,Acc_height#,0); uni "0x020C";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x102-x100=3u; x102=x4;
d_grave(100,101,102,103,whatever).capital;
endchar;

iff known chars.latin_Oacute:
bskchar "The letter O with acute";
beginchar(chars.latin_Oacute,14.3u#,Acc_height#,0); uni "0x00D3";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4-u;
acute(100,101).capital;
endchar;

iff known chars.latin_Oumlaut:
bskchar "The letter O with umlaut";
beginchar(chars.latin_Oumlaut,14.3u#,Acc_height#,0); uni "0x00D6";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
.5[x100,x101]=rt x4; x101-x100=.4(x3-x1);
umlaut(100,101);
endchar;

iff known chars.latin_Ocircumflex:
bskchar "The letter O with circumflex";
beginchar(chars.latin_Ocircumflex,14.3u#,Acc_height#,0); uni "0x00D4";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4+hair; 
circumflex(100,101,102).capital;
endchar;

iff known chars.latin_Ocaron:
bskchar "The letter O with caron";
beginchar(chars.latin_Ocaron,14.3u#,Acc_height#,0); uni "0x01D1";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4; 
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Otilde:
bskchar "The letter O with tilde";
beginchar(chars.latin_Otilde,14.3u#,Acc_height#,0); uni "0x00D5";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101-x100=6u; bot y100=top y4l+o;
tilde(100,101).capital;
endchar;

iff known chars.latin_Omacron:
bskchar "The letter O with macron";
beginchar(chars.latin_Omacron,14.3u#,Acc_height#-.1x_height#,0); uni "0x014C";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
macron(100,101);
endchar;

iff known chars.latin_Odotabove:
bskchar "The letter O with dot above";
beginchar(chars.latin_Odotabove,14.3u#,Acc_height#,0); uni "0x022E";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x4;
dotabove(100);
endchar;

iff known chars.latin_Ohumlaut:
bskchar "The letter O with Hungarian umlaut";
beginchar(chars.latin_Ohumlaut,14.3u#,Acc_height#,0); uni "0x0150";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101-x100=3u; .5[x100,x101]=.5w+1.5u;
h_umlaut(100,101,102,103,2u).capital;
endchar;

iff known chars.latin_Obreve:
bskchar "The letter O with breve";
beginchar(chars.latin_Obreve,14.3u#,Acc_height#+o#,0); uni "0x014E";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=.5w+o; x102-x100=5u;
bot y101l=top y4l+o;
breve(100,101,102).capital;
endchar;

iff known chars.latin_Oinvbreve:
bskchar "The letter O with inverted breve";
beginchar(chars.latin_Oinvbreve,14.3u#,Acc_height#+o#,0); uni "0x020E";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=.5w+o; x102-x100=5u;
bot y100=top y4l;
tieacc(100,101,102).capital;
endchar;

iff known chars.latin_O_BB:
bskchar "The blackboard-bold letter O";
beginchar(chars.latin_O_BB,14.3u#,cap_height#,0); uni "0x1D546";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
path p[]; numeric tim[];
p100:=z4r..z1r{down}..z2r..z3r..cycle;
p101:=reverse z4l..z1l{down}..z2l..z3l..cycle;
oblu:=1.25bbw;
z100=bsktouch(subpath(0,1) of p100,bbs*up,p101,down);
z101=bsktouch(subpath(1,2) of p100,bbs*down,p101,up);
z102=bsktouch(subpath(3,4) of p100,bbs*up,p101,down);
z103=bsktouch(subpath(2,3) of p100,bbs*down,p101,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y1)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y4l+5)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y1)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y2l-5)));
tim104=xpart(p100 intersectiontimes (z102--(x102,y1)));
tim105=xpart(p101 intersectiontimes (z102--(x102,y4l+5)));
tim106=xpart(p100 intersectiontimes (z103--(x103,y1)));
tim107=xpart(p101 intersectiontimes (z103--(x103,y2l-5)));
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103).zpet,rundy(p101,tim101)) of p101..cycle;
infill subpath(rundy(p100,tim104).zpet,rundy(p100,tim106)) of p100
       ..subpath(rundy(p101,tim107),rundy(p101,tim105).zpet) of p101..cycle;
labels(100,101,102,103);
endchar;

iff known chars.latin_O_SS:
bskchar "The sans-serif letter O";
beginchar(chars.latin_O_SS,14u#,cap_height#,0); uni "0x1D5AE";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
pos1(cap_curve,0); pos2(cap_hair,90); pos3(cap_curve,180); pos4(cap_hair,270);
lft x1l=u-o; rt x3l=w-u+o; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; x2-x4=.5u; bot y2l=-o; top y4l=h+o;
filldraw z1l{down}..z2l..z3l..z4l..{down}cycle;
infill z1r{up}..z4r..z3r..z2r..{up}cycle;
penlabels(1,2,3,4);
endchar;

charscription(14.3u,cap_height,.85desc_depth)(
path p[];
pos1(cap_curve,0); pos2(cap_hair,90); pos3(cap_curve,180); pos4(cap_hair,270);
pos5(stem,0); pos6(curve,0); pos7(hair,45); pos8(hair,160);
lft x1l=u-o; rt x3l=w-u+o; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; x2-x4=.5u; bot y2l=-o; top y4l=h+o;
x5=x6l+1.5u; x5=x2; x7-x6l=3u; rt x8l=x7+1.5u;
bot y5=0; y6=-.5d; bot y7l=-d; y8=-2/3d;
p0=z1l{down}..z2l..z3l..z4l..{down}z1l;
p1=z5l{z6l-z5r}..z6l...z7l..{z5-z6}z8l..z8r{z6-z5}..z7r..z6r..z5r;
filldraw subpath(0,rundy(p0,(1,stem)).zpet) of p0
         ..subpath(rundy(p1,(0,stem)),rundy(p1,infinity).zpet) of p1
	 ..subpath(rundy(p1,(1,if bold_face:.5\\ fi stem)),infinity) of p0..cycle;
infill z1r{up}..z4r..z3r..z2r..{up}cycle;
penlabels(1,2,3,4,5,6,7,8);
);

iff known chars.latin_Oogonek:
bskchar "The letter O with ogonek";
beginchar(chars.latin_Oogonek,14.3u#,cap_height#,.85desc_depth#); uni "0x01EA";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_Oogonekmacron:
bskchar "The letter O with ogonek and macron";
beginchar(chars.latin_Oogonekmacron,14.3u#,Acc_height#-.1x_height#,.85desc_depth#); uni "0x01EC";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
macron(100,101);
penlabels(1,2,3,4,5,6,7,8);
endchar;

charscription(14.3u,cap_height,0)(
path p[]; numeric tim[];
oblu:=2oblu;
numeric inoblu; inoblu:=1.5f_obl;
pos1(cap_curve,0); pos2(cap_hair,90); pos3(cap_curve,180); pos4(cap_hair,270);
lft x1l=u-o; rt x3l=w-u+o; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; x2-x4=.5u; bot y2l=-o; top y4l=h+o;
z5=(w-u,h); z6=(u,0); pos5(hair, angle(z6-z5)+90); pos6(hair,angle(z6-z5)+90);
z0r=.5[z5r,z6r]; z0l=.5[z5l,z6l];
p0:=z1l{down}..z2l..z3l..z4l..{down}z1l;
p1:=z1r{up}..z4r..z3r..z2r..{up}z1r;
bskpoints(5,6,hair,hair);
(tim1,tim2)=p0 intersectiontimes (z5l--z6l);
(tim3,tim4)=p0 intersectiontimes (z6r--z5r);
(tim5,tim6)=p0 intersectiontimes (z0r--z5r);
(tim7,tim8)=p0 intersectiontimes (z5l--z0l);
(tim11,tim12)=p1 intersectiontimes (z0r--z6r);
(tim13,tim14)=p1 intersectiontimes (z5r--z0r);
(tim15,tim16)=p1 intersectiontimes (z6l--z0l);
(tim17,tim18)=p1 intersectiontimes (z5l--z0l);
filldraw subpath (0,rundy(p0,tim1).zpet) of p0..subpath(rundy((z5l--z6ll),tim2),infinity) of (z5l--z6ll)..
         subpath(0,rundy(z6r--z5r,tim4).zpet) of (z6r--z5r)..
	 subpath(rundy(p0,tim3),rundy(p0,tim5).zpet) of p0..
	 subpath(rundy(z0r--z5r,tim6),infinity) of (z0r--z5rr)..
	 subpath(0,rundy(z5l--z0l,tim8).zpet) of (z5l--z0l) ..
	 subpath(rundy(p0,tim7),infinity) of p0--cycle;
infill subpath(0,rundy(z0r--z6r,tim12).zpet) of (z0r--z6r)..
       subpath(rundy(p1,tim11).zpet,rundy(p1,tim13)) of p1..
       subpath(rundy(z5r--z0r,tim14),infinity) of (z5r--z0r)--cycle;
infill subpath (0, rundy(p1,(tim17,inoblu)).zpet) of p1..
       subpath(rundy(z5l--z0l,(tim18,inoblu)),infinity) of (z5l--z0l)..
       subpath(0,rundy(z0l--z5l,tim16).zpet) of (z0l--z6l)..
       subpath(rundy(p1,(tim15,inoblu)),infinity) of p1--cycle;
penlabels(0,1,2,3,4,5,6);
);

iff known chars.latin_Oslash:
bskchar "The letter O slash";
beginchar(chars.latin_Oslash,14.3u#,cap_height#,0); uni "0x00D8";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_Oslashacute:
bskchar "The letter O slash with acute";
beginchar(chars.latin_Oslashacute,14.3u#,Acc_height#,0); uni "0x01FE";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4-u;
acute(100,101).capital;
endchar;

charscription(12.5u,cap_height,0)(
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l= lft x2l= 2u;
pos3(.75ser_height,270); pos4(cap_hair,270); pos5(.95cap_curve,180);
pos6(cap_hair,90); pos7(.8ser_height,90);
x7=x1r; y6r=com_height-hair; y7l=y6l; rt x5l=w-u;
x4=.5[x1r,x5r]; y7l:=y7l-hair; x6=x4 if x4-1.5u>x1r: -u fi;
y3l+serif_o=y4l; top y4l=h+drop_stem; x3=x7;
y5=.5[y4,y6];
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br_p(1r,1.1);
filldraw z1l.b..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..z1r.c{left}..z1r.b---z7l{dir70}..
	 (x7l if x7l+cap_hair<x6l: +cap_hair fi,y6l)---
	 z6l..z5l..z4l..{left}z2l.a..z2l.c{right}..z2l.b---cycle;
infill z7r{down}..{right}z6r..z5r..z4r{left}..{down}z3r---cycle;
penlabels(1,2,3,4,5,6,7);
);

iff known chars.latin_P:
bskchar "The letter P";
beginchar(chars.latin_P,12.5u#,cap_height#,0); uni "0x0050";
italcorr .2[x_height#,cap_height#]*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
math_fit(0,ic#-4u#);
endchar;

iff known chars.latin_P_BB:
bskchar "The blackboard-bold letter P";
beginchar(chars.latin_P_BB,12.5u#,cap_height#,0); uni "0x2119";
italcorr .2[x_height#,cap_height#]*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
usechar;
path p[]; numeric tim[];
bot z100=(x1l,y1l.c); top z101=(x2l,y2l.c);
infill obl(2r,2l,1r)---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---obl(101,1l,2l.c)...z2l---cycle;
p100=z4r{right}..z5r..{left}z6r;
p101=z6l{right}..z5l..{left}z4l;
z102=bsktouch(subpath (0,1) of p100,bbs*up,p101,down);
z103=bsktouch(subpath (0,1) of p101,bbs*up,p100,down);
tim100=xpart(p100 intersectiontimes (z102--(x102,y5)));
tim101=xpart(p101 intersectiontimes (z102--(x102,y4l+5)));
tim102=xpart(p100 intersectiontimes (z103--(x103,y5)));
tim103=xpart(p101 intersectiontimes (z103--(x103,0)));
oblu:=1.25bbw;
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103),rundy(p101,tim101).zpet) of p101..cycle;
labels(102,103);
math_fit(0,ic#-2.5u#);
endchar;

iff known chars.sign_published:
bskchar "Published sign (circled P)";
beginchar(chars.sign_published,15u#,asc_height#,0); uni "0x2117";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
numeric zv; zv=.6;
lft x6=u; x2=w-x6; y2=.5h; top y8=h;
lft x11=3u; x12+x11=w; x13=x11; x14=x12;
y11=y12; y13=y14; .5[y11,y13]=y2; y11-y13=spread;
circle_points(rule_thickness);
filldraw draw_circle.l;
infill draw_circle.r;
save x,y;
multiply(1.5*zv)(cap_curve,cap_hair,ser_height,cap_stem);
usechar shifted -(.5[x5r,x2l.a]-.5cap_height*slant,.5[y4l,y1]) scaled zv shifted (.5WW,.5HH);
endchar;

iff known chars.sign_peso:
bskchar "Peso sign";
beginchar(chars.sign_peso,12.5u#,cap_height#,0); uni "0x20B1";
italcorr .2[x_height#,cap_height#]*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l= lft x2l= 2u;
pos3(.75ser_height,270); pos4(cap_hair,270); pos5(.95cap_curve,180);
pos6(cap_hair,90); pos7(.8ser_height,90);
pos8'(bar,90); pos9(bar,90); pos9'(bar,90);
x7=x1r; y6r=com_height-hair; y7l=y6l; rt x5l=w-u;
x4=.5[x1r,x5r]; y7l:=y7l-hair; x6=x4 if x4-1.5u>x1r: -u fi;
y3l+serif_o=y4l; top y4l=h+drop_stem; x3=x7;
y5=.5[y4,y6];
lft x8=.5u; x8'=x1l; x9'=x1r; x9=.5[x6,x5];
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br_p(1r,1.1);
y8=.65y7l;
if y8<y1r.b: y1r.b:=y1l.b:=y8-oblu; y8:=y8+oblu; fi
pos8(bar,90); y8=y8'=y9=y9';
bskpoints(8,9,bar,bar);
filldraw z1l.b..{left}z1l.c..z1l.a{right}..z1+ser_boule*up
         ..{right}z1r.a..z1r.c{left}..z1r.b---obl(9'l,1r,9l)
	 ---z9ll..z9r---obl(9'r,9r,7l)---z7l{dir70}
	 ..(x7l if x7l+cap_hair<x6l: +cap_hair fi,y6l)
	 ---z6l..z5l..z4l..{left}z2l.a..z2l.c{right}..z2l.b
	 ---obl(8'r,2l,8r)---z8rr..z8l---obl(8'l,8l,1l)---cycle;
infill z7r{down}..{right}z6r..z5r..z4r{left}..{down}z3r---cycle;
penlabels(1,2,3,4,5,6,7,8,8',9,9');
endchar;

iff known chars.latin_P_SS:
bskchar "The sans-serif letter P";
beginchar(chars.latin_P_SS,12.5u#,cap_height#,0); uni "0x1D5AF";
italcorr .2[x_height#,cap_height#]*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l= lft x2l= 2u;
pos3(1.5cap_stem,270); pos4(cap_hair,270); pos5(.95cap_curve,180);
pos6(cap_hair,90); pos7(1.5cap_stem,90);
x7=x1r; y6r=com_height-hair; y7l=y6l; rt x5l=w-u;
x4=.5[x1r,x5r]; y7l:=y7l-hair; x6=x4 if x4-1.5u>x1r: -u fi;
y3l+serif_o=y4l; top y4l=h+drop_stem; x3=x7;
y5=.5[y4,y6];
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br_p(1r,1.1);
filldraw z1l.b..z1..z1r.b---z7l{dir70}..
	 (x7l if x7l+cap_hair<x6l: +cap_hair fi,y6l)---
	 z6l..z5l..z4l---z2..z2l.b---cycle;
infill z7r{down}..{right}z6r..z5r..z4r{left}..{down} if y3r>y7r: z3r else: z7r+up fi---cycle;
penlabels(1,2,3,4,5,6,7);
math_fit(0,ic#-2.5u#);
endchar;

iff known chars.latin_Thorn:
bskchar "The letter Thorn";
beginchar(chars.latin_Thorn,12u#,cap_height#,0); uni "0x00DE";
italcorr .5[x_height#,bar_height#]*slant;
adjust_fit(cap_serif_fit#,0);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l= lft x2l= 2u;
pos3(.8ser_height,270); pos4(cap_hair,270); pos5(.95cap_curve,180);
pos6(cap_hair,90); pos7(.8ser_height,90);
x7=x1r; y7l=y6l; rt x5l=w-u;
x6=x4=.5[x1r,x5r]-u; y7l:=y7l-hair;
y3l=y4l; x3=x7; y3l:=y3l+hair;
y5=.5[y4,y6]=.5[x_height,bar_height]; y4r-y6r=bar_height;
cap_serifs_tl(2l); cap_serifs_tr(2r); cap_serifs_bl(1l); cap_serifs_br_p(1r,1.1);
if y1r.b>y7l: y1r.b:=y7l; fi
filldraw z1l.b..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..z1r.c{left}..z1r.b---z7l{dir70}..
	 (x7l if x7l+cap_hair<x6l: +cap_hair fi,y6l)---
	 z6l..z5l..z4l---(x3l if x3l+cap_hair<x4l:+cap_hair fi,y4l)..{dir110}z3l---z2r.b
	 ..z2r.c{right}..{left}z2r.a---z2l.a..z2l.c{right}..z2l.b---cycle;
infill z7r{down}..{right}z6r..z5r..z4r{left}..{down}z3r---cycle;
penlabels(1,2,3,4,5,6,7);
endchar;

charscription(14.3u,cap_height,3.5u if not monospace:+.5cap_curve fi)(
path p[]; numeric tim[]; oblu:=1/3(x2-x1);
pos1(cap_curve,0); pos2(cap_hair,90); pos3(cap_curve,180); pos4(cap_hair,270);
lft x1l=u-o; rt x3l=w-u+o; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; bot y2l=-o; top y4l=h+o;
p0:=z1l{down}..z2l..z3l..z4l..{down}z1l;
tim1= ypart(((.5w, .5cap_hair)--(w,.5cap_hair)) intersectiontimes p0);
z5r=point tim1 of p0; 
pos5(cap_hair,angle(direction tim1 of p0)-90); pos6(cap_hair,angle(direction tim1 of p0)-90);
pos7(cap_hair+o,angle(direction tim1 of p0)-90);
x6=x1r; z6=z5+whatever*(direction tim1 of p0) rotated 180;
pos8(cap_curve,angle(z2-z4));
z7=z6; x8=.5[x5r,x3r]; y8r=-d; x9=w if not monospace: +cap_stem fi; y9=.5y6;
p1:=z5l{z6-z5}..{z6-z3}z6l; 
p2:=z9{dir-125}..z8l..{z6-z3}z7l..z7r{if testdpi:dir40 else:(x4,y3)-z6 fi}..z8r..{dir70}z9;
p3:=z6r{z3-z6}..{z5-z6}z5r; 
(tim2,tim3)=p1 intersectiontimes p2; 
(tim4,tim5)=p3 intersectiontimes p2;
(tim6,tim7)=p0 intersectiontimes p1;
(tim8,tim9)=p0 intersectiontimes p3;
filldraw subpath(0,rundy(p0,tim6).zpet) of p0..
         subpath(rundy(p1,tim7),rundy(p1,(tim2,hair))) of p1..
         subpath(rundy(p2,(tim3,hair)),infinity) of p2..
	 subpath(0,rundy(p2,tim5).zpet) of p2..
	 subpath(rundy(p3,tim4),rundy(p3,tim9).zpet) of p3..
	 subpath(rundy(p0,tim8),infinity) of p0&cycle;
infill z1r{up}..z4r..z3r..z2r..{up}cycle;
penlabels(1,2,3,4,5,6,7,8,9);
);

iff known chars.latin_Q:
bskchar "The letter Q";
beginchar(chars.latin_Q,14.3u#,cap_height#,3.5u# if not monospace:+.5cap_curve# fi); uni "0x0051";
italcorr .5cap_height#*slant+.5u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
math_fit(-.5u#,ic#);
endchar;

iff known chars.latin_Q_BB:
bskchar "The blackboard-bold letter Q";
beginchar(chars.latin_Q_BB,14.3u#,cap_height#,3.5u# if not monospace:+.5cap_curve# fi); uni "0x211A";
italcorr .5cap_height#*slant+.5u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
p100:=z4r..z1r{down}..z2r..z3r..cycle;
p101:=reverse z4l..z1l{down}..z2l..z3l..cycle;
p102:=subpath(0,1.3) of p2;
tim99-3=xpart(subpath(3,infinity) of p2 intersectiontimes 
            (point infinity of p102--(xpart(point infinity of p102),-d)));
p103:=subpath(tim99,infinity) of p2;
oblu:=1.25bbw;
z100=bsktouch(subpath(0,1) of p100,bbs*up,p101,down);
z101=bsktouch(subpath(1,2) of p100,bbs*down,p101,up);
z102=bsktouch(subpath(3,4) of p100,bbs*up,p101,down);
z103=bsktouch(subpath(2,3) of p100,bbs*down,p101,up);
z104=bsktouch(p102,down,p103,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y1)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y4l+5)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y1)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y2l-5)));
tim104=xpart(p100 intersectiontimes (z102--(x102,y1)));
tim105=xpart(p101 intersectiontimes (z102--(x102,y4l+5)));
tim106=xpart(p100 intersectiontimes (z103--(x103,y1)));
tim107=xpart(p101 intersectiontimes (z103--(x103,y2l-5)));
tim108=xpart(p102 intersectiontimes (z104--(x104,0)));
tim109=xpart(p103 intersectiontimes (z104--(x104,-d)));
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103).zpet,rundy(p101,tim101)) of p101..cycle;
infill subpath(rundy(p100,tim104).zpet,rundy(p100,tim106)) of p100
       ..subpath(rundy(p101,tim107),rundy(p101,tim105).zpet) of p101..cycle;
infill subpath(rundy(p102,tim108),infinity) of p102
       ..subpath(0,rundy(p103,tim109).zpet) of p103..cycle;
labels(100,101,102,103);
endchar;

iff known chars.latin_Q_SS:
bskchar "The sans-serif letter Q";
beginchar(chars.latin_Q_SS,14.3u#,cap_height#,3.5u#); uni "0x1D5B0";
italcorr .5cap_height#*slant+.5u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=1/3(x2-x1);
pos1(cap_curve,0); pos2(cap_hair,90); pos3(cap_curve,180); pos4(cap_hair,270);
lft x1l=u-o; rt x3l=w-u+o; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; bot y2l=-o; top y4l=h+o;
p0:=z1l{down}..z2l..z3l..z4l..{down}z1l;
tim1= ypart(((.5w, .5cap_hair)--(w,.5cap_hair)) intersectiontimes p0);
z5r=point tim1 of p0; 
pos5(cap_hair,angle(direction tim1 of p0)-90); pos6(cap_hair,angle(direction tim1 of p0)-90);
pos7(cap_hair+o,angle(direction tim1 of p0)-90);
x6=.25[x1,x2]; z6=z5+whatever*(direction tim1 of p0) rotated 180;
pos8(cap_curve,angle(z2-z4));
z7=z6; x8=x3; y8r=-d;
p1:=z5l{z6-z5}..{z6-z3}z6l; 
p2:=z8l{left}..{z6-z3}z7l..z7r{z3-z6}..{right}z8r;
p3:=z6r{z3-z6}..{z5-z6}z5r; 
(tim2,tim3)=p1 intersectiontimes p2; 
(tim4,tim5)=p3 intersectiontimes p2;
(tim6,tim7)=p0 intersectiontimes p1;
(tim8,tim9)=p0 intersectiontimes p3;
filldraw subpath(0,rundy(p0,tim6).zpet) of p0
         ..subpath(rundy(p1,tim7),rundy(p1,(tim2,hair))) of p1
	 ..subpath(rundy(p2,(tim3,hair)),infinity) of p2
	 ..subpath(0,rundy(p2,tim5).zpet) of p2
	 ..subpath(rundy(p3,tim4),rundy(p3,tim9).zpet) of p3
	 ..subpath(rundy(p0,tim8),infinity) of p0&cycle;
infill z1r{up}..z4r..z3r..z2r..{up}cycle;
penlabels(1,2,3,4,5,6,7,8);
endchar;

iff known chars.latin_Q_alt:
bskchar "The letter Q (non-protruding)";
beginchar(chars.latin_Q_alt,14.3u#,cap_height#,3.5u# if not monospace:+.5cap_curve# fi); uni "non";
italcorr .5cap_height#*slant+.5u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=1/3(x2-x1);
pos1(cap_curve,0); pos2(cap_hair,90); pos3(cap_curve,180); pos4(cap_hair,270);
lft x1l=u-o; rt x3l=w-u+o; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; bot y2l=-o; top y4l=h+o;
p0:=z1l{down}..z2l..z3l..z4l..{down}z1l;
tim1= ypart(((.5w, .5cap_hair)--(w,.5cap_hair)) intersectiontimes p0);
z5r=point tim1 of p0; 
pos5(cap_hair,angle(direction tim1 of p0)-90); pos6(cap_hair,angle(direction tim1 of p0)-90);
pos7(cap_hair+o,angle(direction tim1 of p0)-90);
x6=x1r; z6=z5+whatever*(direction tim1 of p0) rotated 180;
pos8(cap_curve,angle(z2-z4));
z7=z6; rt x8=.5[x2r,x9]; y8r=-d; rt x9=w; y9=.5y6;
p1:=z5l{z6-z5}..{z6-z3}z6l; 
p2:=z9{dir-125}..z8l..{z6-z3}z7l..z7r{(x4,y3)-z6}..z8r..{dir70}z9;
p3:=z6r{z3-z6}..{z5-z6}z5r; 
(tim2,tim3)=p1 intersectiontimes p2; 
(tim4,tim5)=p3 intersectiontimes p2;
(tim6,tim7)=p0 intersectiontimes p1;
(tim8,tim9)=p0 intersectiontimes p3;
filldraw subpath(0,rundy(p0,tim6).zpet) of p0..
         subpath(rundy(p1,tim7),rundy(p1,(tim2,hair))) of p1..
         subpath(rundy(p2,(tim3,hair)),infinity) of p2..
	 subpath(0,rundy(p2,tim5).zpet) of p2..
	 subpath(rundy(p3,tim4),rundy(p3,tim9).zpet) of p3..
	 subpath(rundy(p0,tim8),infinity) of p0&cycle;
infill z1r{up}..z4r..z3r..z2r..{up}cycle;
penlabels(1,2,3,4,5,6,7,8,9);
endchar;

charscription(14u,cap_height,0)(
numeric alpha, tim[]; oblu:=2oblu;
path p[];
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l= lft x2l= 2u;
pos3(.75ser_height,270); pos4(cap_hair,270); pos5(.95cap_curve,180);
pos6(cap_hair,90); pos7(.8ser_height,90);
x7=x1r; y6r=com_height-hair; y7l=y6l; rt x5l=w-2.5u;
x4=.5[x1r,x5r]; y7l:=y7l-hair; x6=x4 if x4-1.5u>x1r: -u fi;
y3l+serif_o=y4l; top y4l=h+drop_stem; x3=x7;
y5=.5[y4,y6];
rt x8r=w-2u; bot y8r=0;
x9r=x5r if .65cap_curve<u: -u fi; y9r=y6l-cap_hair;
alpha=diag_ratio(2,cap_stem,y9r-y8r,x8r-x9r);
pos8(alpha*cap_stem,0); pos9(alpha*cap_stem,0);
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br_p(1r,1.1); cap_serifs_br(8r);
z8'=z8l+(serif_o,0) rotated(angle(z9l-z8l));
p0=z7l{dir70}..(x7l if x7l+cap_hair<x6l: +cap_hair fi,y6l)---z6l..
   z5l..z4l..{left}z2l.a..{right}z2l.c..{down}z2l.b;
p1=z8r.a{right}..z8r.c{left}..diag_serif(8r,9r)---z9r..{left}z6r--
   z6l{(x9l-x6l,0)}..z9l---z8l{right}...z8+ser_boule*up..{right}z8r.a;
p2=subpath ((length p1)-4, length p1) of p1;
(tim1,tim2)=p0 intersectiontimes p2;
(tim3,tim4)=p0 intersectiontimes p1;
filldraw z1l.b..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..z1r.c{left}..z1r.b---
         subpath(0,rundy(p0,tim1).zpet) of p0..
	 subpath(rundy(p2,tim2),infinity) of p2..
	 subpath(0,rundy(p1,tim4).zpet) of p1..
	 subpath(rundy(p0,tim3),infinity) of p0---cycle;
infill z7r..{right}z6r..z5r..z4r{left}..z3r---cycle;
penlabels(1,2,3,4,5,6,7,8,9); labels(8');
);

iff known chars.latin_R:
bskchar "The letter R";
beginchar(chars.latin_R,14u#,cap_height#,0); uni "0x0052";
italcorr .2[x_height#,cap_height#]*slant-1.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
math_fit(0,ic#);
endchar;

iff known chars.latin_Racute:
bskchar "The letter R with acute";
beginchar(chars.latin_Racute,14u#,Acc_height#,0); uni "0x0154";
italcorr .2[x_height#,cap_height#]*slant-1.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=.5[x2r,x4];
acute(100,101).capital;
endchar;

iff known chars.latin_Rdoublegrave:
bskchar "The letter R with double grave";
beginchar(chars.latin_Rdoublegrave,14u#,Acc_height#,0); uni "0x0210";
italcorr .2[x_height#,cap_height#]*slant-1.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x102-x100=3u; 
d_grave(100,101,102,103,.5[x4,x2]).capital;
endchar;

iff known chars.latin_Rcaron:
bskchar "The letter R with caron";
beginchar(chars.latin_Rcaron,14u#,Acc_height#,0); uni "0x0158";
italcorr .2[x_height#,cap_height#]*slant-1.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=.4[x4,x2r];
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Rcedilla:
bskchar "The letter R with cedilla (treated as comma)";
beginchar(chars.latin_Rcedilla,14u#,cap_height#,.75comma_depth#); uni "0x0156";
italcorr .2[x_height#,cap_height#]*slant-1.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=.5[x1r.a,x8l]; top y100''r=0;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_Rinvbreve:
bskchar "The letter R with inverted breve";
beginchar(chars.latin_Rinvbreve,14u#,Acc_height#+o#,0); uni "0x0212";
italcorr .2[x_height#,cap_height#]*slant-1.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=.45[x4,x2r]; x102-x100=4.5u;
bot y100=top y4l+2o;
tieacc(100,101,102).capital;
endchar;

iff known chars.latin_R_BB:
bskchar "The blackboard-bold letter R";
beginchar(chars.latin_R_BB,14u#,cap_height#,0); uni "0x211D";
italcorr .2[x_height#,cap_height#]*slant-1.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
bot z100=(x1l,y1l.c); top z101=(x2l,y2l.c);
oblu:=f_obl;
infill obl(2r,2l,1r)---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---obl(101,1l,2l.c)...z2l---cycle;
p100=z4r{right}..z5r..{left}z6r;
p101=z6l{right}..z5l..{left}z4l;
z102=bsktouch(subpath (0,1) of p100,bbs*up,p101,down);
y103=y104=y5; z103=whatever[z9r,z8r.bb]; z104=whatever[z9l,z8l];
bot z105=(lft x8r,y8r.c);
p102=z8r.bb--z103;
p103=z104---obl(8l,104,8)---z8r...obl(105,8r.c,9r)---z8r.bb;
tim100=xpart(p100 intersectiontimes (z102--(x102,y5)));
tim101=xpart(p101 intersectiontimes (z102--(x102,y4l+5)));
(tim102,tim103)=p100 intersectiontimes p103;
(tim104,tim105)=p101 intersectiontimes p102;
oblu:=1.25bbw;
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p103,tim103),infinity) of p103
       ..subpath(0,rundy(p102,tim105).zpet) of p102
       ..subpath(rundy(p101,tim104),rundy(p101,tim101).zpet) of p101..cycle;
labels(102,103,104,8r.bb);
endchar;

iff known chars.sign_registered:
bskchar "Registered sign (circled R)";
beginchar(chars.sign_registered,15u#,asc_height#,0); uni "0x00AE";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
numeric zv; zv=.6;
lft x6=u; x2=w-x6; y2=.5h; top y8=h;
lft x11=3u; x12+x11=w; x13=x11; x14=x12;
y11=y12; y13=y14; .5[y11,y13]=y2; y11-y13=spread;
circle_points(rule_thickness);
filldraw draw_circle.l;
infill draw_circle.r;
save x,y;
multiply(1.5*zv)(cap_curve,cap_hair,ser_height,cap_stem);
usechar shifted -(.5[x8,x2],.5[y4l,y1]) scaled zv shifted (.5WW+.5HH*slant,.5HH);
endchar;

iff known chars.sign_registered_superscript:
bskchar "Superscript registered sign (circled R)";
beginchar(chars.sign_registered_superscript,8.5u#,asc_height#,0); uni "non";
italcorr (asc_height#-.5x_height#)*slant;
adjust_fit(0,0);
pickup tiny.nib;
numeric zv,ys; zv=.3;
x6=u; x2=w-x6; ys=y2=.5h+.5*6.5u; top y8=h+o;
x11=3u; x12+x11=w; x13=x11; x14=x12;
y11=y12; y13=y14; .5[y11,y13]=y2; y11-y13=spread;
circle_points(.5rule_thickness);
filldraw draw_circle.l;
infill draw_circle.r;
save x,y;
multiply(2.5*zv)(cap_curve,cap_hair,ser_height,cap_stem); 
usechar shifted -(.5[x8,x2],.5[y4l,y1]) scaled zv shifted (.5WW+ys*slant,ys);
endchar;

iff known chars.latin_R_SS:
bskchar "The sans-serif letter R";
beginchar(chars.latin_R_SS,13.5u#,cap_height#,0); uni "0x1D5B1";
italcorr .5[x_height#,cap_height#]*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
numeric alpha, tim[]; oblu:=2oblu;
path p[];
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l= lft x2l= 2u;
pos3(1.5cap_stem,270); pos4(cap_hair,270); pos5(.95cap_curve,180);
pos6(cap_hair,90); pos7(1.5cap_stem,90);
x7=x1r; y6r=com_height-hair; y7l=y6l; rt x5l=w-2u;
x4=.5[x1r,x5r]; y7l:=y7l-hair; x6=x4 if x4-1.5u>x1r: -u fi;
y3l+serif_o=y4l; top y4l=h+drop_stem; x3=x7;
y5=.5[y4,y6];
rt x8r=w-1.5u; bot y8r=0;
x9r=x5r if .65cap_curve<u: -u fi; y9r=y6l-cap_hair;
alpha=diag_ratio(2,cap_stem,y9r-y8r,x8r-x9r);
pos8(alpha*cap_stem,0); pos9(alpha*cap_stem,0);
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br_p(1r,1.1); cap_serifs_br(8r);
z8'=z8l+(serif_o,0) rotated(angle(z9l-z8l));
y8''=.5[y8r.b,y8]; z8''=whatever[z8r,z9r];
p0=z7l{dir70}..(x7l if x7l+cap_hair<x6l: +cap_hair fi,y6l)---z6l..
   z5l..z4l---z2..{down}z2l.b;
p1=z8''---z9r..{left}z6r--z6l{(x9l-x6l,0)}..z9l---z8'..z8;
p2=subpath ((length p1)-4, length p1) of p1;
(tim1,tim2)=p0 intersectiontimes p2;
(tim3,tim4)=p0 intersectiontimes p1;
filldraw z1l.b..z1..z1r.b---
         subpath(0,rundy(p0,tim1).zpet) of p0..
	 subpath(rundy(p2,tim2),infinity) of p2..
	 subpath(0,rundy(p1,tim4).zpet) of p1..
	 subpath(rundy(p0,tim3),infinity) of p0---cycle;
infill z7r..{right}z6r..z5r..z4r{left}..if y3r>y7r: z3r else: z7r+up fi---cycle;
penlabels(1,2,3,4,5,6,7,8,9); labels(8',8'');
endchar;

iff known chars.sign_recipe:
bskchar "Recipe sign";
beginchar(chars.sign_recipe,14u#,cap_height#,0); uni "0x211E";
italcorr bar_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
numeric alpha, tim[],theta; oblu:=2oblu;
path p[];
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l= lft x2l= 2u;
pos3(.75ser_height,270); pos4(cap_hair,270); pos5(.95cap_curve,180);
pos6(cap_hair,90); pos7(.8ser_height,90);
x7=x1r; y6r=com_height-hair; y7l=y6l; rt x5l=w-2.5u;
x4=.5[x1r,x5r]; y7l:=y7l-hair; x6=x4 if x4-1.5u>x1r: -u fi;
y3l+serif_o=y4l; top y4l=h+drop_stem; x3=x7;
y5=.5[y4,y6];
rt x8r=w-2u; bot y8r=0;
x9r=x5r if .65cap_curve<u: -u  fi; y9r=y6l-cap_hair;
alpha=diag_ratio(2,cap_stem,y9r-y8r,x8r-x9r);
pos8(alpha*cap_stem,0); pos9(alpha*cap_stem,0);
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br_p(1r,1.1); cap_serifs_br(8r);
z8'=z8l+(serif_o,0) rotated(angle(z9l-z8l));
top y11=bar_height; rt x11=w-u; bot y10=0; x10=.5[x1r,x8r];
theta:=angle(z11-z10)+90;
pos10(bar,theta); pos11(bar,theta);
bskpoints(10,11,bar,bar);
z100=point 0 of diag_serif(8r,9r);
z10'l=whatever[z10l,z11l]=whatever[z9l,z8l]; z10'r=whatever[z10r,z11r]=whatever[z9l,z8l];
z11'l=whatever[z10l,z11l]=whatever[z9r,z8r.bb]; z11'r=whatever[z10r,z11r]=whatever[z9r,z8r.bb];
p0=z7l{dir70}..(x7l if x7l+cap_hair<x6l: +cap_hair fi,y6l)---z6l..
   z5l..z4l..{left}z2l.a..{right}z2l.c..{down}z2l.b;
p1=z8r.a{right}..z8r.c{left}..z100---obl(11'l,8r.bb,11l)---z11ll..
   z11r---obl(11'r,11r,9r)---z9r..{left}z6r--
   z6l{(x9l-x6l,0)}..z9l---obl(10'r,9l,10r)---z10rr..z10l---obl(10'l,10l,8l)---
   z8l{right}...z8+ser_boule*up..{right}z8r.a;
p2=subpath ((length p1)-10,infinity) of p1;
(tim1,tim2)=p0 intersectiontimes p2;
(tim3,tim4)=p0 intersectiontimes p1;
filldraw z1l.b..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..z1r.c{left}..z1r.b---
         subpath(0,rundy(p0,tim1).zpet) of p0..
	 subpath(rundy(p2,tim2),infinity) of p2..
	 subpath(0,rundy(p1,tim4).zpet) of p1..
	 subpath(rundy(p0,tim3),infinity) of p0---cycle;
infill z7r..{right}z6r..z5r..z4r{left}..z3r---cycle;
penlabels(1,2,3,4,5,6,7,8,9,10,10',11,11'); labels(8');
endchar;

iff known chars.sign_AR:
bskchar "Aspect ratio sign";
beginchar(chars.sign_AR,18u#,cap_height#,0); uni "non";
italcorr .2[x_height#,cap_height#]*slant-1.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
numeric alpha, beta, tim[]; oblu:=2oblu; oblu.more:=3f_obl;
path p[];
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h-drop_stem;
lft x1l=lft x2l=8.5u;
pos3(.75ser_height,270); pos4(cap_hair,270); pos5(.95cap_curve,180);
pos6(cap_hair,90); pos7(.8ser_height,90);
x7=x1r; y6r=com_height-hair; y7l=y6l; rt x5l=w-2.5u;
x4=.5[x1r,x5r]; y7l:=y7l-hair; x6=x4 if x4-1.5u>x1r: -u fi;
y3l+serif_o=y4l; top y4l=h+drop_stem; x3=x7;
y5=.5[y4,y6];
rt x8r=w-2u; bot y8r=0;
x9r=x5r if .65cap_curve<u: -u fi; y9r=y6l-cap_hair;
alpha=diag_ratio(2,cap_stem,y9r-y8r,x8r-x9r);
pos8(alpha*cap_stem,0); pos9(alpha*cap_stem,0);
cap_serifs_tl(2l); cap_serifs_bl(1l); cap_serifs_br_p(1r,1.1); cap_serifs_br(8r);
z8'=z8l+(serif_o,0) rotated(angle(z9l-z8l));
lft x10l=2u; y10l=y1;
beta=diag_ratio(2,cap_hair,y2l-y7l,x2l-x7l);
pos10(beta*cap_hair,0); pos6'(ser_height,90);
pos12(cap_bar,90); y11r-y11l=cap_bar-tiny; .5[y11r,y11l]=y12=y6=y6'; x6'=x1l;
x2l'=x2l; z2l'=whatever[z2l+alpha*(cap_hair-.5currentbreadth)*right,z10];
x1l-x12=x6-x7; z11r=whatever[z10,z2l']; z11l=whatever[z10,z2l'];
y11'r=y11r; y11'l=y11l; x11'l=x11'r=.5[x11l,x11r]+(x6-x7);
cap_serifs_bl(10l); cap_serifs_br(10r);
p0=z7l{dir70}..(x7l if x7l+cap_hair<x6l: +cap_hair fi,y6l)---z6l..z5l..z4l
   ---obl(2l,2,10l)---diag_serif(10l,2l)..{left}z10l.c..z10l.a{right}
   ..z10+ser_boule*up..{right}z10r.a..{left}z10r.c..diag_serif(10r,2r)
   ---obl(11l,10r,12l)---z12l{right}..{down}(x1l,y6'l);
p1=z8r.a{right}..z8r.c{left}..diag_serif(8r,9r)---z9r..{left}z6r--
   z6l{(x9l-x6l,0)}..z9l---z8l{right}...z8+ser_boule*up..{right}z8r.a;
p2=subpath ((length p1)-4, length p1) of p1;
(tim1,tim2)=p0 intersectiontimes p2;
(tim3,tim4)=p0 intersectiontimes p1;
filldraw z1l.b..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..{right}z1r.a..z1r.c{left}
         ..z1r.b---subpath(0,rundy(p0,tim1).zpet) of p0
	 ..subpath(rundy(p2,tim2),infinity) of p2
	 ..subpath(0,rundy(p1,tim4).zpet) of p1
	 ..subpath(rundy(p0,tim3),infinity) of p0---cycle;
infill z7r..{right}z6r..z5r..z4r{left}..z3r---cycle;
infill (x1l,y6'r)..{left}z12r---obl(11r,12r,2l')---
       obl(2l',10l,1l).more---cycle;
penlabels(1,2,3,4,5,6,6',7,8,9,10,11,12); labels(8');
endchar;

charscription(10u,cap_height,0)(
numeric exc; exc=(w-u)/h;
path p[]; numeric tim[];
pos2(cap_hair,90); pos3(cap_curve,angle((w-u,h))+180); pos4(cap_hair,90);
pos5(cap_stem,180); pos6(cap_stem,180);
y5=.5[y2l,y3]+.5like_cap_hair; x3-x5l=.5(y2l-y3l)*exc;
y6=.5[y4r,y3]-.5like_cap_hair; rt x6l=w-u;
x2=x3=x4=.5w; top y2r=h+o; bot y4l=-o; 
y3=.5[y2l,y4r]+.5cap_hair;
pos1(cap_hair,0); x1r=w-x5r; y1=y5-.5cap_hair;
pos7(cap_hair,0); x7l=w-x6l; y7=y6+.5cap_hair;
if x5r<x7r+currentbreadth: %Correction for HC variant
  numeric sh; sh:=x7r+currentbreadth-x5r;
  forsuffixes $=5r,5l,5,2l,2r,2: x$:=x$+sh; endfor
fi
p0=z1r{up}..z2r{left}..z5r..z3r..z6r..{left}z4r..{up}z7r;
p1=z7l{dir-80}..z4l{right}..z6l..z3l..z5l..{right}z2l..{down}z1l;
tim1=xpart(p0 intersectiontimes ((.5w,y2-.5cap_hair)--(w,y2-.5cap_hair)));
tim2=xpart(p1 intersectiontimes ((.5w,y4+cap_hair)--(0,y4+cap_hair)));
filldraw z1r--(x1r-.5o,h+o){dir-100}..subpath(tim1,length p0) of p0..z7l
         --(x7l+o,-o){dir80}..subpath(tim2, length p1) of p1..cycle;
penlabels(0,1,2,3,4,5,6,7); 
);

iff known chars.latin_S:
bskchar "The letter S";
beginchar(chars.latin_S,10u#, cap_height#, 0); uni "0x0053";
italcorr cap_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
math_fit(-.5u#,.75ic#);
endchar;

iff known chars.sign_circled_S:
bskchar "Circled S sign";
beginchar(chars.sign_circled_S,15u#,asc_height#,0); uni "non";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
numeric zv; zv=.6;
lft x6=u; x2=w-x6; y2=.5h; top y8=h;
lft x11=3u; x12+x11=w; x13=x11; x14=x12;
y11=y12; y13=y14; .5[y11,y13]=y2; y11-y13=spread;
circle_points(rule_thickness);
filldraw draw_circle.l;
infill draw_circle.r;
save x,y;
multiply(1.5*zv)(cap_curve,cap_hair,cap_stem,ser_height);
usechar shifted -(x4,.5[y4l,y2r]) scaled zv shifted (.5WW+.5HH*slant,.5HH);
endchar;

iff known chars.latin_Scaron:
bskchar "The letter S with caron";
beginchar(chars.latin_Scaron,10u#, Acc_height#, 0); uni "0x0160";
italcorr cap_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x2;
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Scircumflex:
bskchar "The letter S with circumflex";
beginchar(chars.latin_Scircumflex,10u#, Acc_height#, 0); uni "0x015C";
italcorr cap_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x2; x102-x100=4u; bot y100l=top cap_height+o;
circumflex(100,101,102).capital;
endchar;

iff known chars.latin_Sacute:
bskchar "The letter S with acute";
beginchar(chars.latin_Sacute,10u#, Acc_height#, 0); uni "0x015A";
italcorr cap_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x2-u; 
acute(100,101).capital;
endchar;

iff known chars.latin_Scommabelow:
bskchar "The letter S with comma below";
beginchar(chars.latin_Scommabelow,10u#,cap_height#,.75comma_depth#); uni "0x0218";
italcorr cap_height#*slant-u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=x4; top y100''r=-2o;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_S_BB:
bskchar "The blackboard-bold letter S";
beginchar(chars.latin_S_BB,10u#, cap_height#, 0); uni "0x1D54A";
italcorr cap_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
p100=subpath(1,5) of p0;
p101=subpath(1,5) of p1;
z100=bsktouch(subpath(0,1) of p100,bbs*down,p101,up);
z101=bsktouch(subpath(0,1) of p101,bbs*up,p100,down);
tim100=xpart(p100 intersectiontimes (z100--(x100,y2r+5)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y5)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y6)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y4l-5)));
oblu:=1.25bbw;
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103),rundy(p101,tim101).zpet) of p101..cycle;
labels(100,101);
endchar;

iff known chars.latin_SS:
bskchar "Two letters S (Small Caps variant of eszet)";
beginchar(chars.latin_SS,10u#, cap_height#, 0); uni "non";
italcorr cap_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
r:=r+w; charwd:=2charwd;
addto currentpicture also currentpicture shifted (w,0);
endchar;

iff known chars.latin_S_SS:
bskchar "The sans-serif letter S";
beginchar(chars.latin_S_SS,9u#, cap_height#, 0); uni "0x1D5B2";
italcorr cap_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric exc, hpa; exc=(w-u)/h;
pos2(cap_hair,90); pos3(cap_curve,angle((w-u,h))+180); pos4(cap_hair,90);
pos5(cap_stem,180); pos6(cap_stem,180);
y5=.5[y2l,y3]+.5like_cap_hair; x3-hpa=.5(y2l-y3l)*exc;
y6=.5[y4r,y3]-.5like_cap_hair; rt x6l=w-u;
x3=x4=.5w; top y2r=h+o; bot y4l=-o; x2=.5[x1,x5l];
y3=.5[y2l,y4r]+.5cap_hair; 
if hpa-cap_stem+.5currentbreadth<rt u: lft x5r=1.25u; rt x1r=w-u;
else: x5l=hpa; x1r=w-x5r+.5u; fi;
pos1(cap_hair,30); y1=.5[y5,y2l];
pos7(cap_hair,0); x7l=w-x6l; y7=y6;
filldraw z1r{dir110}..z2r{left}..z5r..z3r..z6r..{left}z4r..{up}z7r..z7l{down}..z4l{right}
     ..z6l..z3l..z5l..{right}z2l..{dir-70}z1..cycle;
penlabels(0,1,2,3,4,5,6,7); 
endchar;

iff known chars.sign_service:
bskchar "Service sign";
beginchar(chars.sign_service,14.5u#,asc_height#,0); uni "0x2120";
italcorr asc_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric zv; zv:=.5;
multiply(1.7zv)(cap_stem,cap_hair);
usechar shifted -(u,y2r) scaled zv shifted (u,HH);
save x,y;
let _saved_char=_saved_char_m;
_saved_w:=_saved_w_m;
usechar shifted -(_saved_w_m,y2) scaled zv shifted (WW-u*(1-zv),HH);
endchar;

iff known chars.latin_Scedilla:
bskchar "The letter S with cedilla";
beginchar(chars.latin_Scedilla,10u#,cap_height#,.65desc_depth#); uni "0x015E";
italcorr cap_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric exc; exc=(w-u)/h;
path p[]; numeric tim[];
pos2(cap_hair,90); pos3(cap_curve,angle((w-u,h))+180); pos4(cap_hair,90);
pos5(cap_stem,180); pos6(cap_stem,180);
pos8(.5stem,0); pos9(.5stem,0); pos10(stem,0); pos11(.5stem,-110);
y5=.5[y2l,y3]+.5like_cap_hair; x3-x5l=.5(y2l-y3l)*exc;
y6=.5[y4r,y3]-.5like_cap_hair; rt x6l=w-u;
x2=x3=x4=.5w; top y2r=h+o; bot y4l=-o; 
y3=.5[y2l,y4r]+.5cap_hair;
pos1(cap_hair,0); x1r=w-x5r; y1=y5-.5cap_hair;
pos7(cap_hair,0); x7l=w-x6l; y7=y6+.5cap_hair;
p0=z1r{up}..z2r{left}..z5r..z3r..z6r..{left}z4r..{up}z7r;
p1=z7l{dir-80}..z4l{right}..z6l..z3l..z5l..{right}z2l..{down}z1l;
tim1=xpart(p0 intersectiontimes ((.5w,y2-.5cap_hair)--(w,y2-.5cap_hair)));
tim2=xpart(p1 intersectiontimes ((.5w,y4+cap_hair)--(0,y4+cap_hair)));
x8l=x9l=x4; bot y8=0; y9=-hair; y10=-.5d;
rt x10r-lft x11r=4u; x8r-lft x11r=2u; y11r=-d;
p2:=z9r..{down}z10r..{left}z11r..{right}z11l..{up}z10l..z9l--z8l;
p3:=reverse(z8r{down}..subpath (rundy(p2,(0,curve)),infinity) of p2);
filldraw z1r--(x1r-.5o,h+o){dir-100}..subpath(tim1,length p0) of p0..z7l
         --(x7l+o,-o){dir80}..subpath(tim2,rundy(p1,1).zpet) of p1
	 ..subpath(rundy(p3,0),rundy(p3,(infinity,stem)).zpet) of p3
	 ..subpath(rundy(p1,(1,stem)),infinity) of p1..cycle;
penlabels(0,1,2,3,4,5,6,7,8,9,10,11); 
endchar;

charscription(15.5u, cap_height,0)(
path p[];
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=h; x1=x2=.5w;
cap_serifs_bl(1l); cap_serifs_br(1r);
top y3r=top y4r=h; rt x3r=w-u; lft x4r=u;
{{numeric old; old:=stem; 
  save stem; stem:=if monospace: 2/3\\fi old; 
  p0:=reverse arm_top_r_points(2r,3).alt; p1:=arm_top_l_points(2l,4).alt;
}};
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..z1r.c{left}..z1r.b---p0--p1---cycle;
penlabels(1,2);
);

iff known chars.latin_T:
bskchar "The letter T";
beginchar(chars.latin_T,15.5u#,cap_height#,0); uni "0x0054";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
math_fit(-(cap_height#-beak#)*slant-.5u#,ic#-4.5u#);
endchar;

iff known chars.latin_Tcaron:
bskchar "The letter T with caron";
beginchar(chars.latin_Tcaron,15.5u#,Acc_height#,0); uni "0x0164";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x2;
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Tcommabelow:
bskchar "The letter T with comma below";
beginchar(chars.latin_Tcommabelow,15.5u#,cap_height#,.75comma_depth#); uni "0x021A";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=x1; top y100''r=-2o;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_T_BB:
bskchar "The blackboard-bold letter T";
beginchar(chars.latin_T_BB,15.5u#,cap_height#,0); uni "0x1D54B";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
bot z100=(x1l,y1l.c);
infill ifobl(2l,2r,1l,1r,,)---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---cycle;
math_fit(0,ic#-3u#);
endchar;

iff known chars.sign_trademark:
bskchar "Trademark sign";
beginchar(chars.sign_trademark,17.5u#,asc_height#,0); uni "0x2122";
italcorr asc_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric zv; zv:=.5;
multiply(1.7zv)(cap_stem,cap_hair);
usechar shifted -(u,y2r) scaled zv shifted (u,HH);
save x,y;
let _saved_char=_saved_char_m;
_saved_w:=_saved_w_m;
usechar shifted -(_saved_w_m,y2) scaled zv shifted (WW-u*(1-zv),HH);
endchar;

iff known chars.latin_T_SS:
bskchar "The sans-serif letter T";
beginchar(chars.latin_T_SS,14u#,cap_height#,0); uni "0x1D5B3";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_hair,90); pos4(cap_hair,90);
bot y1=0; top y2=h; x1=x2=.5w;
cap_serifs_bl(1l); cap_serifs_br(1r);
top y3r=top y4r=h; rt x3r=w-u; lft x4r=u;
y100=y101=y3l; x100=x1l; x101=x1r;
oblu:=cap_hair;
filldraw z1l.b..z1..z1r.b---obl(101,1r,3l)---z3l+cap_stem*left...z3...z3r+cap_stem*left
         ---z4r+cap_stem*right...z4...z4l+cap_stem*right---obl(100,4l,1l)---cycle;
penlabels(1,2,3,4); labels(100,101); 
math_fit(0,ic#-3u#);
endchar;

iff known chars.latin_Tcedilla:
bskchar "The letter T with cedilla";
beginchar(chars.latin_Tcedilla,15.5u#,cap_height#,.65desc_depth#); uni "0x0162";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[];
pos1(cap_stem,0); pos2(cap_stem,0);
pos5(.5stem,0); pos6(.5stem,0); pos7(stem,0); pos8(.5stem,-110);
bot y1=0; top y2=h; x1=x2=.5w;
cap_serifs_bl(1l); cap_serifs_br(1r);
top y3r=top y4r=h; rt x3r=w-u; lft x4r=u;
{{numeric old; old:=stem; 
  save stem; stem:=if monospace: 2/3\\fi old; 
  p0:=reverse arm_top_r_points(2r,3).alt; p1:=arm_top_l_points(2l,4).alt;
}};
x5l=x6l=x2; bot y5=0; y6=-hair; y7=-.5d;
rt x7r-lft x8r=4u; x5r-lft x8r=2u; y8r=-d;
p2:=z6r..{down}z7r..{left}z8r..{right}z8l..{up}z7l..z6l--z5l;
p3:=reverse(z5r{down}..subpath (rundy(p2,(0,curve)),infinity) of p2);
filldraw z1l.b{down}..{left}z1l.c..z1l.a---z5l+hair*left..subpath(rundy(p3,0),rundy(p3,infinity).zpet) of p3..z5r+hair*right---z1r.a..z1r.c{left}..z1r.b---p0--p1---cycle;
penlabels(1,2,3,5,6,7,8);
endchar;

iff known chars.latin_Tstroke:
bskchar "The letter T with stroke";
beginchar(chars.latin_Tstroke,15.5u#,cap_height#,0); uni "0x0166";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[];
pos1(cap_stem,0); pos2(cap_stem,0);
pos5(bar,90); pos5'(bar,90); pos6(bar,90); pos6'(bar,90);
bot y1=0; top y2=h; x1=x2=.5w;
cap_serifs_bl(1l); cap_serifs_br(1r);
top y3r=top y4r=h; rt x3r=w-u; lft x4r=u;
x6-x5=4u if bold_face:+u fi; y6=y6'=y5=y5'=.8[bar_height,x_height]; .5[x5,x6]=x1;
x5'=x1l; x6'=x1r; bskpoints(5,6,hair,hair);
{{numeric old; old:=stem; 
  save stem; stem:=if monospace: 2/3\\fi old; 
  p0:=reverse arm_top_r_points(2r,3).alt; p1:=arm_top_l_points(2l,4).alt;
}};
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up
         ..{right}z1r.a..z1r.c{left}..z1r.b---obl(6'l,1l,6l)---z6ll
	 ..z6r---obl(6'r,6r,2r)---p0--p1---obl(5'r,2l,5rr)---z5rr
	 ..z5l---obl(5'l,5l,1l)---cycle;
penlabels(1,2,5,5',6,6');
endchar;

charscription(14u,cap_height,0)(
path p[];
pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_hair,180); pos4(cap_hair,180);
top y1=top y4=h; y2=y3=.45(x4-x1);
y2'l=-.5o; x2'l=.5[x2,x3];
lft x1l=2u; x2=x1; rt x4r=w-2u; x3=x4;
p1:=z2l{down}...{up}z3l; p2:=z2r{down}...{up}z3r;
z2'l-z2'r=(((x2'l,h)--(x2'l,-h)) intersectionpoint p1)-(((x2'l,h)--(x2'l,-h)) intersectionpoint p2);
cap_serifs_tl(1l); cap_serifs_tr(1r); cap_serifs_tr(4l); cap_serifs_tl(4r);
filldraw z1l---z1l.a..{right}z1l.c..z1l.b---z2l...z2'l{right}...z3l---z4l.b..{right}z4l.c..z4l.a---
         z4r.a..{right}z4r.c..z4r.b---z3r...z2'r{left}...z2r---z1r.b..{right}z1r.c..z1r.a---cycle;
penlabels(1,2,2',3,4);
);

iff known chars.latin_U:
bskchar "The letter U";
beginchar(chars.latin_U,14u#,cap_height#,0); uni "0x0055";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
math_fit(-1/3cap_height#*slant-u#,ic#-2u#);
endchar;

iff known chars.latin_Uacute:
bskchar "The letter U with acute";
beginchar(chars.latin_Uacute,14u#,Acc_height#,0); uni "0x00DA";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2'r-u;
acute(100,101).capital;
endchar;

iff known chars.latin_Ugrave:
bskchar "The letter U with grave";
beginchar(chars.latin_Ugrave,14u#,Acc_height#,0); uni "0x00D9";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2'r+u;
grave(100,101).capital;
endchar;

iff known chars.latin_Udoublegrave:
bskchar "The letter U with double grave";
beginchar(chars.latin_Udoublegrave,14u#,Acc_height#,0); uni "0x0214";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x102-x100=3u; x102=x2'r;
d_grave(100,101,102,103,whatever).capital;
endchar;

iff known chars.latin_Umacron:
bskchar "The letter U with macron";
beginchar(chars.latin_Umacron,14u#,Acc_height#-.1x_height#,0); uni "0x016A";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=x1r.a; x101=x4r.a;
macron(100,101);
endchar;

iff known chars.latin_Ucaron:
bskchar "The letter U with caron";
beginchar(chars.latin_Ucaron,14u#,Acc_height#,0); uni "0x01D3";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2'r+o;
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Ucircumflex:
bskchar "The letter U with circumflex";
beginchar(chars.latin_Ucircumflex,14u#,Acc_height#,0); uni "0x00DB";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2'r;
circumflex(100,101,102).capital;
endchar;

iff known chars.latin_Ubreve:
bskchar "The letter U with breve";
beginchar(chars.latin_Ubreve,14u#,Acc_height#,0); uni "0x016C";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2'r+o; x102-x100=5u;
breve(100,101,102).capital;
endchar;

iff known chars.latin_Uinvbreve:
bskchar "The letter U with inverted breve";
beginchar(chars.latin_Uinvbreve,14u#,Acc_height#,0); uni "0x0216";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2'r; x102-x100=5u; bot y100=top y1+o;
tieacc(100,101,102).capital;
endchar;

iff known chars.latin_Uhumlaut:
bskchar "The letter U with Hungarian umlaut";
beginchar(chars.latin_Uhumlaut,14.3u#,Acc_height#,0); uni "0x0170";
italcorr cap_height#*slant+.75u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101-x100=3u; .5[x100,x101]=.5[x1r.a,x4r.a]+1.5u;
h_umlaut(100,101,102,103,2u).capital;
endchar;

iff known chars.latin_Uring:
bskchar "The letter U with ring";
beginchar(chars.latin_Uring,14u#,Acc_height#,0); uni "0x016E";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=x2'r; x100-x101=1.5u; bot y100=top y1+hair;
ring(100,101).capital;
endchar;

iff known chars.latin_Utilde:
bskchar "The letter U with tilde";
beginchar(chars.latin_Utilde,14u#,Acc_height#,0); uni "0x0168";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101-x100=6u; bot y100=top y1+o; x.tilde=x2'r+o;
tilde(100,101).capital;
endchar;

iff known chars.latin_Uumlaut:
bskchar "The letter U with umlaut";
beginchar(chars.latin_Uumlaut,14u#,Acc_height#,0); uni "0x00DC";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=x1r; x101=x4;
umlaut(100,101);
endchar;

iff known chars.latin_U_BB:
bskchar "The blackboard-bold letter U";
beginchar(chars.latin_U_BB,14u#,cap_height#,0); uni "0x1D54C";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
path p[]; numeric tim[];
top z100=(x1l,y1l.c);
p100=z2l{down}..{right}z2'l...{up}z3l;
p101=z3r{down}..z2'r{left}..{up}z2r;
z101=bsktouch(p100,bbs*dir135,p101,dir-45);
tim100=xpart(p100 intersectiontimes (z101--(x101,0)));
tim101=xpart(p101 intersectiontimes (z101--(x101,y3)));
infill subpath(0,rundy(p100,(tim100,1.5bbw)).zpet) of p100
       ..subpath(rundy(p101,(tim101,1.5bbw)),infinity) of p101
       ---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---cycle;
labels(101);
endchar;

iff known chars.latin_U_SS:
bskchar "The sans-serif letter U";
beginchar(chars.latin_U_SS,14u#,cap_height#,0); uni "0x1D5B4";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
path p[];
pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_hair,180); pos4(cap_hair,180);
top y1=top y4=h; y2=y3=.45(x4-x1);
y2'l=-.5o; x2'l=.5[x2,x3];
lft x1l=2u; x2=x1; rt x4r=w-2.5u; x3=x4;
p1:=z2l{down}...{up}z3l; p2:=z2r{down}...{up}z3r;
z2'l-z2'r=(((x2'l,h)--(x2'l,-h)) intersectionpoint p1)-(((x2'l,h)--(x2'l,-h)) intersectionpoint p2);
cap_serifs_tl(1l); cap_serifs_tr(1r); cap_serifs_tr(4l); cap_serifs_tl(4r);
y100l=y100r=.5[y4l.b,y4]; x100l=x4l; x100r=x4r;
filldraw z1..z1l.b---z2l...z2'l{right}...z3l---z100l...z4...z100r---z3r...z2'r{left}...z2r---z1r.b..cycle;
penlabels(1,2,2',3,4,100);
endchar;

iff known chars.latin_Uogonek:
bskchar "The letter U with ogonek";
beginchar(chars.latin_Uogonek,14u#,cap_height#,.85desc_depth#); uni "0x0172";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
path p[];
pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_hair,180); pos4(cap_hair,180);
pos5(stem,0); pos6(curve,0); pos7(hair,45); pos8(hair,160);
top y1=top y4=h; y2=y3=.45(x4-x1);
y2'l=-.5o; x2'l=.5[x2,x3];
lft x1l=2u; x2=x1; rt x4r=w-2u; x3=x4;
x5=x6l+1.5u; x5l=x2'r; x7-x6l=3u; rt x8l=x7+1.5u;
bot y5=0; y6=-.5d; bot y7l=-d; y8=-2/3d;
p1:=z2l{down}...{up}z3l; p2:=z2r{down}...{up}z3r;
z2'l-z2'r=(((x2'l,h)--(x2'l,-h)) intersectionpoint p1)-(((x2'l,h)--(x2'l,-h)) intersectionpoint p2);
p2:=z2l{down}...z2'l{right}...{up}z3l;
p3:=z5l{z6l-z5r}..z6l...z7l..{z5-z6}z8l..z8r{z6-z5}..z7r..z6r..z5r;
cap_serifs_tl(1l); cap_serifs_tr(1r); cap_serifs_tr(4l); cap_serifs_tl(4r);
filldraw z1l---z1l.a..{right}z1l.c..z1l.b
         ---subpath (0,rundy(p2,(1,stem)).zpet) of p2
	 ..subpath(rundy(p3,(0,stem)),rundy(p3,infinity).zpet) of p3
	 ..subpath(rundy(p2,1),infinity) of p2---z4l.b..{right}z4l.c..z4l.a
	 ---z4r.a..{right}z4r.c..z4r.b---z3r...z2'r{left}...z2r
	 ---z1r.b..{right}z1r.c..z1r.a---cycle;
penlabels(1,2,2',3,4,5,6,7,8);
endchar;

charscription(14u,cap_height,0)(
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3l=.5w+o; bot y3l=-apex_o;
left_stem=cap_stem;
right_stem=cap_hair;
alpha=diag_ratio(2,left_stem,y1l-y3l,x3l-x1l);
pos1(alpha*left_stem,0); pos2(alpha*right_stem,0);
pos1'(alpha*left_stem,0); pos2'(alpha*right_stem,0);
pos4(.65cap_hair,90); pos5(.65cap_hair,90);
z1'l=z3l=z2'r;
z3'=whatever[z1'r,z1r]=whatever[z2'l,z2l]; 
y3'l=y3'r=y3'+.25[cap_hair,cap_stem]; 
z3'l=whatever[z3',z1r]; z3'r=whatever[z3',z2l];
cap_serifs_tl(1l); cap_serifs_tr(1r); cap_serifs_tr(2r); cap_serifs_tl(2l);
filldraw z1l--z1l.a{left}..{right}z1l.c..diag_serif(1l,3l)--z3l--
         diag_serif(2r,3l)..{right}z2r.c..z2r.a---z2l.a..{right}z2l.c
	 ..diag_serif(2l,3')---z3'r..z3'l---diag_serif(1r,3')
	 ..z1r.c{right}..z1r.a---cycle;
penlabels(1,1',2,2',3,3',4,5,6,7);
);

iff known chars.latin_V:
bskchar "The letter V";
beginchar(chars.latin_V,14u#,cap_height#,0); uni "0x0056";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
numeric alpha, right_stem, left_stem;
pickup tiny.nib;
usechar;
math_fit(-cap_height#*slant,ic#-5u#);
endchar;

iff known chars.latin_V_BB:
bskchar "The blackboard-bold letter V";
beginchar(chars.latin_V_BB,14u#,cap_height#,0); uni "0x1D54D";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
numeric alpha, right_stem, left_stem;
pickup tiny.nib;
usechar;
oblu.more:=3oblu;
top y100=y1l.c; z100=whatever[z1l.bb,z3l];
infill z1l.bb---ifobl(3l,3',1l.bb,1r.bb,more,)---z1r.bb
       ..obl(1r,3',1l)---z1l...obl(100,1l.c,1l.bb)---cycle;
math_fit(0,ic#-3u#);
endchar;

iff known chars.latin_V_SS:
bskchar "The sans-serif letter V";
beginchar(chars.latin_V_SS,13.5u#,cap_height#,0); uni "0x1D5B5";
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
numeric alpha, right_stem, left_stem;
pickup tiny.nib;
lft x1l=2u; rt x2r=w-1.5u; top y1l=top y2r=h;
x3l=.5w+o; bot y3l=-apex_o;
left_stem=cap_stem;
right_stem=cap_hair;
alpha=diag_ratio(2,left_stem,y1l-y3l,x3l-x1l);
pos1(alpha*left_stem,0); pos2(alpha*right_stem,0);
pos1'(alpha*left_stem,0); pos2'(alpha*right_stem,0);
pos4(.65cap_hair,90); pos5(.65cap_hair,90);
z1'l=z3l=z2'r;
z3'=whatever[z1'r,z1r]=whatever[z2'l,z2l]; 
y3'l=y3'r=y3'+.25[cap_hair,cap_stem]; 
z3'l=whatever[z3',z1r]; z3'r=whatever[z3',z2l];
cap_serifs_tl(1l); cap_serifs_tr(1r); cap_serifs_tr(2r); cap_serifs_tl(2l);
y100l=y100r=y101l=y101r=.5[y1l.b,y1];
z100l=whatever[z1l,z3l]; z100r=whatever[z1r,z3'];
z101l=whatever[z3',z2l]; z101r=whatever[z2r,z3l];
filldraw z1..z100l---z3l---z101r...z2...z101l---z3'r..z3'l---z100r..cycle;
penlabels(1,1',2,2',3,3',4,5,6,7);
math_fit(0,ic#-2u#);
endchar;

charscription(19u,cap_height,0)(
numeric alpha[], right_stem, left_stem;
oblu:=2oblu;
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3=.5w if monospace: +.5(cap_stem-cap_hair) fi; top y3=h if monospace and (x2r-x1l<4cap_stem): -1/3(x2r-x1l) else: +o fi; .5[x4,x5]=x3; x5-x4=.37w;
bot y4=bot y5=-apex_o;
left_stem=cap_stem;
right_stem=cap_hair;
alpha1=diag_ratio(1,left_stem,y1l-y4,x4-x1l);
alpha2=diag_ratio(1,right_stem,y2r-y5,x2r-x5);
alpha3=diag_ratio(1,left_stem,y3-y5,x5-x3);
alpha4=diag_ratio(1,right_stem,y3-y4,x3-x4);
pos1(alpha1*left_stem,0); pos2(alpha2*right_stem,0);
cap_serifs_tl(1l); cap_serifs_tr(1r);
cap_serifs_tl(2l); cap_serifs_tr(2r);
bot y1'=bot y2'=-o; z1'=z1r+whatever*(z1l-z4); z2'=z2l+whatever*(z2r-z5);
y5'=y4'=y3; x3-x5'=alpha3*(left_stem-tiny); x4'-x3=alpha4*(right_stem-tiny);
z0=whatever[z4,z4']=whatever[z5,z5'];
z2''=whatever[z2l,z2']=whatever[z3,z5+(x3-x5')*right];
z1''=whatever[z1r,z1']=whatever[z3,z4+(x4'-x3)*left];
filldraw z1l.a..{right}z1l.c..diag_serif(1l,4)---z4---
         obl(0,4,5)---z5---diag_serif(2r,5)..{right}z2r.c
	 ..z2r.a---z2l.a..{right}z2l.c..diag_serif(2l,2')---
	 obl(2'',2l,3)---z3---obl(1'',3,1r)---
	 diag_serif(1r,1'')..z1r.c{right}..z1r.a--cycle;
penlabels(1,2,3,4,5,6,7); labels(0,1',1'',2',2'',4',5');
);

iff known chars.latin_W:
bskchar "The letter W";
beginchar(chars.latin_W,19u#,cap_height#,0); uni "0x0057";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
math_fit(-cap_height#*slant,ic#-5u#);
endchar;

iff known chars.latin_Wcircumflex:
bskchar "The letter W with circumflex";
beginchar(chars.latin_Wcircumflex,19u#,Acc_height#,0); uni "0x0174";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x4';
circumflex(100,101,102).capital;
endchar;

iff known chars.latin_Wgrave:
bskchar "The letter W with grave";
beginchar(chars.latin_Wgrave,19u#,Acc_height#,0); uni "0x1E80";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
.5[x101,x100]=x4';
grave(100,101).capital;
endchar;

iff known chars.latin_Wacute:
bskchar "The letter W with acute";
beginchar(chars.latin_Wacute,19u#,Acc_height#,0); uni "0x1E82";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
.5[x101,x100]=x4';
acute(100,101).capital;
endchar;

iff known chars.latin_Wumlaut:
bskchar "The letter W with umlaut";
beginchar(chars.latin_Wumlaut,19u#,Acc_height#,0); uni "0x1E84";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
.5[x100,x101]=x4'; lft x101=x1'';
umlaut(100,101);
endchar;

iff known chars.latin_W_BB:
bskchar "The blackboard-bold letter W";
beginchar(chars.latin_W_BB,19u#,cap_height#,0); uni "0x1D54E";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
oblu:=f_obl;
oblu.more:=3f_obl;
top y100=y1l.c; z100=whatever[z1l.bb,z4];
infill ifobl(4,1'',1l.bb,1r.bb,more,)---z1r.bb
       ..obl(1r,1'',1l)---z1l...obl(100,1l.c,1l.bb)---cycle;
infill ifobl(3,0,2'',5,more,)---ifobl(5,2'',0,3,more,)---cycle;
math_fit(0,ic#-3u#);
endchar;

iff known chars.latin_W_SS:
bskchar "The sans-serif letter W";
beginchar(chars.latin_W_SS,18u#,cap_height#,0); uni "0x1D5B6";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
numeric alpha[], right_stem, left_stem;
oblu:=2oblu;
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3=.5w if monospace: +.5(cap_stem-cap_hair) fi; top y3=h if monospace and (x2r-x1l<4cap_stem): -1/3(x2r-x1l) else: +o fi; .5[x4,x5]=x3; x5-x4=.37w;
bot y4=bot y5=-apex_o;
left_stem=cap_stem;
right_stem=cap_hair;
alpha1=diag_ratio(1,left_stem,y1l-y4,x4-x1l);
alpha2=diag_ratio(1,right_stem,y2r-y5,x2r-x5);
alpha3=diag_ratio(1,left_stem,y3-y5,x5-x3);
alpha4=diag_ratio(1,right_stem,y3-y4,x3-x4);
pos1(alpha1*left_stem,0); pos2(alpha2*right_stem,0);
cap_serifs_tl(1l); cap_serifs_tr(1r);
cap_serifs_tl(2l); cap_serifs_tr(2r);
bot y1'=bot y2'=-o; z1'=z1r+whatever*(z1l-z4); z2'=z2l+whatever*(z2r-z5);
y5'=y4'=y3; x3-x5'=alpha3*(left_stem-tiny); x4'-x3=alpha4*(right_stem-tiny);
z0=whatever[z4,z4']=whatever[z5,z5'];
z2''=whatever[z2l,z2']=whatever[z3,z5+(x3-x5')*right];
z1''=whatever[z1r,z1']=whatever[z3,z4+(x4'-x3)*left];
y100l=y100r=y101l=y101r=.5[y1l.b,y1];
z100l=whatever[z1l,z4]; z100r=whatever[z1r,z1''];
z101l=whatever[z2'',z2l]; z101r=whatever[z2r,z5];
filldraw z1..z100l---z4---obl(0,4,5)---z5---z101r...z2...z101l---obl(2'',2l,3)---z3
         ---obl(1'',3,1r)---z100r..cycle;
penlabels(1,2,3,4,5,6,7); labels(0,1',1'',2',2'',4',5');
math_fit(0,ic#-2u#);
endchar;

iff known chars.sign_won:
bskchar "Won sign";
beginchar(chars.sign_won,19u#,cap_height#,0); uni "0x20A9";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
numeric alpha[], right_stem, left_stem;
oblu:=2oblu;
pos8(hair,90); pos9(hair,90); pos10(hair,90); pos11(hair,90);
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3=.5w if monospace: +.5(cap_stem-cap_hair) fi; top y3=h if monospace and (x2r-x1l<4cap_stem): -1/3(x2r-x1l) else: +o fi; .5[x4,x5]=x3; x5-x4=.37w;
bot y4=bot y5=-apex_o;
left_stem=cap_stem;
right_stem=cap_hair;
alpha1=diag_ratio(1,left_stem,y1l-y4,x4-x1l);
alpha2=diag_ratio(1,right_stem,y2r-y5,x2r-x5);
alpha3=diag_ratio(1,left_stem,y3-y5,x5-x3);
alpha4=diag_ratio(1,right_stem,y3-y4,x3-x4);
pos1(alpha1*left_stem,0); pos2(alpha2*right_stem,0);
cap_serifs_tl(1l); cap_serifs_tr(1r);
cap_serifs_tl(2l); cap_serifs_tr(2r);
bot y1'=bot y2'=-o; z1'=z1r+whatever*(z1l-z4); z2'=z2l+whatever*(z2r-z5);
y5'=y4'=y3; x3-x5'=alpha3*(left_stem-tiny); x4'-x3=alpha4*(right_stem-tiny);
z0=whatever[z4,z4']=whatever[z5,z5'];
z2''=whatever[z2l,z2']=whatever[z3,z5+(x3-x5')*right];
z1''=whatever[z1r,z1']=whatever[z3,z4+(x4'-x3)*left];
y8=y9=x_height; y10=y11=bar_height;
lft x8=lft x10=u; rt x9=rt x11=w-u;
y8'r=y8''r=y8'''r=y9'r=y9''r=y9'''r=y8r; y8'l=y8''l=y8'''l=y9'l=y9''l=y9'''l=y8l;
y10'r=y11'r=y10r; y10'l=y11'l=y10l;
z8'r=whatever[z1l,z4]; z8'l=whatever[z1l,z4]; z10'r=whatever[z1l,z4]; z10'l=whatever[z1l,z4];
z9'r=whatever[z2r,z5]; z9'l=whatever[z2r,z5]; z11'r=whatever[z2r,z5]; z11'l=whatever[z2r,z5];
z9''r=whatever[z2'',z2l]; z9''l=whatever[z2'',z2l]; z9'''r=whatever[z2'',z3]; z9'''l=whatever[z2'',z3];
z8''r=whatever[z1'',z1r]; z8''l=whatever[z1'',z1r]; z8'''r=whatever[z1'',z3]; z8'''l=whatever[z1'',z3];
filldraw z1l.a..{right}z1l.c..diag_serif(1l,4)---obl(8'r,1l,8r)---z8r
         ..z8l---obl(8'l,8l,10'r)---obl(10'r,8'l,10r)---z10r..z10l---obl(10'l,10l,4)
	 ---z4---obl(0,4,5)---z5---obl(11'l,5,11l)---z11l..z11r---obl(11'r,11r,9'l)
	 ---obl(9'l,11'l,9l)---z9l..z9r---obl(9'r,9r,2r)---diag_serif(2r,5)
	 ..{right}z2r.c..z2r.a---z2l.a..{right}z2l.c..diag_serif(2l,2')
	 ---obl(9''r,2l,9'''r)---obl(9'''r,9''r,3)---z3---obl(8'''r,3,8''r)
	 ---obl(8''r,8'''r,1r)---diag_serif(1r,1'')..z1r.c{right}..z1r.a--cycle;
infill obl(9''l,9'''l,2'')---obl(2'',9''l,9'''l)---obl(9'''l,2'',9''l)---cycle;
infill obl(8''l,8'''l,1'')---obl(1'',8''l,8'''l)---obl(8'''l,1'',8''l)---cycle;
penlabels(1,2,3,4,5,6,7,8,9,10,11); labels(0,1',1'',2',2'',4',5');
endchar;

charscription(15u,cap_height,0)(
oblu:=1.5oblu;
numeric alpha[];
lft x1l=2.5u; top y1l=h; rt x2r=w-2u; bot y2r=0;
x3r=w-x1l; top y3r=h; lft x4l=2u; bot y4l=0;
alpha1=diag_ratio(2,cap_stem,y1l-y2r,x1l-x2r);
alpha2=diag_ratio(1,cap_hair,y3r-y4l,x3r-x4l);
pos1(alpha1*cap_stem,0); pos2(alpha1*cap_stem,0);
pos3(alpha2*cap_hair,0); pos4(alpha2*cap_hair,0);
cap_serifs_tl(1l); cap_serifs_tr(1r); cap_serifs_bl(2l); cap_serifs_br(2r);
cap_serifs_tl(3l); cap_serifs_tr(3r); cap_serifs_bl(4l); cap_serifs_br(4r);
z1'=whatever[z1l,z2l]=whatever[z3l,z4l]; 
z2'=whatever[z1r,z2r]=whatever[z3r,z4r];
z3'=whatever[z1r,z2r]=whatever[z3l,z4l];
z4'=whatever[z1l,z2l]=whatever[z3r,z4r]; 
filldraw z1l.a..{right}z1l.c..diag_serif(1l,2l)---obl(1',1l,4l)---
         diag_serif(4l,1')..{left}z4l.c..z4l.a{right}..z4+ser_boule*up..
	 {right}z4r.a..{left}z4r.c..diag_serif(4r,4')---obl(4',4r,2l)---
	 diag_serif(2l,1l)..{left}z2l.c..z2l.a{right}..z2+ser_boule*up..
	 {right}z2r.a..{left}z2r.c..diag_serif(2r,1r)---obl(2',2r,3r)---
	 diag_serif(3r,2')..{right}z3r.c..z3r.a---z3l.a..
	 {right}z3l.c..diag_serif(3l,3')---obl(3',3l,1r)---
	 diag_serif(1r,3')..{right}z1r.c..z1r.a---cycle;
penlabels(1,2,3,4); labels(1',2',3',4',5');
);

iff known chars.latin_X:
bskchar "The letter X";
beginchar(chars.latin_X,15u#,cap_height#,0); uni "0x0058";
italcorr cap_height#*slant+.4u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
math_fit(0,u#);
endchar;

iff known chars.latin_X_BB:
bskchar "The blackboard-bold letter X";
beginchar(chars.latin_X_BB,15u#,cap_height#,0); uni "0x1D54F";
italcorr cap_height#*slant+.4u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
oblu:=f_obl;
top y100=y1l.c; bot y101=y2r.c; z100=whatever[z1l.bb,z2l]; z101=whatever[z2r.bb,z1r];
infill obl(100,1l.c,2l)---obl(2l,100,2r)---z2r...obl(101,2r.c,1r)---obl(1r,101,1l)---z1l...cycle;
endchar;

iff known chars.latin_X_SS:
bskchar "The sans-serif letter X";
beginchar(chars.latin_X_SS,13u#,cap_height#,0); uni "0x1D5B7";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
oblu:=1.5oblu;
numeric alpha[];
lft x1l=2u; top y1l=h; x2r=w-x4l; bot y2r=0;
x3r=w-x1l; top y3r=h; x4l=x1l-.5u; bot y4l=0;
alpha1=diag_ratio(2,cap_stem,y1l-y2r,x1l-x2r);
alpha2=diag_ratio(1,cap_hair,y3r-y4l,x3r-x4l);
pos1(alpha1*cap_stem,0); pos2(alpha1*cap_stem,0);
pos3(alpha2*cap_hair,0); pos4(alpha2*cap_hair,0);
cap_serifs_tl(1l); cap_serifs_tr(1r); cap_serifs_bl(2l); cap_serifs_br(2r);
cap_serifs_tl(3l); cap_serifs_tr(3r); cap_serifs_bl(4l); cap_serifs_br(4r);
z1'=whatever[z1l,z2l]=whatever[z3l,z4l]; 
z2'=whatever[z1r,z2r]=whatever[z3r,z4r];
z3'=whatever[z1r,z2r]=whatever[z3l,z4l];
z4'=whatever[z1l,z2l]=whatever[z3r,z4r]; 
y100l=y100r=y101l=y101r=.5[y1l.b,y1];
y102l=y102r=y103l=y103r=.5[y2l.b,y2];
z100l=whatever[z1l,z2l]; z100r=whatever[z1r,z2r];
z101l=whatever[z4l,z3l]; z101r=whatever[z4r,z3r];
z102l=whatever[z1l,z2l]; z102r=whatever[z1r,z2r];
z103l=whatever[z4l,z3l]; z103r=whatever[z4r,z3r];
filldraw z100l---obl(1',1l,4l)---z103l...z4...z103r---obl(4',4r,2l)---z102l..z2..z102r
         ---obl(2',2r,3r)---z101r...z3...z101l---obl(3',3l,1r)---z100r..z1..cycle;
penlabels(1,2,3,4,100,101,102,103); labels(1',2',3',4',5');
endchar;

charscription(14u,cap_height,0)(
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=.5h; x1=x2=.5w;
pos3(whatever,0); pos4(whatever,0);
lft x3l=2u; rt x4r=w-2u; top y3l=top y4r=h; 
z3r=z2r+whatever*(z3l-z2l); z4l'=z2r+(0,cap_hair-tiny) rotated (angle(z4r-z2r));
z4l=z4l'+whatever*(z4r-z2r); z2'=whatever[z4l',z4l]=whatever[z2r,z3r];
z0'=z2r+(u,0) rotated (angle(z4r-z2r)); z0'''=z2l+(u,0) rotated (angle(z3l-z2l));
z0''=z2'+(u,0) rotated (angle(z4l-z2')); z0''''=z2'+(u,0) rotated (angle(z3r-z2r));
cap_serifs_bl(1l); cap_serifs_br(1r); cap_serifs_tl(3l); cap_serifs_tr(3r); cap_serifs_tr(4r); cap_serifs_tl(4l);
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..z1r.c{left}..z1r.b---z2r+u*down..z0'---
         diag_serif(4r,2r)..{right}z4r.c..z4r.a---z4l.a..
	 {right}z4l.c..diag_serif(4l,4l')---z0''...z0''''---
	 diag_serif(3r,2')..{right}z3r.c..z3r.a---z3l.a..
	 {right}z3l.c..diag_serif(3l,2l)---z0'''..z2l+u*down--cycle;
penlabels(1,2,3,4); labels(0',0'',0''',0,0'''',2',4l');
);

iff known chars.latin_Y:
bskchar "The letter Y";
beginchar(chars.latin_Y,14u#,cap_height#,0); uni "0x0059";
italcorr cap_height#*slant+.5u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
math_fit(-cap_height#*slant,ic#-4.5u#);
endchar;

iff known chars.latin_Ygrave:
bskchar "The letter Y with grave";
beginchar(chars.latin_Ygrave,14u#,Acc_height#,0); uni "0x1EF2";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2+u;
grave(100,101).capital;
endchar;

iff known chars.latin_Yacute:
bskchar "The letter Y with acute";
beginchar(chars.latin_Yacute,14u#,Acc_height#,0); uni "0x00DD";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2-u;
acute(100,101).capital;
endchar;

iff known chars.latin_Ymacron:
bskchar "The letter Y with macron";
beginchar(chars.latin_Ymacron,14u#,Acc_height#-.1x_height#,0); uni "0x0232";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=x3r.a; x101=x4l.a;
macron(100,101);
endchar;

iff known chars.latin_Yumlaut:
bskchar "The letter Y with umlaut";
beginchar(chars.latin_Yumlaut,14u#,Acc_height#,0); uni "0x0178";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x100=x3r; x101=x4l;
umlaut(100,101);
endchar;

iff known chars.latin_Ycircumflex:
bskchar "The letter Y with circumflex";
beginchar(chars.latin_Ycircumflex,14u#,Acc_height#,0); uni "0x0176";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
x101=x2+o;
circumflex(100,101,102).capital;
endchar;

iff known chars.latin_Y_BB:
bskchar "The blackboard-bold letter Y";
beginchar(chars.latin_Y_BB,14u#,cap_height#,0); uni "0x1D550";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
usechar;
bot z100=(x1r,y1r.c); top y101=y3l.c; z101=whatever[z3l.bb,z2l];
infill obl(3r,3l,2r)---obl(2r,3r,1r)---obl(100,2r,1r.c)...z1r---obl(1l,1r,2l)---obl(2l,1l,3l)---obl(101,2l,3l.c)...z3l---cycle;
math_fit(0,ic#-3u#);
endchar;

iff known chars.latin_Y_SS:
bskchar "The sans-serif letter Y";
beginchar(chars.latin_Y_SS,14u#,cap_height#,0); uni "0x1D5B8";
italcorr cap_height#*slant;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=.5h; x1=x2=.5w;
pos3(whatever,0); pos4(whatever,0);
lft x3l=2u; rt x4r=w-2u; top y3l=top y4r=h; 
z3r=z2r+whatever*(z3l-z2l); z4l'=z2r+(0,cap_hair-tiny) rotated (angle(z4r-z2r));
z4l=z4l'+whatever*(z4r-z2r); z2'=whatever[z4l',z4l]=whatever[z2r,z3r];
z0'=z2r+(u,0) rotated (angle(z4r-z2r)); z0'''=z2l+(u,0) rotated (angle(z3l-z2l));
z0''=z2'+(u,0) rotated (angle(z4l-z2')); z0''''=z2'+(u,0) rotated (angle(z3r-z2r));
cap_serifs_bl(1l); cap_serifs_br(1r); cap_serifs_tl(3l); cap_serifs_tr(3r); cap_serifs_tr(4r); cap_serifs_tl(4l);
y100l=y100r=y101l=y101r=.5[y3l.b,y3];
z100l=whatever[z3l,z2l]; z100r=whatever[z3r,z2'];
z101l=whatever[z0'',z4l]; z101r=whatever[z2r,z0'];
filldraw z1l.b..z1..z1r.b---z2r+u*down..z0'---z101r...z4...z101l---z0''...z0''''
         ---z100r..z3..z100l---z0'''..z2l+u*down---cycle;
penlabels(1,2,3,4,100,101); labels(0',0'',0''',0,0'''',2',4l');
math_fit(0,ic#-2u#);
endchar;

iff known chars.sign_yen:
bskchar "Yen symbol";
beginchar(chars.sign_yen,14u#,cap_height#,0); uni "0x00A5";
italcorr cap_height#*slant+.75u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
pickup tiny.nib; oblu.more:=2f_obl;
pos1(cap_stem,0); pos2(cap_stem,0);
bot y1=0; top y2=.5h; x1=x2=.5w;
pos3(whatever,0); pos4(whatever,0);
forsuffixes i=5,6,7,8,9,12: pos.i(bar,90); endfor;
lft x3l=2u; rt x4r=w-2u; top y3l=top y4r=h; 
z3r=z2r+whatever*(z3l-z2l); z4l'=z2r+(0,cap_hair-tiny) rotated (angle(z4r-z2r));
z4l=z4l'+whatever*(z4r-z2r); z2'=whatever[z4l',z4l]=whatever[z2r,z3r];
z0'=z2r+(u,0) rotated (angle(z4r-z2r)); z0'''=z2l+(u,0) rotated (angle(z3l-z2l));
z0''=z2'+(u,0) rotated (angle(z4l-z2')); z0''''=z2'+(u,0) rotated (angle(z3r-z2r));
cap_serifs_bl(1l); cap_serifs_br(1r); cap_serifs_tl(3l); cap_serifs_tr(3r); cap_serifs_tr(4r); cap_serifs_tl(4l);
y5=y6=y7=y8=.75bar_height; y9=y10=y11=y12=max(x_height,y0''''+cap_hair);
x6=x1l; x7=x1r; lft x5=lft x9=2u; rt x8=rt x12=w-2u;
z13=point 0 of diag_serif(4r,2r);
z14=point 0 of diag_serif(3l,2l);
y10l=y11l=y12l; y10r=y11r=y12r;
z11l=whatever[z13,z0']; z11r=whatever[z13,z0'];
z10l=whatever[z14,z0''']; z10r=whatever[z14,z0'''];
bskpoints(5,8,bar,bar); bskpoints(9,12,bar,bar);
filldraw z1l.b{down}..{left}z1l.c..z1l.a{right}..z1+ser_boule*up..
         {right}z1r.a..z1r.c{left}..z1r.b---obl(7l,1r,8l)---z8ll..z8r
	 ---obl(7r,8r,2r)---z2r+u*down..z0'---obl(11l,0',12l)---z12ll
	 ..z12r---obl(11r,12r,13).more---
         z13{z4r-z2r}..{right}z4r.c..z4r.a---z4l.a..
	 {right}z4l.c..diag_serif(4l,4l')---z0''...z0''''---
	 diag_serif(3r,2')..{right}z3r.c..z3r.a---z3l.a..
	 {right}z3l.c..z14---obl(10r,14,9r).more---z9rr..z9l
	 ---obl(10l,9l,0''')---z0'''..z2l+u*down
	 ---obl(6r,2l,5r)---z5rr..z5l---obl(6l,5l,1l)---cycle;
penlabels(1,2,3,4,5,6,7,8,9,10,11,12); labels(0',0'',0''',0,0'''',2',4l',5rr,8ll,9rr,12ll);
endchar;

charscription(13u,cap_height,0)(
numeric alpha;
lft x1l=u; bot y1l=0; rt x2r=w-u-o; top y2r=h;
x2r-x2l=x1r-x1l;
alpha=diag_ratio(2,cap_stem,y2r-y1l,x2r-x1l);
pos1(alpha*cap_stem,0); pos2(alpha*cap_stem,0);
bot y4r=0; rt x4r=w-u; top y5r=h; x5r=1.5u;
pickup nullpen;
{{save filldraw; def filldraw:= draw enddef; arm_bot_r(1r,4); arm_top_l(2l,5)}};
pickup tiny.nib; 
x1'=x4e; z1'=whatever[z1r,z2r];
y2'=y5f; z2'=whatever[z1l,z2l];
filldraw z1l---z4a..{right}z4b...z4r+cap_hair*up---z4l..{down}z4l.o&
         z4l.o..z4.c..z4.d---z4e+o*right{left}..z1'---z2r---z5b..z5r+cap_hair*down---
	 z5l..z5c{dir55}..z5d---z5e..z2'---cycle;
penlabels(1,2,3,4); labels(0',0'',0''',0,0'''',2',4l');
);

iff known chars.latin_Z:
bskchar "The letter Z";
beginchar(chars.latin_Z,13u#,cap_height#,0); uni "0x005A";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
math_fit(-.5u#,.75ic#);
endchar;

iff known chars.latin_Zcaron:
bskchar "The letter Z with caron";
beginchar(chars.latin_Zcaron,13u#,Acc_height#,0); uni "0x017D";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=.5[x5,x2r];
hacek(100,101,102).capital;
endchar;

iff known chars.latin_Zdotabove:
bskchar "The letter Z with dot above";
beginchar(chars.latin_Zdotabove,13u#,Acc_height#,0); uni "0x017B";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=.5[x5,x2r];
dotabove(100);
endchar;

iff known chars.latin_Zacute:
bskchar "The letter Z with acute";
beginchar(chars.latin_Zacute,13u#,Acc_height#,0); uni "0x0179";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
.25[x101,x100]=.5[x5,x2r];
acute(100,101).capital;
endchar;

iff known chars.latin_Z_BB:
bskchar "The blackboard-bold letter Z";
beginchar(chars.latin_Z_BB,13u#,cap_height#,0); uni "0x2124";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
oblu.more:=2oblu;
y100=y4e; x100=.5[x1r,x4e];
infill ifobl(2l,2r,1l,1r,,more)---obl(1',2r,1r)...z100..z1r
       ---obl(1l,1r,2l).more---cycle;
labels(100);
endchar;

iff known chars.latin_Z_SS:
bskchar "The sans-serif letter Z";
beginchar(chars.latin_Z_SS,13u#,cap_height#,0); uni "0x1D5B9";
italcorr cap_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
numeric alpha;
lft x1l=u; bot y1l=0; rt x2r=w-u-o; top y2r=h;
x2r-x2l=x1r-x1l;
alpha=diag_ratio(2,cap_stem,y2r-y1l,x2r-x1l);
pos1(alpha*cap_stem,0); pos2(alpha*cap_stem,0);
pos4(cap_hair,-90); pos5(cap_hair,90);
bot y4r=0; rt x4r=w-u; top y5r=h; x5r=1.5u;
y1'=y4l; z1'=whatever[z1r,z2r];
y2'=y5l; z2'=whatever[z1l,z2l];
oblu:=.5[cap_hair,cap_stem];
filldraw z1l---z4r+cap_stem*left...z4...z4l+cap_stem*left---obl(1',4l,2r)---z2r
         ---z5r+cap_stem*right...z5...z5l+cap_stem*right---obl(2',5l,1l)---cycle;
penlabels(1,2,3,4,5); labels(0',0'',0''',0,0'''',2',4l');
endchar;

bskboundary;

charscription(9u,x_height,0)(
numeric aend; aend:=stem; oblu:=2oblu;
path p[]; numeric tim[];
pos0(hair,180); pos0'(.9[stem,hair],90); pos1(stem,0); pos2(stem,0);
pos3(hair,90); pos4(aend,180); z4'=z4+.2aend*down+o*right; 
z4''=z4+.5(aend-currentbreadth)*dir135;
rt x1r=w-u-stem; x2=x1; y1=stem+hair; y2=h-like_curve;
x0l=w-u; y0=2/3(x0r-x1r); y0'l=0; x0'=.5[x0r,x1r];
x3=.5[x1r,lft u]; top y3r=h+o; 
y4''=.5[y2,y3l]; lft x4r=u+o; 
z5l=z2l; z6l=z5l+like_hair*down; z7=(u,y1);
pos6(hair,angle(z7-z6l)+90);
pos8(curve,30); lft x8l=u; y8r=y7-like_hair;
pos9(hair,120); x9r=x3; y9l=o;
pos10(hair,angle(z1-z9l)+90); z10l=z1;
p0=z0l{dir(angle(z0'l-z0r)+10)}..z0'l{left}..z1l---z2l..{left}z3l..
   {down}z4l..z4'..{up}z4r..z4''..{right}z3r...z2r---z1r..
   {right}z0'r..{z0r-z0'}z0r;
p1=z10l{z9l-z1}..z9l..z8l..{z6l-z7-hair*up}z6l;
p2:=z10r{z9l-z1}..z9r..z8r..{z6r-z7-hair*up}z6r;
(tim1,tim2)=p0 intersectiontimes p1;
(tim3,tim4)=subpath(2,infinity) of p1 intersectiontimes p0;
(tim5,tim6)=p2 intersectiontimes p0;
(tim7,tim8)=subpath(2,infinity) of p2 intersectiontimes p0;
filldraw subpath(0,rundy(p0,tim1).zpet) of p0..
         subpath(rundy(p1,tim2),rundy(p1,2+tim3).zpet) of p1..
	 subpath(rundy(p0,tim4),infinity) of p0..cycle;
z11=point rundy(p0,tim8).zpet of p0;
z12=point rundy(p0,tim6) of p0;
infill subpath(rundy(p2,tim5),rundy(p2,2+tim7).zpet) of p2..
     if (y12>y11):
       subpath(tim8,tim6) of p0
     else:
       subpath(rundy(p0,tim8).zpet,rundy(p0,tim6)) of p0
     fi
     ..cycle;
penlabels(0,0',1,2,3,4,5,6,8,9,10); labels(4',4'',7,11,12);
);

iff known chars.latin_a:
bskchar "The letter a";
beginchar(chars.latin_a,9u#,x_height#,0); uni "0x0061";
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_aacute:
bskchar "The letter a with acute";
beginchar(chars.latin_aacute,9u#,asc_height#,0); uni "0x00E1";
italcorr asc_height#*slant-1.75u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x3; acute(100,101);
endchar;

iff known chars.latin_agrave:
bskchar "The letter a with grave";
beginchar(chars.latin_agrave,9u#,asc_height#,0); uni "0x00E0";
adjust_fit(0,0);
pickup tiny.nib;
usechar;
lft x100l=x4l; grave(100,101);
endchar;

iff known chars.latin_aumlaut:
bskchar "The letter a with umlaut";
beginchar(chars.latin_aumlaut,9u#,asc_height#-dot_size#,0); uni "0x00E4";
adjust_fit(0,0);
pickup tiny.nib;
usechar;
.5[x100,x101]=x3; umlaut(100,101);
endchar;

iff known chars.latin_adoublegrave:
bskchar "The letter a with doublegrave";
beginchar(chars.latin_adoublegrave,9u#,asc_height#,0); uni "0x0201";
pickup tiny.nib;
adjust_fit(0,0);
usechar;
x102-x100=3u;
d_grave(100,101,102,103,x3l);
endchar;

iff known chars.latin_acircumflex:
bskchar "The letter a with circumflex";
beginchar(chars.latin_acircumflex,9u#,asc_height#-.1x_height#,0); uni "0x00E2";
italcorr .5[asc_height#,x_height#]*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x3+2o;
circumflex(100,101,102);
endchar;

iff known chars.latin_acaron:
bskchar "The letter a with caron";
beginchar(chars.latin_acaron,9u#,asc_height#,0); uni "0x01CE";
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x3;
hacek(100,101,102);
endchar;

iff known chars.latin_abreve:
bskchar "The letter a with breve";
beginchar(chars.latin_abreve,9u#,asc_height#+apex_o#,0); uni "0x0103";
adjust_fit(0,0);
pickup tiny.nib;
usechar;
lft x101=x3+o; x102-x100=5u;
breve(100,101,102);
endchar;

iff known chars.latin_ainvbreve:
bskchar "The letter a with inverted breve";
beginchar(chars.latin_ainvbreve,9u#,asc_height#,0); uni "0x0203";
adjust_fit(0,0);
pickup tiny.nib;
usechar;
lft x101=x3+o; x102-x100=5u;
tieacc(100,101,102);
endchar;

iff known chars.latin_amacron:
bskchar "The letter a with macron";
beginchar(chars.latin_amacron,9u#,.5[asc_height#,x_height#],0); uni "0x0101";
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x4r;
macron(100,101);
endchar;

iff known chars.latin_atilde:
bskchar "The letter a with tilde";
beginchar(chars.latin_atilde,9u#,asc_height#,0); uni "0x00E3";
italcorr asc_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101-x100=6u; lft x.tilde=x3; 
tilde(100,101);
endchar;

iff known chars.latin_aring:
bskchar "The letter a with ring";
beginchar(chars.latin_aring,9u#,asc_height#,0); uni "0x00E5";
adjust_fit(0,0);
pickup tiny.nib;
usechar;
lft x100=x3; x100-x101=1.3u;
ring(100,101);
endchar;

iff known chars.latin_adotabove:
bskchar "The letter a with dot above";
beginchar(chars.latin_adotabove,9u#,asc_height#-.5dot_size#,0); uni "0x0227";
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x3l;
dotabove(100);
endchar;

iff known chars.latin_a_feminine:
bskchar "Feminine ordinal indicator (superscript a)";
beginchar(chars.latin_a_feminine,5.5u#,asc_height#-.5x_height#,0); uni "0x00AA";
adjust_fit(0,0);
pickup tiny.nib;
multiply(.85)(curve,hair,vair);
usechar shifted (-x8l+o,-y3r) scaled .5 shifted (u+(HH-.5x_height)*slant,HH);
endchar;

iff known chars.latin_aogonek:
bskchar "The letter a with ogonek";
beginchar(chars.latin_aogonek,9u#,x_height#,.85desc_depth#); uni "0x0105";
adjust_fit(0,0);
pickup tiny.nib;
numeric aend; aend:=stem; oblu:=2oblu;
path p[]; numeric tim[];
pos0(hair,180); pos0'(.9[stem,hair],90); pos1(stem,0); pos2(stem,0);
pos3(hair,90); pos4(aend,180); z4'=z4+.2aend*down+o*right; 
pos13(stem,0); pos14(curve,0); pos15(hair,45); pos16(hair,160);
z4''=z4+.5(aend-currentbreadth)*dir135;
rt x1r=w-u-stem; x2=x1; y1=stem+hair; y2=h-like_curve;
x0l=w-u; y0=2/3(x0r-x1r); y0'l=0; x0'=.5[x0r,x1r];
x3=.5[x1r,lft u]; top y3r=h+o; 
y4''=.5[y2,y3l]; lft x4r=u+o; 
z5l=z2l; z6l=z5l+like_hair*down; z7=(u,y1);
x13-x14l=1.5u; x13r=x0'; x15-x14l=3u; rt x16l-x15=1.5u;
y13=0; y14=-.5d; bot y15l=-d; y16=-2/3d;
pos6(hair,angle(z7-z6l)+90);
pos8(curve,30); lft x8l=u; y8r=y7-like_hair;
pos9(hair,120); x9r=x3; y9l=o;
pos10(hair,angle(z1-z9l)+90); z10l=z1;
p0=z0l{dir(angle(z0'l-z0r)+10)}..z0'l{left}..z1l---z2l..{left}z3l..
   {down}z4l..z4'..{up}z4r..z4''..{right}z3r...z2r---z1r..
   {right}z0'r..{z0r-z0'}z0r;
p1=z10l{z9l-z1}..z9l..z8l..{z6l-z7-hair*up}z6l;
p2:=z10r{z9l-z1}..z9r..z8r..{z6r-z7-hair*up}z6r;
p3:=reverse (z13l{z14l-z13r}..z14l...z15l..{z13-z14}z16l..z16r{z14-z13}..z15r..z14r..z13r);
(tim1,tim2)=p0 intersectiontimes p1;
(tim3,tim4)=subpath(2,infinity) of p1 intersectiontimes p0;
(tim5,tim6)=p2 intersectiontimes p0;
(tim7,tim8)=subpath(2,infinity) of p2 intersectiontimes p0;
filldraw subpath(0,rundy(p0,1).zpet) of p0
         ..subpath(rundy(p3,0),rundy(p3,infinity).zpet) of p3
	 ..subpath(rundy(p0,1),rundy(p0,tim1).zpet) of p0..
         subpath(rundy(p1,tim2),rundy(p1,2+tim3).zpet) of p1..
	 subpath(rundy(p0,tim4),infinity) of p0..cycle;
z11=point rundy(p0,tim8).zpet of p0;
z12=point rundy(p0,tim6) of p0;
infill subpath(rundy(p2,tim5),rundy(p2,2+tim7).zpet) of p2..
     if (y12>y11):
       subpath(tim8,tim6) of p0
     else:
       subpath(rundy(p0,tim8).zpet,rundy(p0,tim6)) of p0
     fi
     ..cycle;
penlabels(0,0',1,2,3,4,5,6,8,9,10,13,14,15,16); labels(4',4'',7,11,12);
endchar;

iff known chars.latin_a_BB:
bskchar "The blackboard-bold letter a";
beginchar(chars.latin_a_BB,9u#,x_height#,0); uni "0x1D552";
adjust_fit(0,0);
pickup tiny.nib;
numeric aend; aend:=.8cap_stem; oblu:=2oblu;
path p[]; numeric tim[];
pos0(hair,180); pos0'(.9[stem,hair],90); pos1(.8cap_stem,0); pos2(.8cap_stem,0);
pos3(hair,90); pos4(aend,180); z4'=z4+.2aend*down+o*right; 
z4''=z4+.5(aend-currentbreadth)*dir135;
rt x1r=w-u-stem; x2=x1; y1=stem+hair; y2=h-like_curve;
x0l=w-u; y0=2/3(x0r-x1r); y0'l=0; x0'=.5[x0r,x1r];
x3=.5[x1r,lft u]; top y3r=h+o; 
y4''=.5[y2,y3l]; lft x4r=u+o; 
z5l=z2l; z6l=z5l+like_hair*down; z7=(u,y1);
pos6(hair,angle(z7-z6l)+90);
pos8(cap_stem,30); lft x8l=u; y8=y7-like_hair;
pos9(hair,120); x9r=x3; y9l=o;
pos10(hair,angle(z1-z9l)+90); z10l=z1;
p0=z0l{dir(angle(z0'l-z0r)+10)}..z0'l{left}..z1l---z2l..{left}z3l..
   {down}z4l..z4'..{up}z4r..z4''..{right}z3r...z2r---z1r..
   {right}z0'r..{z0r-z0'}z0r;
p1=z10l{z9l-z1}..z9l..z8l..{z6l-z7-hair*up}z6l;
p2:=z10r{z9l-z1}..z9r..z8r..{z6r-z7-hair*up}z6r;
(tim1,tim2)=p0 intersectiontimes p1;
(tim3,tim4)=subpath(2,infinity) of p1 intersectiontimes p0;
(tim5,tim6)=p2 intersectiontimes p0;
(tim7,tim8)=subpath(2,infinity) of p2 intersectiontimes p0;
filldraw subpath(0,rundy(p0,tim1).zpet) of p0..
         subpath(rundy(p1,tim2),rundy(p1,2+tim3).zpet) of p1..
	 subpath(rundy(p0,tim4),infinity) of p0..cycle;
z11=point rundy(p0,tim8).zpet of p0;
z12=point rundy(p0,tim6) of p0;
infill subpath(rundy(p2,tim5),rundy(p2,2+tim7).zpet) of p2..
     if (y12>y11):
       subpath(tim8,tim6) of p0
     else:
       subpath(rundy(p0,tim8).zpet,rundy(p0,tim6)) of p0
     fi
     ..cycle;
p100:=subpath(1,4) of p0;
p101:=subpath(9,12) of p0;
p102:=subpath(1,infinity) of p1;
p103:=subpath(1,infinity) of p2;
z100=bsktouch(p100,up,p101,down);
z101=bsktouch(subpath(1,infinity) of p100,up,p101,down);
z102=bsktouch(p102,up,p103,down);
z103=bsktouch(p102,dir-30,p103,dir120);
tim100=xpart(p100 intersectiontimes (z100--(x100,0'l-5)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y1)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y1)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y3r+5)));
tim104=xpart(p102 intersectiontimes (z102--(x102,y9l-5)));
tim105=xpart(p103 intersectiontimes (z102--(x102,y12)));
tim106=xpart(p102 intersectiontimes (z103--(x103,y2)));
tim107=xpart(p103 intersectiontimes (z103--(x103,y7)));
oblu:=bbw;
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103),rundy(p101,tim101).zpet) of p101..cycle;
infill subpath(rundy(p102,tim104),rundy(p102,tim106).zpet) of p102
       ..reverse subpath(rundy(p103,tim105),rundy(p103,tim107).zpet) of p103..cycle;
penlabels(0,0',1,2,3,4,5,6,8,9,10); labels(4',4'',7,11,12,100,101,102,103);
endchar;

iff known chars.latin_a_SS:
bskchar "The sans-serif letter a";
beginchar(chars.latin_a_SS,9u#,x_height#,0); uni "0x1D5BA";
adjust_fit(0,-stem#);
pickup tiny.nib;
numeric aend; aend:=stem; oblu:=2oblu;
path p[]; numeric tim[];
pos0(hair,180); pos0'(.9[stem,hair],90); pos1(stem,0); pos2(stem,0);
pos3(hair,90); pos4(aend,180); z4'=z4+.2aend*down+o*right; 
z4''=z4+.5(aend-currentbreadth)*dir135;
rt x1r=w-u-stem; x2=x1; y1=stem+hair; y2=h-like_curve;
x0l=w-u; y0=2/3(x0r-x1r); y0'l=0; x0'=.5[x0r,x1r];
x3=.5[x1r,lft u]; top y3r=h+o; 
y4''=.5[y2,y3l]; lft x4r=u+o; 
z5l=z2l; z6l=z5l+like_hair*down; z7=(u,y1);
pos6(hair,angle(z7-z6l)+90);
pos8(curve,30); lft x8l=u; y8r=y7-like_hair;
pos9(hair,120); x9r=x3; y9l=o;
pos10(hair,angle(z1-z9l)+90); z10l=z1;
p0=(x1l,hair)---z2l..{left}z3l..{down}z4l..z4'..{up}z4r..z4''..{right}z3r...z2r---(x1r,hair)..(x1,0)..{up}(x1l,hair);
p1=z10l{z9l-z1}..z9l..z8l..{z6l-z7-hair*up}z6l;
p2:=z10r{z9l-z1}..z9r..z8r..{z6r-z7-hair*up}z6r;
(tim1,tim2)=p0 intersectiontimes p1;
(tim3,tim4)=subpath(2,infinity) of p1 intersectiontimes p0;
(tim5,tim6)=p2 intersectiontimes p0;
(tim7,tim8)=subpath(2,infinity) of p2 intersectiontimes p0;
filldraw subpath(0,rundy(p0,tim1).zpet) of p0..
         subpath(rundy(p1,tim2),rundy(p1,2+tim3).zpet) of p1..
	 subpath(rundy(p0,tim4),infinity) of p0..cycle;
z11=point rundy(p0,tim8).zpet of p0;
z12=point rundy(p0,tim6) of p0;
infill subpath(rundy(p2,tim5),rundy(p2,2+tim7).zpet) of p2..
     if (y12>y11):
       subpath(rundy(p0,(tim8,f_obl)).zpet,rundy(p0,(tim6,f_obl))) of p0
     else:
       subpath(rundy(p0,tim8).zpet,rundy(p0,tim6)) of p0
     fi
     ..cycle;
penlabels(0,0',1,2,3,4,5,6,8,9,10); labels(4',4'',7,11,12);
endchar;

iff known chars.latin_b:
bskchar "The letter b";
beginchar(chars.latin_b,11u#,asc_height#,0); uni "0x0062";
italcorr .5x_height#*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos1(hair,0); pos1'(hair,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
rt x1r=2u+stem; rt x3l=w-u; y1=.65x_height; y3=.5x_height; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x1'r=x1r; y1'=.2x_height;
if (y1'/hair)<2.5: x1'l:=x1'l-.5hair; fi;
bot y2l=-o; top y4l=x_height+o;
lft x5l=2u; bot y5=-d; top y6r=h; 
{{
  numeric oldserif; oldserif:=serif_drop; 
  save serif_drop; serif_drop:=.81oldserif;
  lowercase_points(5,6,jut); 
}};
p0=z1l{up}..z4l..z3l..z2l..{z1r-z2r}z1'l---cycle;
p1=z1r{up}..z4r..z3r..z2r..{up}z1'r--z1r;
p2=z5f--z6r;
tim1  =xpart(subpath (0,3) of p0 intersectiontimes p2);
tim2-3=xpart(subpath (3,5) of p0 intersectiontimes ((0,hair)--(w,hair)));
z7=point tim1 of p0 + like_stem*up; 
tim3  =xpart(p0 intersectiontimes ((0,y7-.5hair)--(w,y7-.5hair)));
y0=ypart(point tim2 of p0)+o; z0=whatever[z5l,z5f];
if (abs(z0-z1'l))<hair: y0:=y0-2o; fi;
p4=z1r{up}..z4r..z3r..z2r..(z2r+hair*left)..{up}z1'r--z1r;
filldraw z0---z5l+apex_o*down---lowercase_stem_upper(5,6)---z7
         ..subpath (tim3, tim2) of p0..cycle;
infill p4..cycle;
penlabels(1,1',2,3,4); labels(0,7);
endchar;

iff known chars.latin_b_BB:
bskchar "The blackboard-bold letter b";
beginchar(chars.latin_b_BB,11u#,asc_height#,0); uni "0x1D553";
italcorr .5x_height#*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos1(hair,0); pos1'(hair,0); pos2(hair,90); pos3(cap_stem,180); pos4(hair,270);
rt x1r=2u+.8cap_stem; rt x3l=w-u; y1=.65x_height; y3=.5x_height; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x1'r=x1r; y1'=.2x_height;
if (y1'/hair)<2.5: x1'l:=x1'l-.5hair; fi;
bot y2l=-o; top y4l=x_height+o;
lft x5l=2u; bot y5=-d; top y6r=h; 
{{
  numeric oldserif; oldserif:=serif_drop; 
  save serif_drop, stem; serif_drop:=.81oldserif; stem:=.8cap_stem;
  lowercase_points(5,6,jut); 
}};
p0=z1l{up}..z4l..z3l..z2l..{z1r-z2r}z1'l---cycle;
p1=z1r{up}..z4r..z3r..z2r..{up}z1'r--z1r;
p2=z5f--z6r;
tim1  =xpart(subpath (0,3) of p0 intersectiontimes p2);
tim2-3=xpart(subpath (3,5) of p0 intersectiontimes ((0,hair)--(w,hair)));
z7=point tim1 of p0 + like_stem*up; 
tim3  =xpart(p0 intersectiontimes ((0,y7-.5hair)--(w,y7-.5hair)));
y0=ypart(point tim2 of p0)+o; z0=whatever[z5l,z5f];
if (abs(z0-z1'l))<hair: y0:=y0-2o; fi;
p4=z1r{up}..z4r..z3r..z2r..(z2r+hair*left)..{up}z1'r--z1r;
filldraw z0---z5l+apex_o*down---lowercase_stem_upper(5,6)---z7
         ..subpath (tim3, tim2) of p0..cycle;
infill p4..cycle;
p100:=z5a--z5l;
p101:=z5l+apex_o*down--z0---obl(5f,5l,6r);
p102:=subpath(1,3) of p0;
p103:=subpath(1,3) of p4;
z100=bsktouch(p100,right,p101,dir135);
z101=bsktouch(p102,down,p103,up);
z102=bsktouch(p102,up,p103,down);
tim100=xpart(p100 intersectiontimes (z100--(0,y100)));
tim101=xpart(p101 intersectiontimes (z100--(w,y100)));
tim102=xpart(p102 intersectiontimes (z101--(x101,h)));
tim103=xpart(p103 intersectiontimes (z101--(x101,0)));
tim104=xpart(p102 intersectiontimes (z102--(x102,y2l-5)));
tim105=xpart(p103 intersectiontimes (z102--(x102,y3)));
infill ifobl(6r,6b,5r,5l,more,)---subpath(0,rundy(p100,tim100).zpet) of p100
       ..subpath(rundy(p101,tim101),infinity) of p101---cycle;
oblu:=bbw;
infill subpath(rundy(p102,tim102),rundy(p102,tim104).zpet) of p102
       ..reverse subpath(rundy(p103,tim103),rundy(p103,tim105).zpet) of p103..cycle;
penlabels(1,1',2,3,4); labels(0,7,100,101,102);
endchar;

iff known chars.latin_b_SS:
bskchar "The sans-serif letter b";
beginchar(chars.latin_b_SS,11u#,asc_height#,0); uni "0x1D5BB";
italcorr .5x_height#*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos1(hair,0); pos1'(hair,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
rt x1r=2u+stem; rt x3l=w-u; y1=.65x_height; y3=.5x_height; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x1'r=x1r; y1'=.2x_height;
if (y1'/hair)<2.5: x1'l:=x1'l-.5hair; fi;
bot y2l=0; top y4l=x_height+o;
lft x5l=2u; bot y5=-d; top y6r=h; 
{{
  numeric oldserif; oldserif:=serif_drop; 
  save serif_drop; serif_drop:=.81oldserif;
  lowercase_points(5,6,jut); 
}};
p0=z1l{up}..z4l..z3l..z2l..{z1r-z2r}z1'l---cycle;
p1=z1r{up}..z4r..z3r..z2r..{up}z1'r--z1r;
p2=z5f--z6r;
tim1  =xpart(subpath (0,3) of p0 intersectiontimes p2);
tim2-3=xpart(subpath (3,5) of p0 intersectiontimes ((0,hair)--(w,hair)));
z7=point tim1 of p0 + like_stem*up; 
tim3  =xpart(p0 intersectiontimes ((0,y7-.5hair)--(w,y7-.5hair)));
y0=ypart(point tim2 of p0)+o; z0=whatever[z5l,z5f];
if (abs(z0-z1'l))<hair: y0:=y0-2o; fi;
p4=z1r{up}..z4r..z3r..z2r..(z2r+hair*left)..{up}z1'r--z1r;
filldraw obl(5l,2l,6l)---z6b..z6r---z7..subpath (tim3, 3) of p0---cycle;
infill p4..cycle;
penlabels(1,1',2,3,4); labels(0,7);
endchar;

iff known chars.sign_blank_b:
bskchar "Blank b sign";
beginchar(chars.sign_blank_b,11u#,asc_height#,0); uni "0x2422";
italcorr .5x_height#*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu; oblu.light:=f_obl;
pos1(hair,0); pos1'(hair,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
rt x1r=2u+stem; rt x3l=w-u; y1=.65x_height; y3=.5x_height; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x1'r=x1r; y1'=.2x_height;
if (y1'/hair)<2.5: x1'l:=x1'l-.5hair; fi;
bot y2l=-o; top y4l=x_height+o;
lft x5l=2u; bot y5=-d; top y6r=h; 
{{
  numeric oldserif; oldserif:=serif_drop; 
  save serif_drop; serif_drop:=.81oldserif;
  lowercase_points(5,6,jut); 
}};
lft x8=.5u; x9=.5w+u; top y9=h-o; y8=.2[x_height,h];
theta:=angle(z9-z8)+90;
pos8(bar,theta); pos9(bar,theta); 
x8'l=x8'r=x5l; x9'l=x9'r=x5r; bskpoints(8,9,hair,hair);
z8'l=whatever[z8l,z9l]; z9'l=whatever[z8l,z9l];
z8'r=whatever[z8r,z9r]; z9'r=whatever[z8r,z9r];
p0=z1l{up}..z4l..z3l..z2l..{z1r-z2r}z1'l---cycle;
p1=z1r{up}..z4r..z3r..z2r..{up}z1'r--z1r;
p2=z5f--z6r;
tim1  =xpart(subpath (0,3) of p0 intersectiontimes p2);
tim2-3=xpart(subpath (3,5) of p0 intersectiontimes ((0,hair)--(w,hair)));
z7=point tim1 of p0 + like_stem*up; 
tim3  =xpart(p0 intersectiontimes ((0,y7-.5hair)--(w,y7-.5hair)));
y0=ypart(point tim2 of p0)+o; z0=whatever[z5l,z5f];
if (abs(z0-z1'l))<hair: y0:=y0-2o; fi;
p4=z1r{up}..z4r..z3r..z2r..(z2r+hair*left)..{up}z1'r--z1r;
filldraw z0---z5l+apex_o*down---obl(8'l,5l,8l)---z8l..z8rr
         ---obl(8'r,8r,6l).light---lowercase_stem_upper(5,6)
	 ---obl(9'r,6r,9r)---z9r..z9ll---obl(9'l,9l,7)---z7
         ..subpath (tim3, tim2) of p0..cycle;
infill p4..cycle;
penlabels(1,1',2,3,4,8,8',9,9'); labels(0,7,8rr,9ll);
endchar;

charscription(8.5u,x_height,0)(
numeric cend; cend:=stem;
pos1(curve,0); pos2(hair,90); pos3(hair,270); pos4(cend,20);
lft x1l=u; y1=.5h; x2=x3=.5w+hair; bot y2l=-o; top y3l=h+o; 
rt x0=w-u; y0=.2h; z0'=z0+hair*dir220; z3'r=z3r+like_hair*dir-10;
rt x4r=w-u; y4r=.85h;
z4'-z4l=hair*unitvector(z4l-z3r);
filldraw z0---z0'+o*down..{left}z2l..z1l..{right}z3l..
         z4r..z4'..{dir(angle(z4l-z4')-20)}z4l..
         z3'r..z3r{left}..z1r..{right}z2r..z0'---cycle;
penlabels(1,2,3,4); labels(0,0',3'r,4');
);

iff known chars.latin_c:
bskchar "The letter c";
beginchar(chars.latin_c,8.5u#,x_height#,0); uni "0x0063";
italcorr .5[x_height#,bar_height#]*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_ccaron:
bskchar "The letter c with caron";
beginchar(chars.latin_ccaron,8.5u#,asc_height#,0); uni "0x010D";
italcorr asc_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x3;
hacek(100,101,102);
endchar;

iff known chars.latin_cacute:
bskchar "The letter c with acute";
beginchar(chars.latin_cacute,8.5u#,asc_height#,0); uni "0x0107";
italcorr asc_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x4;
acute(100,101);
endchar;

iff known chars.latin_ccircumflex:
bskchar "The letter c with circumflex";
beginchar(chars.latin_ccircumflex,8.5u#,asc_height#-.1x_height#,0); uni "0x0109";
italcorr .5[asc_height#,x_height#]*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
lft x101=x3;
circumflex(100,101,102);
endchar;

iff known chars.latin_cdotabove:
bskchar "The letter c with dot above";
beginchar(chars.latin_cdotabove,8.5u#,asc_height#-.5dot_size#,0); uni "0x010B";
italcorr .5[x_height#,bar_height#]*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x3;
dotabove(100);
endchar;

iff known chars.latin_c_BB:
bskchar "The blackboard-bold letter c";
beginchar(chars.latin_c_BB,8.5u#,x_height#,0); uni "0x1D554";
italcorr .5[x_height#,bar_height#]*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric cend; cend:=stem;
pos1(cap_stem,0); pos2(hair,90); pos3(hair,270); pos4(cend,20);
lft x1l=u; y1=.5h; x2=x3=.5w+hair; bot y2l=-o; top y3l=h+o; 
rt x0=w-u; y0=.2h; z0'=z0+hair*dir220; z3'r=z3r+like_hair*dir-10;
rt x4r=w-u; y4r=.85h;
z4'-z4l=hair*unitvector(z4l-z3r);
filldraw z0---z0'+o*down..{left}z2l..z1l..{right}z3l..
         z4r..z4'..{dir(angle(z4l-z4')-20)}z4l..
         z3'r..z3r{left}..z1r..{right}z2r..z0'---cycle;
path p[]; numeric tim[];
oblu:=bbw;
p100:=z0---z0'+o*down..{left}z2l..z1l..{right}z3l;
p101:=z3r{left}..z1r..{right}z2r..z0'---z0;
z100=bsktouch(p100,up,p101,down);
z101=bsktouch(p100,down,p101,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y2l-5)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y1)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y3l+5)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y1)));
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103),rundy(p101,tim101).zpet) of p101..cycle;
penlabels(1,2,3,4); labels(0,0',3'r,4',100,101);
endchar;

iff known chars.latin_c_SS:
bskchar "The sans-serif letter c";
beginchar(chars.latin_c_SS,8.5u#,x_height#,0); uni "0x1D5BC";
italcorr .5[x_height#,bar_height#]*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric cend; cend:=stem;
pos1(curve,0); pos2(hair,90); pos3(hair,270); pos4(cend,20);
lft x1l=u; y1=.5h; x2=x3=.5w+hair; bot y2l=-o; top y3l=h+o; 
rt x0=w-u; y0=.2h; z0'=z0+hair*dir220; z3'r=z3r+like_hair*dir-10;
rt x4r=w-u; y4r=.85h;
z4'-z4l=hair*unitvector(z4l-z3r);
filldraw z0---z0'+o*down..{left}z2l..z1l..{right}z3l..
         z4r..z4'..{dir(angle(z4l-z4')-20)}z4l..
         z3'r..z3r{left}..z1r..{right}z2r..z0'---z0+o*up..cycle;
penlabels(1,2,3,4); labels(0,0',3'r,4');
endchar;

iff known chars.latin_ccedilla:
bskchar "The letter c with cedilla";
beginchar(chars.latin_ccedilla,8.5u#,x_height#,.65desc_depth#); uni "0x00E7";
italcorr .5[x_height#,bar_height#]*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric cend, tim[]; cend:=stem;
pos1(curve,0); pos2(hair,90); pos3(hair,270); pos4(cend,20);
pos5(.5stem,0); pos6(.5stem,0); pos7(.8stem,0); pos8(.5stem,-110);
lft x1l=u; y1=.5h; x2=x3=.5w+hair; bot y2l=-o; top y3l=h+o; 
rt x0=w-u; y0=.2h; z0'=z0+hair*dir220; z3'r=z3r+like_hair*dir-10;
rt x4r=w-u; y4r=.85h;
z4'-z4l=hair*unitvector(z4l-z3r);
x5r=x6r; z5r=z2l; y6=-hair; y7=-.5d;
rt x7r-lft x8r=4u; x5r-lft x8r=2u; y8r=-d;
p1:=z0---z0'+o*down..{left}z2l..z1l..{right}z3l;
p2:=z6r..{down}z7r..{left}z8r..{right}z8l..{up}z7l..z6l--z5l;
p3:=z5r{down}..subpath (rundy(p2,(0,curve)),infinity) of p2;
tim1=xpart(p1 intersectiontimes (z6r--(x5r,.5h)));
filldraw subpath(0,rundy(p1,2).zpet) of p1
         ..subpath(rundy(p3,0),rundy(p3,infinity).zpet) of p3
	 ..subpath(rundy(p1,tim1),infinity) of p1..
         z4r..z4'..{dir(angle(z4l-z4')-20)}z4l..
         z3'r..z3r{left}..z1r..{right}z2r..z0'if testdpi: +up-- else: --- fi cycle;
penlabels(1,2,3,4,5,6,7,8); labels(0,0',3'r,4');
endchar;

iff known chars.sign_cent:
bskchar "Cent sign";
beginchar(chars.sign_cent,8.5u#,asc_height#,comma_depth#); uni "0x00A2";
italcorr .5[x_height#,bar_height#]*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric cend, tim[]; cend:=stem;
path p[];
pos1(curve,0); pos2(hair,90); pos3(hair,270); pos4(cend,20);
lft x1l=u; y1=.5x_height; x2=x3=.5w+hair; bot y2l=-o; top y3l=x_height+o; 
rt x0=w-u; y0=.2x_height; z0'=z0+hair*dir220; z3'r=z3r+like_hair*dir-10;
rt x4r=w-u; y4r=.85x_height;
z4'-z4l=hair*unitvector(z4l-z3r);
top z5=(x3,h); z6=(x3,-d); pos5(hair, angle(z6-z5)+90); pos6(hair,angle(z6-z5)+90);
bskpoints(5,6,hair,hair);
p0:=z0---z0'+o*down..{left}z2l..z1l..{right}z3l..z4r..z4'..{dir(angle(z4l-z4')-20)}z4l;
p1:=z3l{right}..z4r..z4'..z4l{dir(angle(z4l-z4')-20)}..z3'r..z3r{left}..z1r..{right}z2r..z0'---z0;
p1:=subpath(3,infinity) of p1;
p2:=z6ll---z5l;
p3:=z5rr---z6r;
(tim0,tim1)=p0 intersectiontimes p3;
(tim2,tim3)=p0 intersectiontimes p2;
(tim4-3,tim5)=subpath (3,infinity) of p0 intersectiontimes p2;
(tim6-3,tim7)=subpath (3,infinity) of p0 intersectiontimes p3;
(tim8,tim9)=p1 intersectiontimes p3;
(tim10-3,tim11)=subpath(3,infinity) of p1 intersectiontimes p3;
(tim12,tim13)=p1 intersectiontimes p2;
(tim14-3,tim15)=subpath(3,infinity) of p1 intersectiontimes p2;
{{ if testdpi: save rundy; def rundy(expr p,t)suffix modifier:= t enddef; fi
filldraw subpath(0,rundy(p0,tim0).zpet) of p0
         ..subpath(rundy(p3,tim1),infinity) of p3
	 ---subpath(0,rundy(p2,tim3).zpet) of p2
	 ..subpath(rundy(p0,tim2),rundy(p0,tim4).zpet) of p0
	 ..subpath(rundy(p2,tim5),infinity) of p2
	 ..subpath(0,rundy(p3,tim7).zpet) of p3
	 ..subpath(rundy(p0,tim6),infinity) of p0
	 ..subpath(0,rundy(p1,tim8).zpet) of p1
	 ..subpath(rundy(p3,tim9),rundy(p3,tim11).zpet) of p3
	 ..subpath(rundy(p1,tim10),infinity) of p1..cycle;
}};
infill subpath(rundy(p1,tim12),rundy(p1,tim14).zpet) of p1
       ..subpath(rundy(p2,tim15),rundy(p2,tim13).zpet) of p2
       ..cycle; 
penlabels(1,2,3,4,5,6); labels(0,0',3'r,4',5rr,6ll);
endchar;

iff known chars.sign_cent_old:
bskchar "Old style cent sign";
beginchar(chars.sign_cent_old,8.5u#,asc_height#,comma_depth#); uni "non";
italcorr asc_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
numeric cend, tim[]; cend:=stem;
path p[];
pos1(curve,0); pos2(hair,90); pos3(hair,270); pos4(cend,20);
lft x1l=u; y1=.5x_height; x2=x3=.5w+hair; bot y2l=-o; top y3l=x_height+o; 
rt x0=w-u; y0=.2x_height; z0'=z0+hair*dir220; z3'r=z3r+like_hair*dir-10;
rt x4r=w-u; y4r=.85x_height;
z4'-z4l=hair*unitvector(z4l-z3r);
z5=(w-u,h); z6=(u,-d); pos5(hair, angle(z6-z5)+90); pos6(hair,angle(z6-z5)+90);
bskpoints(5,6,hair,hair);
p0:=z0---z0'+o*down..{left}z2l..z1l..{right}z3l..z4r..z4'..{dir(angle(z4l-z4')-20)}z4l;
p1:=z3l{right}..z4r..z4'..z4l{dir(angle(z4l-z4')-20)}..z3'r..z3r{left}..z1r..{right}z2r..z0'---z0;
p1:=subpath(3,infinity) of p1;
p2:=z6ll---z5l;
p3:=z5rr---z6r;
(tim0,tim1)=p0 intersectiontimes p3;
(tim2,tim3)=p0 intersectiontimes p2;
(tim4-3,tim5)=subpath (3,infinity) of p0 intersectiontimes p2;
(tim6-3,tim7)=subpath (3,infinity) of p0 intersectiontimes p3;
(tim8,tim9)=p1 intersectiontimes p3;
(tim10-3,tim11)=subpath(3,infinity) of p1 intersectiontimes p3;
(tim12,tim13)=p1 intersectiontimes p2;
(tim14-3,tim15)=subpath(3,infinity) of p1 intersectiontimes p2;
{{ if testdpi: save rundy; def rundy(expr p,t)suffix modifier:= t enddef; fi
filldraw subpath(0,rundy(p0,tim0).zpet) of p0
         ..subpath(rundy(p3,tim1),infinity) of p3
	 ---subpath(0,rundy(p2,tim3).zpet) of p2
	 ..subpath(rundy(p0,tim2),rundy(p0,tim4).zpet) of p0
	 ..subpath(rundy(p2,tim5),infinity) of p2
	 ..subpath(0,rundy(p3,tim7).zpet) of p3
	 ..subpath(rundy(p0,tim6),infinity) of p0
	 ..subpath(0,rundy(p1,tim8).zpet) of p1
	 ..subpath(rundy(p3,tim9),rundy(p3,tim11).zpet) of p3
	 ..subpath(rundy(p1,tim10),infinity) of p1..cycle;
}};
infill subpath(rundy(p1,tim12),rundy(p1,tim14).zpet) of p1
       ..subpath(rundy(p2,tim15),rundy(p2,tim13).zpet) of p2
       ..cycle; 
penlabels(1,2,3,4,5,6); labels(0,0',3'r,4',5rr,6ll);
endchar;

charscription(11u,asc_height,0)(
path p[]; numeric tim[]; oblu:=2oblu;
pos1(curve,0); pos3'(hair,180); pos2(hair,90); 
pos3(hair,180); pos4(hair,270);
lft x1l=u; lft x3r=w-2u-stem; y3=.65x_height; y1=.5x_height; 
.5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x3'r=x3r; y3'=.3x_height;
if (y3'/hair)<3.5: x3'l:=x3'l+.5hair; fi;
bot y2l=-o; top y4l=x_height+o;
rt x5r=w-2u; bot y5=-d; top y6r=h; 
lowercase_points(5,6,1.2jut);
p0=z3l---z3'l{z2r-z3r}..z2l..z1l..z4l..{down}z3l;
p1=z3r{up}..z4r..z1r..z2r..{up}z3'r--z3r;
p2=z5a--z6l;
p3=lowercase_lower_u_serif(5,hair);
tim1-2=xpart(subpath (2, 5) of p0 intersectiontimes p2);
tim2  =xpart(subpath (0,3) of p0 intersectiontimes ((0,0)--(w,0)));
if tim2<0: tim2:=xpart(subpath (0,3) of p0 intersectiontimes ((0,o)--(w,o))); fi;
tim3  =xpart(p3 intersectiontimes ((0,-o)--(x3'r,-o)));
z7=point tim1 of p0 + like_stem*up; 
tim4  =xpart(p0 intersectiontimes ((.5w,y7-.5hair)--(w,y7-.5hair)));
if tim4=-1: tim4:=xpart(p0 intersectiontimes ((.5[x4,x7],bar_height)--(.5[x4,x7],h))) fi;
p4=z3r{up}..z4r..z1r..z2r..z2r+2hair*right..{up}z3'r--z3r;
filldraw subpath (tim2, tim4) of p0..z7---lowercase_stem_upper(5,6)
         ---subpath(0,tim3) of p3..cycle;
infill p4..cycle;
penlabels(1,3',2,3,4); labels(7);
);

iff known chars.latin_d:
bskchar "The letter d";
beginchar(chars.latin_d,11u#,asc_height#,0); uni "0x0064";
italcorr asc_height#*slant-.75u#;
adjust_fit(0,serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_dcaron:
bskchar "The letter d with caron (treated like comma)";
beginchar(chars.latin_dcaron,11u#,asc_height#,0); uni "0x010F";
italcorr asc_height#*slant+2u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
y100''r=h; rt x100'''=w+u;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_d_BB:
bskchar "The blackboard-bold letter d";
beginchar(chars.latin_d_BB,11u#,asc_height#,0); uni "0x1D555";
italcorr asc_height#*slant-.75u#;
adjust_fit(0,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos1(cap_stem,0); pos3'(hair,180); pos2(hair,90); 
pos3(hair,180); pos4(hair,270);
lft x1l=u; lft x3r=w-2u-.8cap_stem; y3=.65x_height; y1=.5x_height; 
.5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x3'r=x3r; y3'=.3x_height;
if (y3'/hair)<3.5: x3'l:=x3'l+.5hair; fi;
bot y2l=-o; top y4l=x_height+o;
rt x5r=w-2u; bot y5=-d; top y6r=h; 
{{
  save stem; stem:=.8cap_stem;
  lowercase_points(5,6,1.2jut);
}};
p0=z3l---z3'l{z2r-z3r}..z2l..z1l..z4l..{down}z3l;
p1=z3r{up}..z4r..z1r..z2r..{up}z3'r--z3r;
p2=z5a--z6l;
p3=lowercase_lower_u_serif(5,hair);
tim1-2=xpart(subpath (2, 5) of p0 intersectiontimes p2);
tim2  =xpart(subpath (0,3) of p0 intersectiontimes ((0,0)--(w,0)));
if tim2<0: tim2:=xpart(subpath (0,3) of p0 intersectiontimes ((0,o)--(w,o))); fi;
tim3  =xpart(p3 intersectiontimes ((0,-o)--(x3'r,-o)));
z7=point tim1 of p0 + like_stem*up; 
tim4  =xpart(p0 intersectiontimes ((.5w,y7-.5hair)--(w,y7-.5hair)));
if tim4=-1: tim4:=xpart(p0 intersectiontimes ((.5[x4,x7],bar_height)--(.5[x4,x7],h))) fi;
p4=z3r{up}..z4r..z1r..z2r..z2r+2hair*right..{up}z3'r--z3r;
filldraw subpath (tim2, tim4) of p0..z7---lowercase_stem_upper(5,6)
         ---subpath(0,tim3) of p3..cycle;
oblu.more:=1.25f_obl;
infill p4..cycle;
infill ifobl(6r,6b,5r,5l,more,)---z5a..z5..z5f---cycle;
oblu:=bbw;
p100:=subpath(2,4) of p0;
p101:=subpath(1,3) of p4;
z100=bsktouch(p100,down,p101,up);
z101=bsktouch(p100,up,p101,down);
tim100=xpart(p100 intersectiontimes (z100--(x100,h)));
tim101=xpart(p101 intersectiontimes (z100--(x100,0)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y2l-5)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y3)));
infill subpath(rundy(p100,tim102),rundy(p100,tim100).zpet) of p100
       ..reverse subpath(rundy(p101,tim103).zpet,rundy(p101,tim101)) of p101..cycle;
penlabels(1,3',2,3,4); labels(7,100,101);
endchar;

iff known chars.latin_d_SS:
bskchar "The sans-serif letter d";
beginchar(chars.latin_d_SS,11u#,asc_height#,0); uni "0x1D5BD";
italcorr asc_height#*slant-.75u#;
adjust_fit(0,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos1(curve,0); pos3'(hair,180); pos2(hair,90); 
pos3(hair,180); pos4(hair,270);
lft x1l=u; lft x3r=w-2u-stem; y3=.65x_height; y1=.5x_height; 
.5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x3'r=x3r; y3'=.3x_height;
if (y3'/hair)<3.5: x3'l:=x3'l+.5hair; fi;
bot y2l=0; top y4l=x_height+o;
rt x5r=w-2u; bot y5=-d; top y6r=h; 
lowercase_points(5,6,1.2jut);
p0=z3l---z3'l{z2r-z3r}..z2l..z1l..z4l..{down}z3l;
p1=z3r{up}..z4r..z1r..z2r..{up}z3'r--z3r;
p2=z5a--z6l;
p3=lowercase_lower_u_serif(5,hair);
tim1-2=xpart(subpath (2, 5) of p0 intersectiontimes p2);
tim2  =xpart(subpath (0,3) of p0 intersectiontimes ((0,0)--(w,0)));
if tim2<0: tim2:=xpart(subpath (0,3) of p0 intersectiontimes ((0,o)--(w,o))); fi;
tim3  =xpart(p3 intersectiontimes ((0,-o)--(x3'r,-o)));
z7=point tim1 of p0 + like_stem*up; 
tim4  =xpart(p0 intersectiontimes ((.5w,y7-.5hair)--(w,y7-.5hair)));
if tim4=-1: tim4:=xpart(p0 intersectiontimes ((.5[x4,x7],bar_height)--(.5[x4,x7],h))) fi;
p4=z3r{up}..z4r..z1r..z2r..z2r+2hair*right..{up}z3'r--z3r;
filldraw subpath (2, tim4) of p0..z7---z6b..z6r---obl(5r,6r,2l)---cycle;
infill p4..cycle;
penlabels(1,3',2,3,4); labels(7);
endchar;

iff known chars.latin_dstroke:
bskchar "The letter d with stroke";
beginchar(chars.latin_dstroke,11u#,asc_height#,0); uni "0x0111";
italcorr asc_height#*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2f_obl; oblu.light:=f_obl;
pos1(curve,0); pos3'(hair,180); pos2(hair,90); 
pos3(hair,180); pos4(hair,270);
pos8(bar,90); pos8'(bar,90); pos9(bar,90); pos9'(bar,90);
lft x1l=u; lft x3r=w-2u-stem; y3=.65x_height; y1=.5x_height; 
.5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x3'r=x3r; y3'=.3x_height;
if (y3'/hair)<3.5: x3'l:=x3'l+.5hair; fi;
bot y2l=-o; top y4l=x_height+o;
rt x5r=w-2u; bot y5=-d; top y6r=h; 
x9-x8=4u; y9=y9'=y8=y8'=.4[x_height,h]; rt x9=w-.5u;
x8'=x6l; x9'=x6r; bskpoints(8,9,hair,hair);
lowercase_points(5,6,1.2jut);
p0=z3l---z3'l{z2r-z3r}..z2l..z1l..z4l..{down}z3l;
p1=z3r{up}..z4r..z1r..z2r..{up}z3'r--z3r;
p2=z5a--z6l;
p3=lowercase_lower_u_serif(5,hair);
tim1-2=xpart(subpath (2, 5) of p0 intersectiontimes p2);
tim2  =xpart(subpath (0,3) of p0 intersectiontimes ((0,0)--(w,0)));
if tim2<0: tim2:=xpart(subpath (0,3) of p0 intersectiontimes ((0,o)--(w,o))); fi;
tim3  =xpart(p3 intersectiontimes ((0,-o)--(x3'r,-o)));
z7=point tim1 of p0 + like_stem*up; 
tim4  =xpart(p0 intersectiontimes ((.5w,y7-.5hair)--(w,y7-.5hair)));
if tim4=-1: tim4:=xpart(p0 intersectiontimes ((.5[x4,x7],bar_height)--(.5[x4,x7],h))) fi;
p4=z3r{up}..z4r..z1r..z2r..z2r+2hair*right..{up}z3'r--z3r;
filldraw subpath (tim2, tim4) of p0..z7
         ---obl(8'l,7,8l).light---z8l..z8rr---obl(8'r,8r,6b).light
	 ---lowercase_stem_upper(5,6)
	 ---obl(9'r,6r,9r).light---z9r..z9ll---obl(9'l,9l,5f).light
	 ---subpath(0,tim3) of p3..cycle;
infill p4..cycle;
penlabels(1,3',2,3,4,8,8',9,9'); labels(7,8rr,9ll);
endchar;

iff known chars.sign_dong:
bskchar "Dong sign";
beginchar(chars.sign_dong,11u#,asc_height#,2rule_thickness#+o#); uni "0x20AB";
italcorr asc_height#*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu; oblu.light:=f_obl;
pos1(curve,0); pos3'(hair,180); pos2(hair,90); 
pos3(hair,180); pos4(hair,270);
pos8(bar,90); pos8'(bar,90); pos9(bar,90); pos9'(bar,90);
pos10(rule_thickness,90); pos11(rule_thickness,90);
lft x1l=u; lft x3r=w-2u-stem; y3=.65x_height; y1=.5x_height; 
.5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x3'r=x3r; y3'=.3x_height;
if (y3'/hair)<3.5: x3'l:=x3'l+.5hair; fi;
bot y2l=-o; top y4l=x_height+o;
rt x5r=w-2u; bot y5=0; top y6r=h; 
y9=y9'=y8=y8'=.4[x_height,h]; rt x9=w-.5u; lft x8=x1r;
x8'=x6l; x9'=x6r; bskpoints(8,9,hair,hair);
lowercase_points(5,6,1.2jut);
bot y10l=bot y11l=-d; lft x10=u; rt x11=w-u;
p0=z3l---z3'l{z2r-z3r}..z2l..z1l..z4l..{down}z3l;
p1=z3r{up}..z4r..z1r..z2r..{up}z3'r--z3r;
p2=z5a--z6l;
p3=lowercase_lower_u_serif(5,hair);
tim1-2=xpart(subpath (2, 5) of p0 intersectiontimes p2);
tim2  =xpart(subpath (0,3) of p0 intersectiontimes ((0,0)--(w,0)));
if tim2<0: tim2:=xpart(subpath (0,3) of p0 intersectiontimes ((0,o)--(w,o))); fi;
tim3  =xpart(p3 intersectiontimes ((0,-o)--(x3'r,-o)));
z7=point tim1 of p0 + like_stem*up; 
tim4  =xpart(p0 intersectiontimes ((.5w,y7-.5hair)--(w,y7-.5hair)));
if tim4=-1: tim4:=xpart(p0 intersectiontimes ((.5[x4,x7],bar_height)--(.5[x4,x7],h))) fi;
p4=z3r{up}..z4r..z1r..z2r..z2r+2hair*right..{up}z3'r--z3r;
filldraw subpath (tim2, tim4) of p0..z7
         ---obl(8'l,7,8l).light---z8l..z8rr---obl(8'r,8r,6b).light
	 ---lowercase_stem_upper(5,6)
	 ---obl(9'r,6r,9r).light---z9r..z9ll---obl(9'l,9l,5f).light
	 ---subpath(0,tim3) of p3..cycle;
infill p4..cycle;
filldraw bskrule(10,11,rule_thickness,rule_thickness);
penlabels(1,3',2,3,4,8,8',9,9'); labels(7,8rr,9ll);
endchar;

iff known chars.latin_eth:
bskchar "The letter eth";
beginchar(chars.latin_eth,10u#,asc_height#,0); uni "0x00F0";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[], theta; oblu:=2oblu;
pos1(curve,0); pos2(hair,90); pos3(hair,180); pos4(hair,270);
pos5(curve,180); pos6(hair,-90);
lft x1l=u; y1=y3=.5x_height; x2=x4=.5w+.5hair; bot y2l=-o; .5[y4r,y2r]=y3;
rt x5l=w-u; y5l=y3l+stem; top y6l=h+o; lft x6=u;
p0=z2r{right}..z5r..{dir170}z6r; x3l=xpart (((w,y3)--(.5w,y3))intersectionpoint p0);
p1=z2l{left}..z1l..z4l..{down}z3l;
p2=z2r{right}..z5r..{dir170}z6r;
z0=bsktouch(p1,right,p2,left);
tim1=xpart(p1 intersectiontimes (z0--(x4,y0)));
tim2=xpart(p2 intersectiontimes (z0--(w,y0)));
p3:=z6l{dir-10}..z5l..{left}z2l;
p4:=z2l{left}..subpath(0,rundy(p1,tim1).zpet) of p1..subpath(rundy(p2,tim2),infinity) of p2;
tim0=xpart(p3 intersectiontimes ((0,.5[x_height,h])--(w,.5[x_height,h])));
top y8=h; x8=.5[x5,x4]; z7=z8+5u*unitvector(((direction tim0 of p3) rotated -95));
if y7<y4l+o: y7:=y7+hair; fi
theta:=angle(z8-z7)+90;
pos7(bar,theta); pos8(bar,theta); bskpoints(7,8,bar,bar);
p5:=z7rr---z8r;
p6:=z8ll---z7l;
(tim3,tim4)=p3 intersectiontimes p5;
(tim5,tim6)=p3 intersectiontimes p6;
(tim7,tim8)=p4 intersectiontimes p6;
(tim9,tim10)=p4 intersectiontimes p5;
filldraw subpath(0,rundy(p3,tim3).zpet) of p3
         ..subpath(rundy(p5,tim4),infinity) of p5
	 ..{z7l-z8l}z8ll..subpath(rundy(p3,(tim5,2hair)),infinity) of p3
	 ..subpath(0,rundy(p4,tim7).zpet) of p4
	 ..subpath(rundy(p6,tim8),infinity) of p6
	 ..subpath(0,rundy(p5,tim10).zpet) of p5
	 ..subpath(rundy(p4,tim9),infinity) of p4..cycle;
infill z1r{up}..z4r..z3r..z2r..cycle;
penlabels(1,2,3,4,5,6,7,8); labels(7rr,8ll);
endchar;

charscription(9u,x_height,0)(
path p[]; numeric tim[], shift;
oblu:=2.5oblu;
pos1(curve,0); pos2(hair,90); pos3(hair,270); pos4(curve,180);
lft x1l=u; y1=y4=.5h; x2=x3=.5w+hair; bot y2l=-o; top y3l=h+o; 
rt x0=w-u; y0=.2h; z0'=z0+hair*dir220; x4=w-x1;
p0=z0---z0'+o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1=z4r{up}..z3r{left}..z1r..{right}z2r..z0';
tim1=xpart(p0 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
tim2=xpart(p1 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
shift:=lft xpart(point tim1 of p0)- w+u;
x4l:=x4l-shift; x4r:=x4r-shift;
p0:=z0---z0'+o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1:=z4r{up}..z3r{left}..z1r..{right}z2r..z0'if testdpi:+up fi;
tim3=xpart(p0 intersectiontimes ((w,bar_height)--(x3,bar_height)));
tim4=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim5=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim6=xpart(p1 intersectiontimes ((w,bar_height+bar-tiny)--(x3,bar_height+bar-tiny)));
tim7=xpart(p1 intersectiontimes ((0,bar_height+bar-tiny)--(x3,bar_height+bar-tiny)));
p2=point tim3 of p0 -- point tim4 of p1;
p3=point tim7 of p1 -- point tim6 of p1;
filldraw subpath(0,rundy(p0,(tim3,hair)).zpet) of p0--(subpath(0,rundy(p2,1).zpet) of p2)..
         subpath(rundy(p1,(tim5,if bold_face: 2f_obl else: oblu fi)),infinity) of p1
	 {z0-z0'-o*down}..cycle;
oblu:=1.5f_obl;
infill subpath (rundy(p1,tim6),rundy(p1,tim7).zpet) of p1..subpath(rundy(p3,0),rundy(p3,1).zpet)
       of p3..cycle;
penlabels(1,2,3,4); labels(0,0');
);

iff known chars.latin_e:
bskchar "The letter e";
beginchar(chars.latin_e,9u#,x_height#,0); uni "0x0065";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_eacute:
bskchar "The letter e with acute";
beginchar(chars.latin_eacute,9u#,asc_height#,0); uni "0x00E9";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
x101=x3-u;
usechar;
acute(100,101);
endchar;

iff known chars.latin_ecaron:
bskchar "The letter e with caron";
beginchar(chars.latin_ecaron,9u#,asc_height#,0); uni "0x011B";
italcorr asc_height#*slant-.5u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x3;
hacek(100,101,102);
endchar;

iff known chars.latin_egrave:
bskchar "The letter e with grave";
beginchar(chars.latin_egrave,9u#,asc_height#,0); uni "0x00E8";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
lft x101l=x3;
grave(100,101);
endchar;

iff known chars.latin_edoublegrave:
bskchar "The letter e with double grave";
beginchar(chars.latin_edoublegrave,9u#,asc_height#,0); uni "0x0205";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x102-x100=3u; x102r=x3;
d_grave(100,101,102,103,whatever);
endchar;

iff known chars.latin_ecircumflex:
bskchar "The letter e with circumflex";
beginchar(chars.latin_ecircumflex,9u#,asc_height#-.1x_height#,0); uni "0x00EA";
italcorr .5[asc_height#,x_height#]*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x3;
circumflex(100,101,102);
endchar;

iff known chars.latin_eumlaut:
bskchar "The letter e with umlaut";
beginchar(chars.latin_eumlaut,9u#,asc_height#-dot_size#,0); uni "0x00EB";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
.5[x100,x101]=x3; x101-x100=3u;
umlaut(100,101);
endchar;

iff known chars.latin_emacron:
bskchar "The letter e with macron";
beginchar(chars.latin_emacron,9u#,.5[asc_height#,x_height#],0); uni "0x0113";
italcorr .5[asc_height#,x_height#]*slant-.5u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x1r;
macron(100,101);
endchar;

iff known chars.latin_edotabove:
bskchar "The letter e with dot above";
beginchar(chars.latin_edotabove,9u#,asc_height#-.5dot_size#,0); uni "0x0117";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x3;
dotabove(100);
endchar;

iff known chars.latin_ebreve:
bskchar "The letter e with breve";
beginchar(chars.latin_ebreve,9u#,asc_height#,0); uni "0x0115";
italcorr asc_height#*slant-.5u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x3; x102-x100=5u;
breve(100,101,102);
endchar;

iff known chars.latin_einvbreve:
bskchar "The letter e with inverted breve";
beginchar(chars.latin_einvbreve,9u#,asc_height#+o#,0); uni "0x0207";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x3; x102-x100=5u;
tieacc(100,101,102);
endchar;

iff known chars.latin_e_BB:
bskchar "The blackboard-bold letter e";
beginchar(chars.latin_e_BB,9u#,x_height#,0); uni "0x1D556";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[], shift;
oblu:=2.5oblu;
pos1(cap_stem,0); pos2(hair,90); pos3(hair,270); pos4(cap_stem,180);
lft x1l=u; y1=y4=.5h; x2=x3=.5w+hair; bot y2l=-o; top y3l=h+o; 
rt x0=w-u; y0=.2h; z0'=z0+hair*dir220; x4=w-x1;
p0=z0---z0'+o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1=z4r{up}..z3r{left}..z1r..{right}z2r..z0';
tim1=xpart(p0 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
tim2=xpart(p1 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
shift:=lft xpart(point tim1 of p0)- w+u;
x4l:=x4l-shift; x4r:=x4r-shift;
p0:=z0---z0'+o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1:=z4r{up}..z3r{left}..z1r..{right}z2r..z0'if testdpi:+up fi;
tim3=xpart(p0 intersectiontimes ((w,bar_height)--(x3,bar_height)));
tim4=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim5=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim6=xpart(p1 intersectiontimes ((w,bar_height+bar-tiny)--(x3,bar_height+bar-tiny)));
tim7=xpart(p1 intersectiontimes ((0,bar_height+bar-tiny)--(x3,bar_height+bar-tiny)));
p2=point tim3 of p0 -- point tim4 of p1;
p3=point tim7 of p1 -- point tim6 of p1;
filldraw subpath(0,rundy(p0,(tim3,hair)).zpet) of p0--(subpath(0,rundy(p2,1).zpet) of p2)..
         subpath(rundy(p1,(tim5,if bold_face: 2f_obl else: oblu fi)),infinity) of p1
	 {z0-z0'-o*down}..cycle;
oblu:=1.5f_obl;
infill subpath (rundy(p1,tim6),rundy(p1,tim7).zpet) of p1..subpath(rundy(p3,0),rundy(p3,1).zpet)
       of p3..cycle;
oblu:=bbw;
p100:=p0;
p101:=subpath(1,infinity) of p1;
p102:=subpath(4,tim3) of p100;
p103:=subpath(tim6,1) of p1;
z100=bsktouch(p100,up,p101,down);
z101=bsktouch(p100,down,p101,up);
z102=bsktouch(p102,down,p103,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y2l-5)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y1)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y3l+5)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y1)));
tim104=xpart(p102 intersectiontimes (z102--(x102,y3l+5)));
tim105=xpart(p103 intersectiontimes (z102--(x102,y1)));
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103),rundy(p101,tim101).zpet) of p101..cycle;
oblu:=.75bbw;
infill subpath(rundy(p102,tim104),rundy(p102,length(p102)).zpet) of p102
       ..subpath(rundy(p103,0),rundy(p103,tim105).zpet) of p103..cycle;
penlabels(1,2,3,4); labels(0,0',100,101,102);
endchar;

iff known chars.latin_e_SS:
bskchar "The sans-serif letter e";
beginchar(chars.latin_e_SS,9u#,x_height#,0); uni "0x1D5BE";
italcorr bar_height#*slant;
adjust_fit(-o#,0);
pickup tiny.nib;
path p[]; numeric tim[], shift;
oblu:=2.5oblu;
pos1(curve,0); pos2(hair,90); pos3(hair,270); pos4(curve,180);
lft x1l=u; y1=y4=.5h; x2=x3=.5w+hair; bot y2l=-o; top y3l=h+o; 
rt x0=w-u; y0=.2h; z0'=z0+hair*dir220; x4=w-x1;
p0=z0---z0'+o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1=z4r{up}..z3r{left}..z1r..{right}z2r..z0';
tim1=xpart(p0 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
tim2=xpart(p1 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
shift:=lft xpart(point tim1 of p0)- w+u;
x4l:=x4l-shift; x4r:=x4r-shift;
p0:=z0---z0'+o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1:=z4r{up}..z3r{left}..z1r..{right}z2r..z0'if testdpi:+up fi---z0+o*up;
tim3=xpart(p0 intersectiontimes ((w,bar_height)--(x3,bar_height)));
tim4=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim5=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim6=xpart(p1 intersectiontimes ((w,bar_height+hair-tiny)--(x3,bar_height+hair-tiny)));
tim7=xpart(p1 intersectiontimes ((0,bar_height+hair-tiny)--(x3,bar_height+hair-tiny)));
p2=point tim3 of p0 -- point tim4 of p1;
p3=point tim7 of p1 -- point tim6 of p1;
filldraw subpath(0,rundy(p0,(tim3,hair)).zpet) of p0--(subpath(0,rundy(p2,1).zpet) of p2)..
         subpath(rundy(p1,(tim5,if bold_face: 2f_obl else: oblu fi)),infinity) of p1
	 {z0-z0'-o*down}..cycle;
oblu:=1.5f_obl;
infill subpath (rundy(p1,tim6),rundy(p1,tim7).zpet) of p1..subpath(rundy(p3,0),rundy(p3,1).zpet)
       of p3..cycle;
penlabels(1,2,3,4); labels(0,0');
endchar;

iff known chars.latin_eogonek:
bskchar "The letter e with ogonek";
beginchar(chars.latin_eogonek,9u#,x_height#+o#,.85desc_depth#); uni "0x0119";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[], shift;
oblu:=2.5oblu;
pos1(curve,0); pos2(hair,90); pos3(hair,270); pos4(curve,180);
pos5(stem,0); pos6(curve,0); pos7(hair,45); pos8(hair,160);
lft x1l=u; y1=y4=.5h; x2=x3=.5w+hair; bot y2l=-o; top y3l=h+o; 
rt x0=w-u; y0=.2h; z0'=z0+hair*dir220; x4=w-x1;
p0=z0---z0'+o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1=z4r{up}..z3r{left}..z1r..{right}z2r..z0';
tim1=xpart(p0 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
tim2=xpart(p1 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
shift:=lft xpart(point tim1 of p0)- w+u;
x4l:=x4l-shift; x4r:=x4r-shift;
x5-x6l=1.5u; x5l=x2; x7-x6l=3u; rt x8l-x7=1.5u;
y5=0; y6=-.5d; bot y7l=-d; y8=-2/3d;
p0:=z0---z0'+o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1:=z4r{up}..z3r{left}..z1r..{right}z2r..z0';
tim3=xpart(p0 intersectiontimes ((w,bar_height)--(x3,bar_height)));
tim4=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim5=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim6=xpart(p1 intersectiontimes ((w,bar_height+bar-tiny)--(x3,bar_height+bar-tiny)));
tim7=xpart(p1 intersectiontimes ((0,bar_height+bar-tiny)--(x3,bar_height+bar-tiny)));
p2:=point tim3 of p0 -- point tim4 of p1;
p3:=point tim7 of p1 -- point tim6 of p1;
p4:=reverse (z5l{z6l-z5r}..z6l...z7l..{z5-z6}z8l..z8r{z6-z5}..z7r..z6r..z5r);
tim8=xpart(p0 intersectiontimes ((x5r,0)--(x5r,h)));
tim9=xpart(p0 intersectiontimes subpath(1,infinity) of p4);
filldraw subpath(0,rundy(p0,tim8).zpet) of p0
         ..subpath(rundy(p4,0),rundy(p4,infinity).zpet) of p4
	 ..subpath(rundy(p0,tim9),rundy(p0,(tim3,hair)).zpet) of p0
	 --(subpath(0,rundy(p2,1).zpet) of p2)
	 ..subpath(rundy(p1,(tim5,if bold_face: 1.5f_obl else: oblu fi)),infinity) of p1{z0-z0'-o*down}
	 ..cycle;
oblu:=1.5f_obl;
infill subpath (rundy(p1,tim6),rundy(p1,tim7).zpet) of p1..subpath(rundy(p3,0),rundy(p3,1).zpet)
       of p3..cycle;
penlabels(1,2,3,4,5,6,7,8); labels(0,0');
endchar;

iff known chars.latin_ecedilla:
bskchar "The letter e with cedilla";
beginchar(chars.latin_ecedilla,9u#,x_height#,.65desc_depth#); uni "0x0229";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[], shift;
oblu:=2.5oblu;
pos1(curve,0); pos2(hair,90); pos3(hair,270); pos4(curve,180);
pos5(.5stem,0); pos6(.5stem,0); pos7(stem,0); pos8(.5stem,-110);
lft x1l=u; y1=y4=.5h; x2=x3=.5w+hair; bot y2l=-o; top y3l=h+o; 
rt x0=w-u; y0=.2h; z0'=z0+hair*dir220; x4=w-x1;
p0=z0---z0'+o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1=z4r{up}..z3r{left}..z1r..{right}z2r..z0';
tim1=xpart(p0 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
tim2=xpart(p1 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
shift:=lft xpart(point tim1 of p0)- w+u;
x4l:=x4l-shift; x4r:=x4r-shift;
x5l=x6l; z5r=z2l; y6=-hair; y7=-.5d;
rt x7r-lft x8r=4u; x5r-lft x8r=2u; y8r=-d;
p0:=z0---z0'+o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1:=z4r{up}..z3r{left}..z1r..{right}z2r..z0'if testdpi: +up fi;
tim3=xpart(p0 intersectiontimes ((w,bar_height)--(x3,bar_height)));
tim4=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim5=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim6=xpart(p1 intersectiontimes ((w,bar_height+bar-tiny)--(x3,bar_height+bar-tiny)));
tim7=xpart(p1 intersectiontimes ((0,bar_height+bar-tiny)--(x3,bar_height+bar-tiny)));
p2:=point tim3 of p0 -- point tim4 of p1;
p3:=point tim7 of p1 -- point tim6 of p1;
p4:=z6r..{down}z7r..{left}z8r..{right}z8l..{up}z7l..z6l--z5l;
p5:=z5r{down}..subpath (rundy(p4,(0,curve)),infinity) of p4;
tim8=xpart(p0 intersectiontimes (z6l--(x5l,y0)));
filldraw subpath(0,rundy(p0,2).zpet) of p0..subpath(rundy(p5,0),rundy(p5,infinity).zpet) of p5
         ..subpath(rundy(p0,(tim8,hair)),rundy(p0,(tim3,hair)).zpet) of p0
	 --(subpath(0,rundy(p2,1).zpet) of p2)
	 ..subpath(rundy(p1,(tim5,if bold_face: 1.5f_obl else: oblu fi)),infinity) of p1{z0-z0'-o*down}
	 ..cycle;
oblu:=1.5f_obl;
infill subpath (rundy(p1,tim6),rundy(p1,tim7).zpet) of p1..subpath(rundy(p3,0),rundy(p3,1).zpet)
       of p3..cycle;
penlabels(1,2,3,4,5,6,7,8); labels(0,0');
endchar;

iff known chars.latin_oe:
bskchar "The ligature oe";
beginchar(chars.latin_oe,13.5u#,x_height#,0); uni "0x0153";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[], shift;
oblu:=2.5oblu;
pos1(curve,0); pos2(hair,90); pos3(hair,270); pos4(curve,180);
pos5(curve,0); pos6(hair,90); pos7(curve,180); pos8(hair,270);
lft x1l=5.5u; y1=y4=.5h; x2=x3=.5w+hair+2u; bot y2l=-o; top y3l=h+o; 
rt x0=w-u; y0=.2h; z0'=z0+hair*dir220; x4=w-u-lft .5curve;
lft x5l=u; x7r=x1r; y5=y7=.5h; .5[x6,x8]=.5[x5,x7]; 
x6=x8; bot y6l=-o; top y8l=h+o; x8r:=x8r+.25u; x6r:=x6r-.25u;
p0=z0---z0'+if monospace: 1.5\\fi o*down..{left}z2l..z1l..{right}z3l..{down}z4l; labels(4l);
p1=z4r{up}..z3r{left}..z1r..{right}z2r..z0';
tim1=xpart(p0 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
tim2=xpart(p1 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
shift:=lft xpart(point tim1 of p0)- w+u;
x4l:=x4l-shift; x4r:=x4r-shift;
p0:=z0---z0'+if monospace: 1.5\\fi o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1:=z4r{up}..z3r{left}..z1r..{right}z2r..if monospace:{z0-z0'+o*up}z0 else: z0' fi if testdpi: +up fi;
tim3=xpart(p0 intersectiontimes ((w,bar_height)--(x3,bar_height)));
tim4=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim5=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim6=xpart(p1 intersectiontimes ((w,bar_height+bar-tiny)--(x3,bar_height+bar-tiny)));
tim7=xpart(p1 intersectiontimes ((0,bar_height+bar-tiny)--(x3,bar_height+bar-tiny)));
p2=point tim3 of p0 -- point tim4 of p1;
p3=point tim7 of p1 -- point tim6 of p1;
p4=z7l{down}..z6l..{up}z5l..z8l..cycle;
p5=z7r{down}..z6r..{up}z5r..z8r..cycle;
(tim8,tim9)=p0 intersectiontimes p4;
(tim10,tim11)=subpath(2,infinity) of p4 intersectiontimes p0;
(tim12,tim13)=p5 intersectiontimes p0;
(tim14,tim15)=subpath(2,infinity) of p5 intersectiontimes p0;
filldraw subpath(0,rundy(p0,tim8).zpet) of p0..
         subpath(rundy(p4,tim9),rundy(p4,2+tim10).zpet) of p4 ..
	 subpath(rundy(p0,tim11),rundy(p0,(tim3,hair)).zpet) of p0--
	 subpath(0,rundy(p2,1).zpet) of p2..
	 subpath(rundy(p1,(tim5, if bold_face: 1.5f_obl else: oblu fi)),infinity) of p1
	 {z0-z0'-o*down}..cycle;
oblu:=1.5f_obl;
infill subpath (rundy(p1,tim6),rundy(p1,tim7).zpet) of p1..subpath(rundy(p3,0),rundy(p3,1).zpet)
       of p3..cycle;
infill subpath(rundy(p5,tim12),rundy(p5,2+tim14).zpet) of p5..
       subpath(rundy(p0,tim15).zpet,rundy(p0,tim13)) of p0..cycle;
penlabels(1,2,3,4,5,6,7,8); labels(0,0');
endchar;

charscription(12.5u,x_height,0)(
path p[]; numeric tim[], shift;
oblu:=2.5oblu;
pos1(curve,0); pos2(hair,90); pos3(hair,270); pos4(curve,180);
lft x1l=5.25u; y1=y4=.5h; x2=x3=.5w+hair+2.25u; bot y2l=-o; top y3l=h+o; 
rt x0=w-u; y0=.2h; z0'=z0+hair*dir220; x4=w-u-lft .5curve;
z5l=(x1l,h-like_curve); z6l=z5l+like_hair*down; z7=(u,stem+hair);
pos6(hair,angle(z7-z6l)+90); pos8(curve,30); pos9(hair,120); 
lft x8l=u; y8r=y7-like_hair; x9r=.5[x1r,lft u]; y9l=o;
pos10(hair,angle((x1,y7)-z9l)+90); z10l=(.5[x1,x1r],y7);
pos11(stem,0); pos12(hair,90); pos13(stem,180);
z11l=(x1l,h-curve); top y12r=h+o; x12=x9r;
z13'=z13+(o,-.2stem); z13''=z13+.5(stem-currentbreadth)*dir135;
y13''=.5[y11,y12l]; lft x13r=u+o;
p0=z0---z0'+if monospace: 1.5\\fi o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1=z4r{up}..z3r{left}..z1r..{right}z2r..z0';
tim1=xpart(p0 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
tim2=xpart(p1 intersectiontimes ((.5w,bar_height)--(w,bar_height)));
shift:=lft xpart(point tim1 of p0)- w+u;
x4l:=x4l-shift; x4r:=x4r-shift;
p0:=z0---z0'+if monospace: 1.5\\fi o*down..{left}z2l..z1l..{right}z3l..{down}z4l;
p1:=z4r{up}..z3r{left}..z1r..{right}z2r..if monospace:{z0-z0'+.5o*up}z0 else: z0' fi if testdpi: +up fi;
tim3=xpart(p0 intersectiontimes ((w,bar_height)--(x3,bar_height)));
tim4=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim5=xpart(p1 intersectiontimes ((0,bar_height)--(x3,bar_height)));
tim6=xpart(p1 intersectiontimes ((w,bar_height+bar-tiny)--(x3,bar_height+bar-tiny)));
tim7=xpart(p1 intersectiontimes ((0,bar_height+bar-tiny)--(x3,bar_height+bar-tiny)));
p2=point tim3 of p0 -- point tim4 of p1;
p3=point tim7 of p1 -- point tim6 of p1;
p4=z10l{z9l-z1}..z9l..z8l..{z6l-z7-hair*up}z6l;
p5=z1l---z11l..{left}z12l..{down}z13l..z13'..{up}z13r..z13''
   ..{right}z12r...z11r---(x11r,y1);
p6=z10r{dir(angle(z9l-z1))}..z9r..z8r..{z6r-z7-hair*up}z6r;
(tim8,tim9)=p0 intersectiontimes p4;
if tim8<0:  %Hack for math parameters
   tim8:=xpart(p0 intersectiontimes (z10l--(x2,y10l))); 
   tim9:=0;
fi
(tim10,tim11)=p4 intersectiontimes p5;
(tim12,tim13)=subpath(2,infinity) of p5 intersectiontimes p0;
(tim14,tim15)=p6 intersectiontimes p0;
if tim15<0:  %Hack for math parameters
   tim15:=xpart(p0 intersectiontimes (z10r--(x2,y10r))); 
   tim14:=0;
fi
(tim16,tim17)=p6 intersectiontimes p5;
if tim16<0: tim16:=infinity; fi
filldraw subpath(0,rundy(p0,tim8).zpet) of p0
         ..subpath(rundy(p4,tim9),rundy(p4,tim10).zpet) of p4
	 ..subpath(rundy(p5,tim11),rundy(p5,2+tim12).zpet) of p5
	 ..subpath(rundy(p0,tim13),rundy(p0,(tim3,hair)).zpet) of p0
	 --subpath(0,rundy(p2,1).zpet) of p2
	 ..subpath(rundy(p1,(tim5, if bold_face: 1.5f_obl else: oblu fi)),infinity) of p1{z0-z0'-o*down}
	 ..cycle;
oblu:=1.5f_obl;
infill subpath (rundy(p1,tim6),rundy(p1,tim7).zpet) of p1
       ..subpath(rundy(p3,0),rundy(p3,1).zpet) of p3..cycle;
infill subpath(rundy(p6,tim14),rundy(p6,tim16).zpet) of p6
       ..(reverse subpath(0,rundy(p5,tim17).zpet) of p5)
       ..subpath(3,rundy(p0,tim15)) of p0..cycle;
penlabels(1,2,3,4,5,6,8,9,10,11,12,13); labels(0,0',7,13',13'');
);

iff known chars.latin_ae:
bskchar "The ligature ae";
beginchar(chars.latin_ae,12.5u#,x_height#,0); uni "0x00E6";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_aemacron:
bskchar "The ligature ae with macron";
beginchar(chars.latin_aemacron,12.5u#,.5[asc_height#,x_height#],0); uni "0x01E3";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
macron(100,101);
endchar;

iff known chars.latin_aeacute:
bskchar "The ligature ae with acute";
beginchar(chars.latin_aeacute,12.5u#,asc_height#,0); uni "0x01FD";
italcorr bar_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
rt x101=x1;
acute(100,101);
endchar;

iff known chars.latin_f:
bskchar "The letter f";
beginchar(chars.latin_f,6.5u#, asc_height#, 0); uni "0x0066";
italcorr asc_height#*slant+1.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric fend; fend:=stem;
pos3(hair,-90); pos4(fend,180);
lft x1l=2.5u; bot y1=0; top y2=h-like_curve;
top y3l=h+o; x3=if monospace: .6[w,x1r] else: w-1.25u fi;
.5[x2r,x4]=x3; y4''=y3r-like_hair;
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
lowercase_points(1,2,jut); 
if not bold_face: y2r:=y2r+hair; fi;
z3'r=z3r+.5hair*right; 
pos5(hair,90); pos5'(hair,90); pos6(hair,90); pos6'(hair,90);
y5=y5'=y6=y6'=bot x_height;
lft x5=u; x6=if monospace: 2x1-x5 else: w-u fi; x5'=x1l; x6'=x1r;
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..
         {left}z1e..{up}z1f---obl(6'l,1r,6l)---z6l..z6r---obl(6'r,6r,2r)---
         z2r...{right}z3r..z4r..z4'..z4l{up}..z4''..z3l..z2l---
	 obl(5'r,2l,5r)---z5r..z5l---obl(5'l,5l,1l)---cycle;
penlabels(3,4,5,5',6,6'); labels(4',4'');
endchar;

iff known chars.latin_f_BB:
bskchar "The blackboard-bold letter f";
beginchar(chars.latin_f_BB,6.5u#, asc_height#, 0); uni "0x1D557";
italcorr asc_height#*slant+1.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric fend; fend:=stem;
pos3(hair,-90); pos4(fend,180);
lft x1l=2.5u; bot y1=0; top y2=h-like_curve;
top y3l=h+o; x3=if monospace: .6[w,x1r] else: w-1.25u fi;
.5[x2r-.5(cap_stem-stem),x4]=x3; y4''=y3r-like_hair;
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
save stem; numeric stem; stem:=.8cap_stem;
lowercase_points(1,2,jut); 
if not bold_face: y2r:=y2r+hair; fi;
z3'r=z3r+.5hair*right; 
pos5(hair,90); pos5'(hair,90); pos6(hair,90); pos6'(hair,90);
y5=y5'=y6=y6'=bot x_height;
lft x5=u; x6=if monospace: 2x1-x5 else: w-u fi; x5'=x1l; x6'=x1r;
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..
         {left}z1e..{up}z1f---obl(6'l,1r,6l)---z6l..z6r---obl(6'r,6r,2r)---
         z2r...{right}z3r..z4r..z4'..z4l{up}..z4''..z3l..z2l---
	 obl(5'r,2l,5r)---z5r..z5l---obl(5'l,5l,1l)---cycle;
path p[]; numeric tim[];
p100:=z6'r---z2r..{right}z3r;
p101:=z4l{up}..z4''..z3l..z2l---z5'r;
bot z100=(x1l,y1b);
z101=bsktouch(p100,up,p101,down);
tim100=xpart(p100 intersectiontimes (z101--(x101,y2)));
tim101=xpart(p101 intersectiontimes (z101--(x101,y3l+5)));
infill subpath(rundy(p101,(tim101,bbw)),infinity) of p101---obl(100,2b,1b)
       ...z1l---obl(1r,1l,2r)---subpath(0,rundy(p100,(tim100,bbw)).zpet) of p100
       ..cycle;
penlabels(3,4,5,5',6,6'); labels(4',4'',100,101);
endchar;

iff known chars.latin_f_SS:
bskchar "The sans-serif letter f";
beginchar(chars.latin_f_SS,6.5u#, asc_height#, 0); uni "0x1D5BF";
italcorr asc_height#*slant+1.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric fend; fend:=stem;
pos3(hair,-90); pos4(fend,180);
lft x1l=2.5u; bot y1=0; top y2=h-like_curve;
top y3l=h+o; x3=if monospace: .6[w,x1r] else: w-1.25u fi;
.5[x2r,x4]=x3; y4''=y3r-like_hair;
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
lowercase_points(1,2,jut); 
z3'r=z3r+.5hair*right; 
pos5(hair,90); pos5'(hair,90); pos6(hair,90); pos6'(hair,90);
y5=y5'=y6=y6'=bot x_height;
lft x5=u; x6=if monospace: 2x1-x5 else: w-u fi; x5'=x1l; x6'=x1r;
filldraw z1a..z1..z1f---obl(6'l,1r,6l)---z6l..z6r---obl(6'r,6r,2r)---
         z2r...{right}z3r..z4r..z4'..z4l{up}..z4''..z3l..z2l---
	 obl(5'r,2l,5r)---z5r..z5l---obl(5'l,5l,1l)---cycle;
penlabels(3,4,5,5',6,6'); labels(4',4'');
endchar;

iff known chars.latin_ff:
bskchar "The ligature ff";
beginchar(chars.latin_ff,11u#, asc_height#, 0); uni "0xFB00";
italcorr asc_height#*slant+1.75u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric fend, ijut, tim[]; fend:=stem; 
path p[];
pos3(hair,-90); pos4(fend,180); pos7(hair,-90); pos8(fend,180);
lft x1l=2.5u; x5l=.5[x3,x4]; bot y1=bot y5=0; top y2=top y6=h-like_curve;
top y3l=top y7l=h+o; .5[x2r,x4]=x3; y4''=y3r-like_hair; lft x4r=w-2.2u-stem;
y8''=y7r-like_hair; z8'=z8+.2fend*down+o*left; z8''=z8+.5(fend-currentbreadth)*dir45;
x7=if monospace: .6[w,x5r] else: w-1.25u fi; .5[x6r,x8]=x7;
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
lowercase_points(1,2,jut); lowercase_points(5,6,jut); 
if not bold_face: y2r:=y6r:=y2r+hair; fi;
ijut=.5hair; x1e:=x1e-ijut; x1d:=x1d-ijut; x5c:=x5c+ijut; x5b:=x5b+ijut;
z3'r=z3r+.5hair*right; z7'r=z7r+.5hair*right;
pos9(hair,90); pos9'(hair,90); pos10(hair,90); pos10'(hair,90);
pos11(hair,90); pos11'(hair,90);
y9=y9'=y10=y10'=y11=y11'=bot x_height;
lft x9=u; x11=if monospace: x5r+x9'-x9 else: w-u fi; x9'=x1l; x10=x6l; x10'=x1r; x11'=x6r;
p0=z8l{up}..z8''..z7l..{down}z6l;
p1=z4l{up}..z4''..z3l..{down}z2l;
p2=z2r...{right}z3r..z4r..z4'..{up}z4l;
(tim0,tim1)=p0 intersectiontimes p1;
(tim2,tim3)=p2 intersectiontimes p0;
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..
         {left}z1e..z1f---obl(10'l,1r,10l)---obl(10l,10'l,5l)---
	 z5a..z5b{left}..z5c{right}..z5+ser_boule*up..{right}z5d..
	 {left}z5e..z5f---obl(11'l,5r,11l)---z11l..z11r---obl(11'r,11r,6r)---
	 z6r...{right}z7r..z8r..z8'..subpath(0,rundy(p0,tim0).zpet) of p0..
	 subpath(rundy(p1,tim1),infinity) of p1
	 --obl(9'r,2l,9r)---z9r..z9l---obl(9'l,9l,1l)---cycle;
infill z2r---obl(10'r,2r,10r)---obl(10r,10'r,6l)---z6l--
       (reverse subpath(rundy(p0,tim3),infinity) of p0)..
       (reverse subpath(0,rundy(p2,tim2).zpet) of p2)&cycle;
penlabels(3,4,7,8,9,9',10,10',11,11'); labels(4',4'',8',8'');
endchar;

iff known chars.latin_ff_alt:
bskchar "The ligature ff---alternative";
beginchar(chars.latin_ff_alt,11u#, asc_height#, 0); uni "non"; %"0xFB00";
italcorr asc_height#*slant+1.75u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric fend, ijut, tim[]; fend:=stem; 
path p[];
pos3(hair,-90); pos4(fend,180); pos7(hair,-90); pos8(fend,180);
lft x1l=2.5u; x5l=.5[x3,x4]; bot y1=bot y5=0; top y2+like_hair=top y6=h-like_curve;
top y3l+like_hair=top y7l=h+o; .5[x2r,x4]=x3; y4''+like_hair=y3r-like_hair; lft x4r=w-2.2u-stem;
y8''=y7r-like_hair; z8'=z8+.2fend*down+o*left; z8''=z8+.5(fend-currentbreadth)*dir45;
x7=if monospace: .6[w,x5r] else: w-1.25u fi; .5[x6r,x8]=x7;
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
lowercase_points(1,2,jut); lowercase_points(5,6,jut); 
if not bold_face: y2r:=y6r:=y2r+hair; fi;
ijut=.5hair; x1e:=x1e-ijut; x1d:=x1d-ijut; x5c:=x5c+ijut; x5b:=x5b+ijut;
z3'r=z3r+.5hair*right; z7'r=z7r+.5hair*right;
pos9(hair,90); pos9'(hair,90); pos10(hair,90); pos10'(hair,90);
pos11(hair,90); pos11'(hair,90);
y9=y9'=y10=y10'=y11=y11'=bot x_height;
lft x9=u; x11=if monospace: x5r+x9'-x9 else: w-u fi; x9'=x1l; x10=x6l; x10'=x1r; x11'=x6r;
p0=z8l{up}..z8''..z7l..{down}z6l;
p1=z4l{up}..z4''..z3l..{down}z2l;
p2=z2r...{right}z3r..z4r..z4'..{up}z4l;
(tim0,tim1)=p0 intersectiontimes p1;
(tim2,tim3)=p2 intersectiontimes p0;
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..
         {left}z1e..z1f---obl(10'l,1r,10l)---obl(10l,10'l,5l)---
	 z5a..z5b{left}..z5c{right}..z5+ser_boule*up..{right}z5d..
	 {left}z5e..z5f---obl(11'l,5r,11l)---z11l..z11r---obl(11'r,11r,6r)---
	 z6r...{right}z7r..z8r..z8'..subpath(0,rundy(p0,tim0).zpet) of p0..
	 subpath(rundy(p1,tim1),infinity) of p1
	 --obl(9'r,2l,9r)---z9r..z9l---obl(9'l,9l,1l)---cycle;
infill z2r---obl(10'r,2r,10r)---obl(10r,10'r,6l)---z6l--
       (reverse subpath(rundy(p0,tim3),infinity) of p0)..
       (reverse subpath(0,rundy(p2,tim2).zpet) of p2)&cycle;
penlabels(3,4,7,8,9,9',10,10',11,11'); labels(4',4'',8',8'');
endchar;

charscription(11u,asc_height,0)(
numeric fend, tim; fend:=stem;
path p;
pos3(hair,-90); pos4(fend,180);
lft x1l=2.5u; bot y1=0; top y2=h-like_curve;
top y3l=h+o; .5[x2r,x4]=x3; top y4''=y3r-top like_hair;
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
lowercase_points(1,2,jut); 
if not bold_face: y2r:=y2r+hair; fi;
z3'r=z3r+.5hair*right; 
pos5(hair,90); pos5'(hair,90); pos6(hair,90); pos6'(hair,90);
bot y7=0; top y8=h; rt x7r=w-2u;
lowercase_points(7,8,jut);
y5=y5'=y6=y6'=bot x_height;
lft x5=u; x6-x1r=x1l-x5; x5'=x1l; x6'=x1r;
x4r=x7l;
p:=z4l{up}..z4''..z3l..{down}z2l;
tim=xpart(p intersectiontimes ((.75[x8a,x8l],y4r)--(.75[x8a,x8l],h)));
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..
         {left}z1e..{up}z1f---obl(6'l,1r,6l)---z6l..z6r---obl(6'r,6r,2r)---
         z2r...{right}z3r..z4r---z7a..z7b{left}..{right}z7c..z7+ser_boule*up
	 ..z7d{right}..{left}z7e..z7f---z8r{z8a-z8}..subpath(tim,infinity) of p
	 ---obl(5'r,2l,5r)---z5r..z5l---obl(5'l,5l,1l)---cycle;
penlabels(3,4,5,5',6,6'); labels(4',4'');
);

iff known chars.latin_fl:
bskchar "The ligature fl";
beginchar(chars.latin_fl,11u#, asc_height#, 0); uni "0xFB02";
italcorr asc_height#*slant-u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_flacute:
bskchar "The ligature fl with acute";
beginchar(chars.latin_flacute,11u#, asc_height#+.3x_height#, 0); uni "non";
italcorr asc_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=.5[x8a,x8l]; x100r=w-u; y101=asc_height+.75u;
acute(100,101).capital;
endchar;

iff known chars.latin_flcaron:
bskchar "The ligature fl with caron";
beginchar(chars.latin_flcaron,11u# if bold_face: +.5u#fi, asc_height#, 0); uni "non";
italcorr asc_height#*slant+u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
y100''r=h; x100'''=w;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_ffl:
bskchar "The ligature ffl";
beginchar(chars.latin_ffl,15u#, asc_height#, 0); uni "0xFB04";
italcorr asc_height#*slant-u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric fend, ijut, tim[]; fend:=stem;
path p[];
pos3(hair,-90); pos4(fend,180); pos7(hair,-90); pos8(fend,180);
lft x1l=2.5u; x5l=.5[x3,x4]; bot y1=bot y5=0; top y2=top y6=h-like_curve;
top y3l=top y7l=h+o; .5[x2r,x4]=x3; y4''=y3r-like_hair; lft x4r=w-6.2u-stem;
y8''=y7r-top like_hair; z8'=z8+.2fend*down+o*left; z8''=z8+.5(fend-currentbreadth)*dir45;
.5[x6r,x8]=x7; 
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
lowercase_points(1,2,jut); lowercase_points(5,6,jut); 
if not bold_face: y2r:=y6r:=y2r+hair; fi;
ijut=.5hair; 
 x1e:=x1e-ijut; x1d:=x1d-ijut; x5c:=x5c+ijut; x5b:=x5b+ijut; 
z3'r=z3r+.5hair*right; z7'r=z7r+.5hair*right;
bot y12=0; top y13=h; rt x12r=w-2u; x8r=x12l;
lowercase_points(12,13,jut);
pos9(hair,90); pos9'(hair,90); pos10(hair,90); pos10'(hair,90);
pos11(hair,90); pos11'(hair,90);
y9=y9'=y10=y10'=y11=y11'=bot x_height;
lft x9=u; x11=x5r+x9'-x9; x9'=x1l; x10=x6l; x10'=x1r; x11'=x6r;
p0=z8l{up}..z8''..z7l..{down}z6l;
p1=z4l{up}..z4''..z3l..{down}z2l;
p2=z2r...{right}z3r..z4r..z4'..{up}z4l;
(tim0,tim1)=p0 intersectiontimes p1;
(tim2,tim3)=p2 intersectiontimes p0;
tim4=xpart(p0 intersectiontimes ((.75[x12a,x12l],y8r)--(.75[x12a,x12l],h)));
if x12c-x5d<u: x5d:=x5d-ijut; x5e:=x5e-ijut; fi;
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..
         {left}z1e..z1f---obl(10'l,1r,10l)---obl(10l,10'l,5l)---
	 z5a..z5b{left}..z5c{right}..z5+ser_boule*up..{right}z5d..
	 {left}z5e..z5f---obl(11'l,5r,11l)---z11l..z11r---obl(11'r,11r,6r)---
	 z6r...{right}z7r..z8r---z12a..{left}z12b..{right}z12c..z12+ser_boule*up
	 ..z12d{right}..{left}z12e..z12f---z13r{z13a-z13}..
	 subpath(tim4,rundy(p0,(tim0,2hair)).zpet) of p0..
	 subpath(rundy(p1,(tim1,2hair)),infinity) of p1 
	 --obl(9'r,2l,9r)---z9r..z9l---obl(9'l,9l,1l)---cycle;
infill z2r---obl(10'r,2r,10r)---obl(10r,10'r,6l)---z6l..
       (reverse subpath(rundy(p0,tim3),infinity) of p0)..
       (reverse subpath(0,rundy(p2,tim2).zpet) of p2)..cycle;
penlabels(3,4,7,8,9,9',10,10',11,11'); labels(4',4'',8',8'');
endchar;

iff known chars.latin_ffl_alt:
bskchar "The ligature ffl---alternative";
beginchar(chars.latin_ffl_alt,15u#, asc_height#, 0); uni "non"; %"0xFB04";
italcorr asc_height#*slant-u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric fend, ijut, tim[]; fend:=stem;
path p[];
pos3(hair,-90); pos4(fend,180); pos7(hair,-90); pos8(fend,180);
lft x1l=2.5u; x5l=.5[x3,x4]; bot y1=bot y5=0; top y2+like_hair=top y6=h-like_curve;
top y3l+like_hair=top y7l=h+o; .5[x2r,x4]=x3; y4''+like_hair=y3r-like_hair; lft x4r=w-6.2u-stem;
y8''=y7r-top like_hair; z8'=z8+.2fend*down+o*left; z8''=z8+.5(fend-currentbreadth)*dir45;
.5[x6r,x8]=x7; 
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
lowercase_points(1,2,jut); lowercase_points(5,6,jut); 
if not bold_face: y2r:=y6r:=y2r+hair; fi;
ijut=.5hair; 
 x1e:=x1e-ijut; x1d:=x1d-ijut; x5c:=x5c+ijut; x5b:=x5b+ijut; 
z3'r=z3r+.5hair*right; z7'r=z7r+.5hair*right;
bot y12=0; top y13=h; rt x12r=w-2u; x8r=x12l;
lowercase_points(12,13,jut);
pos9(hair,90); pos9'(hair,90); pos10(hair,90); pos10'(hair,90);
pos11(hair,90); pos11'(hair,90);
y9=y9'=y10=y10'=y11=y11'=bot x_height;
lft x9=u; x11=x5r+x9'-x9; x9'=x1l; x10=x6l; x10'=x1r; x11'=x6r;
p0=z8l{up}..z8''..z7l..{down}z6l;
p1=z4l{up}..z4''..z3l..{down}z2l;
p2=z2r...{right}z3r..z4r..z4'..{up}z4l;
(tim0,tim1)=p0 intersectiontimes p1;
(tim2,tim3)=p2 intersectiontimes p0;
tim4=xpart(p0 intersectiontimes ((.75[x12a,x12l],y8r)--(.75[x12a,x12l],h)));
if x12c-x5d<u: x5d:=x5d-ijut; x5e:=x5e-ijut; fi;
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..
         {left}z1e..z1f---obl(10'l,1r,10l)---obl(10l,10'l,5l)---
	 z5a..z5b{left}..z5c{right}..z5+ser_boule*up..{right}z5d..
	 {left}z5e..z5f---obl(11'l,5r,11l)---z11l..z11r---obl(11'r,11r,6r)---
	 z6r...{right}z7r..z8r---z12a..{left}z12b..{right}z12c..z12+ser_boule*up
	 ..z12d{right}..{left}z12e..z12f---z13r{z13a-z13}..
	 subpath(tim4,rundy(p0,(tim0,2hair)).zpet) of p0..
	 subpath(rundy(p1,(tim1,2hair)),infinity) of p1 
	 --obl(9'r,2l,9r)---z9r..z9l---obl(9'l,9l,1l)---cycle;
infill z2r---obl(10'r,2r,10r)---obl(10r,10'r,6l)---z6l..
       (reverse subpath(rundy(p0,tim3),infinity) of p0)..
       (reverse subpath(0,rundy(p2,tim2).zpet) of p2)..cycle;
penlabels(3,4,7,8,9,9',10,10',11,11'); labels(4',4'',8',8'');
endchar;

iff known chars.latin_fi:
bskchar "The ligature fi";
beginchar(chars.latin_fi,11u#, asc_height#, 0); uni "0xFB01";
italcorr .5[asc_height#,x_height#]*slant-.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p;
numeric fend, help; fend:=stem;
pos3(hair,-90); pos4(fend,180);
lft x1l=2.5u; bot y1=0; top y2=h-like_curve;
top y3l=h+o; .5[x2r,x4]=x3; top y4''=y3r-like_hair;
help:=y4''-.2fend-dot_size-x_height;
if help<.85stem: y4'':=.5[y3r,x_height]+.5dot_size+tiny; fi
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
lowercase_points(1,2,jut); 
if not bold_face: y2r:=y2r+hair; fi;
z3'r=z3r+.5hair*right; 
pos5(hair,90); pos5'(hair,90); pos6(hair,90); pos6'(hair,90);
bot y7=0; top y8=x_height; rt x7r=w-2u;
lowercase_points(7,8,1.2jut);
y5=y5'=y6=y6'=bot x_height-.5serif_drop;
lft x5=u; x6-x1r=x1l-x5; x5'=x1l; x6'=x1r;
x4r=x7l;
pos9(dot_size+tiny,10);
lft x9r=x4l; y9=y4l-.5dot_size;
p:=z8r---obl(6'r,6r,2r)---z2r...{right}z3r..{z4'-z4r}z4r;
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..
         {left}z1e..{up}z1f---obl(6'l,1r,6l)---z8a---obl(8b,8a,7a)
	 ---z7a..z7b{left}..{right}z7c..z7+ser_boule*up..z7d{right}
	 ..{left}z7e..{up}z7f---z8r&subpath(0,rundy(p,infinity).zpet) of p
	 ..{down}z9l..z9r{up}..z4''..z3l..z2l---obl(5'r,2l,5r)
	 ---z5r..z5l---obl(5'l,5l,1l)---cycle;
penlabels(3,4,5,5',6,6',9); labels(4',4'');
endchar;

iff known chars.latin_fj: %Non-standard, not included in ligtables
bskchar "The ligature fj";
beginchar(chars.latin_fj,11u#, asc_height#, desc_depth#); uni "non";
italcorr .5[asc_height#,x_height#]*slant-.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p;
numeric fend, help; fend:=stem;
pos3(hair,-90); pos4(fend,180);
lft x1l=2.5u; bot y1=0; top y2=h-like_curve;
top y3l=h+o; .5[x2r,x4]=x3; top y4''=y3r-like_hair;
help:=y4''-.2fend-dot_size-x_height;
if help<.85stem: y4'':=.5[y3r,x_height]+.5dot_size+tiny; fi
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
lowercase_points(1,2,jut); 
if not bold_face: y2r:=y2r+hair; fi;
z3'r=z3r+.5hair*right; 
pos5(hair,90); pos5'(hair,90); pos6(hair,90); pos6'(hair,90);
bot y7=-d+like_curve; top y8=x_height; rt x7r=w-2u;
lowercase_points(7,8,1.2jut);
y5=y5'=y6=y6'=bot x_height-.5serif_drop;
lft x5=u; x6-x1r=x1l-x5; x5'=x1l; x6'=x1r; x4r=x7l;
pos10(hair,-90); bot y10r=-d; x10=x7r-3u; top y11=y7; x11l=x7r-5u;
pos9(dot_size+tiny,10);
lft x9r=x4l; y9=y4l-.5dot_size;
p:=z8r---obl(6'r,6r,2r)---z2r...{right}z3r..{z4'-z4r}z4r;
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..{left}z1e
         ..{up}z1f---obl(6'l,1r,6l)---z8a---obl(8b,8a,7a)---z7l ...{left}z10l
	 ..reverse smitko(11,stem)..{right}z10r..{up}z7r---z8r
	 &subpath(0,rundy(p,infinity).zpet) of p..{down}z9l..z9r{up}..z4''..z3l
	 ..z2l---obl(5'r,2l,5r)---z5r..z5l---obl(5'l,5l,1l)---cycle;
penlabels(3,4,5,5',6,6',9,10,11); labels(4',4'');
endchar;

iff known chars.latin_ffi:
bskchar "The ligature ffi";
beginchar(chars.latin_ffi,15u#, asc_height#, 0); uni "0xFB03";
italcorr .5[asc_height#,x_height#]*slant-.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric fend, ijut, help, tim[]; fend:=stem;
path p[];
pos3(hair,-90); pos4(fend,180); pos7(hair,-90); pos8(fend,180);
lft x1l=2.5u; x5l=.5[x3,x4]; bot y1=bot y5=0; top y2=top y6=h-like_curve;
top y3l=top y7l=h+o; .5[x2r,x4]=x3; y4''=y3r-like_hair; lft x4r=w-6.2u-stem;
y8''=y7r-top like_hair; 
help:=y8''-.2fend-dot_size-x_height;
if help<.85stem: y8'':=.5[y3r,x_height]+.5dot_size+tiny; fi
z8'=z8+.2fend*down+o*left; z8''=z8+.5(fend-currentbreadth)*dir45;
.5[x6r,x8]=x7; 
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
lowercase_points(1,2,1.2jut); lowercase_points(5,6,jut); 
if not bold_face: y2r:=y6r:=y2r+hair; fi;
ijut=.5hair; 
 x1e:=x1e-ijut; x1d:=x1d-ijut; x5c:=x5c+ijut; x5b:=x5b+ijut; 
z3'r=z3r+.5hair*right; z7'r=z7r+.5hair*right;
bot y12=0; top y13=x_height; rt x12r=w-2u; x8r=x12l;
lowercase_points(12,13,1.2jut);
pos9(hair,90); pos9'(hair,90); pos10(hair,90); pos10'(hair,90);
pos11(hair,90); pos11'(hair,90); pos14(dot_size+tiny,10);
y9=y9'=y10=y10'=y11=y11'=bot x_height-.5serif_drop;
lft x9=u; x11=x5r+x9'-x9; x9'=x1l; x10=x6l; x10'=x1r; x11'=x6r;
lft x14r=x8l; y14=y8l-.5dot_size;
p0=z8l{up}..z8''..z7l..{down}z6l;
p1=z4l{up}..z4''..z3l..{down}z2l;
p2=z2r...{right}z3r..z4r..z4'..{up}z4l;
p3=z7r{right}..{z8'-z8r}z8r;
(tim0,tim1)=p0 intersectiontimes p1;
(tim2,tim3)=p2 intersectiontimes p0;
tim4=xpart(p0 intersectiontimes ((.75[x12a,x12l],y8r)--(.75[x12a,x12l],h)));
if x12c-x5d<u: x5d:=x5d-ijut; x5e:=x5e-ijut; fi;
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..
         {left}z1e..z1f---obl(10'l,1r,10l)---obl(10l,10'l,5l)---
	 z5a..z5b{left}..z5c{right}..z5+ser_boule*up..{right}z5d..
	 {left}z5e..z5f---obl(11'l,5r,11l)---z13a---obl(13b,13a,12a)
	 ---z12a..{left}z12b..{right}z12c..z12+ser_boule*up..z12d{right}..
	 {left}z12e..z12f---z13r---obl(11'r,11r,6r)---
	 z6r...subpath(0,rundy(p3,infinity).zpet) of p3..{down}z14l..z14r{up}..z8''
	 ..subpath(1,rundy(p0,(tim0,2hair)).zpet) of p0..
	 subpath(rundy(p1,(tim1,2hair)),infinity) of p1
	 --obl(9'r,2l,9r)---z9r..z9l---obl(9'l,9l,1l)---cycle;
infill z2r---obl(10'r,2r,10r)---obl(10r,10'r,6l)---z6l--
       (reverse subpath(rundy(p0,tim3),infinity) of p0)..
       (reverse subpath(0,rundy(p2,tim2).zpet) of p2)&cycle;
penlabels(3,4,7,8,9,9',10,10',11,11',14); labels(4',4'',8',8'');
endchar;

iff known chars.latin_ffi_alt:
bskchar "The ligature ffi---alternative";
beginchar(chars.latin_ffi_alt,15u#, asc_height#, 0); uni "non"; %"0xFB03";
italcorr .5[asc_height#,x_height#]*slant-.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric fend, ijut, help, tim[]; fend:=stem;
path p[];
pos3(hair,-90); pos4(fend,180); pos7(hair,-90); pos8(fend,180);
lft x1l=2.5u; x5l=.5[x3,x4]; bot y1=bot y5=0; top y2+like_hair=top y6=h-like_curve;
top y3l+like_hair=top y7l=h+o; .5[x2r,x4]=x3; y4''+like_hair=y3r-like_hair; lft x4r=w-6.2u-stem;
y8''=y7r-top like_hair; 
help:=y8''-.2fend-dot_size-x_height;
if help<.85stem: y8'':=.5[y3r,x_height]+.5dot_size+tiny; fi
z8'=z8+.2fend*down+o*left; z8''=z8+.5(fend-currentbreadth)*dir45;
.5[x6r,x8]=x7; 
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
lowercase_points(1,2,1.2jut); lowercase_points(5,6,jut); 
if not bold_face: y2r:=y6r:=y2r+hair; fi;
ijut=.5hair; 
 x1e:=x1e-ijut; x1d:=x1d-ijut; x5c:=x5c+ijut; x5b:=x5b+ijut; 
z3'r=z3r+.5hair*right; z7'r=z7r+.5hair*right;
bot y12=0; top y13=x_height; rt x12r=w-2u; x8r=x12l;
lowercase_points(12,13,1.2jut);
pos9(hair,90); pos9'(hair,90); pos10(hair,90); pos10'(hair,90);
pos11(hair,90); pos11'(hair,90); pos14(dot_size+tiny,10);
y9=y9'=y10=y10'=y11=y11'=bot x_height-.5serif_drop;
lft x9=u; x11=x5r+x9'-x9; x9'=x1l; x10=x6l; x10'=x1r; x11'=x6r;
lft x14r=x8l; y14=y8l-.5dot_size;
p0=z8l{up}..z8''..z7l..{down}z6l;
p1=z4l{up}..z4''..z3l..{down}z2l;
p2=z2r...{right}z3r..z4r..z4'..{up}z4l;
p3=z7r{right}..{z8'-z8r}z8r;
(tim0,tim1)=p0 intersectiontimes p1;
(tim2,tim3)=p2 intersectiontimes p0;
tim4=xpart(p0 intersectiontimes ((.75[x12a,x12l],y8r)--(.75[x12a,x12l],h)));
if x12c-x5d<u: x5d:=x5d-ijut; x5e:=x5e-ijut; fi;
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..
         {left}z1e..z1f---obl(10'l,1r,10l)---obl(10l,10'l,5l)---
	 z5a..z5b{left}..z5c{right}..z5+ser_boule*up..{right}z5d..
	 {left}z5e..z5f---obl(11'l,5r,11l)---z13a---obl(13b,13a,12a)
	 ---z12a..{left}z12b..{right}z12c..z12+ser_boule*up..z12d{right}..
	 {left}z12e..z12f---z13r---obl(11'r,11r,6r)---
	 z6r...subpath(0,rundy(p3,infinity).zpet) of p3..{down}z14l..z14r{up}..z8''
	 ..subpath(1,rundy(p0,(tim0,2hair)).zpet) of p0..
	 subpath(rundy(p1,(tim1,2hair)),infinity) of p1
	 --obl(9'r,2l,9r)---z9r..z9l---obl(9'l,9l,1l)---cycle;
infill z2r---obl(10'r,2r,10r)---obl(10r,10'r,6l)---z6l--
       (reverse subpath(rundy(p0,tim3),infinity) of p0)..
       (reverse subpath(0,rundy(p2,tim2).zpet) of p2)&cycle;
penlabels(3,4,7,8,9,9',10,10',11,11',14); labels(4',4'',8',8'');
endchar;

charscription(11u,x_height,desc_depth)(
path p[]; numeric tim[]; oblu:=2oblu;
pos1(curve,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
lft x1l=1.5u; rt x3l=w-2.5u; y1=y3=.5[y4l,y2l]; .5[x2,x4]=.5[x1,x3]; x2=x4; 
bot y2l=1/3bar_height+.25stem; top y4l=h+o; x4r:=x4r+.25u; x2r:=x2r-.25u;
p0:=z1l{down}..z2l..{up}z3l..z4l..{down}z1l;
tim1=xpart(p0 intersectiontimes ((0,y2l+tiny)--(w,y2l+tiny)));
z5r=point tim1 of p0; 
tim2=xpart(p0 intersectiontimes ((x5r-hair+tiny,0)--(x5r-hair+tiny,h)));
z5l=point tim2 of p0; z5=.5[z5l,z5r];
lft z5'=(1.75u,0);
pos6(stem,90); pos8(hair,270);
y6l=top y7l+.5stem; y6=0; x6=x5+u; x6r:=x6r+.5hair; rt x7l=w-2.5u;
x8=x2; bot y8r=-d; 
pos9(dot_size,180); lft x9r=u; top y9=-.45d;
p1=subpath(0,.5tim2) of p0 .. z5l+hair*dir-130{dir-130}..z5'..{right}z6l..z7l..{left}z8l; 
z7r-z7l=.8stem*dir(angle(direction 3 of p1)+90); z7=.5[z7r,z7l];
y9'=y7l if not bold_face:-.25dot_size fi; z9'=whatever[z9l,z5];
pos10(hair,135); pos11(hair,135); z11-z10=tiny*dir45;
z10=(.5[z2,z4]--(w-u,h)) intersectionpoint p0;
pos12(stem,45); pos12'(stem,45); x12r=w-u; y12l=y11l; z12'=z12+.5tiny*dir135;
p2=.5[z2,z4]---z11l..{dir-60}z12'l--z12l;
p3=z12r---z12'r..z11r---z10r--z10;
p4=z8r{right}..z7r..{left}z6r..{dir30}z5r;
(tim3,tim4)=p0 intersectiontimes p2;
(tim5,tim6)=p3 intersectiontimes p0;
filldraw p1..{(w,h)-z9l}z9l..z9'{left}..{down}z9r..
         subpath(0,rundy(p4,(infinity,if bold_face: 1.5f_obl else: oblu fi)).zpet) of p4
         ..subpath(rundy(p0,tim1),rundy(p0,tim3).zpet) of p0..
         subpath(rundy(p2,1),infinity) of p2{dir0}..
	 subpath(0,rundy(p3,(2,hair)).zpet) of p3..
	 subpath(rundy(p0,tim6),infinity) of p0-- cycle;
infill z1r{up}..z4r..{down}z3r..z2r..{up}cycle;
penlabels(1,2,3,4,5,6,7,8,9,10,11,12,12'); labels(5',9');
);

iff known chars.latin_g:
bskchar "The letter g";
beginchar(chars.latin_g,11u#,x_height#,desc_depth#); uni "0x0067";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_gacute:
bskchar "The letter g with acute";
beginchar(chars.latin_gacute,11u#,asc_height#,desc_depth#); uni "0x01F5";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4-o;
acute(100,101);
endchar;

iff known chars.latin_gcaron:
bskchar "The letter g with caron";
beginchar(chars.latin_gcaron,11u#,asc_height#,desc_depth#); uni "0x01E7";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4r;
hacek(100,101,102);
endchar;

iff known chars.latin_gcircumflex:
bskchar "The letter g with circumflex";
beginchar(chars.latin_gcircumflex,11u#,asc_height#-.1x_height#,desc_depth#); uni "0x011D";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4r;
circumflex(100,101,102);
endchar;

iff known chars.latin_gcedilla:
bskchar "The letter g with cedilla (treated as comma)";
beginchar(chars.latin_gcedilla,11u#,x_height#+.75comma_depth#+o#,desc_depth#); uni "0x0123";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
lft x100=x4; bot y100''r=x_height+2o;
ammoc(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_gdotabove:
bskchar "The letter g with dot above";
beginchar(chars.latin_gdotabove,11u#,asc_height#-.5dot_size#,desc_depth#); uni "0x0121";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x4;
dotabove(100);
endchar;

iff known chars.latin_gbreve:
bskchar "The letter g with breve";
beginchar(chars.latin_gbreve,11u#,asc_height#,desc_depth#); uni "0x011F";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4r; x102-x100=5u; 
breve(100,101,102);
endchar;

iff known chars.latin_g_BB:
bskchar "The blackboard-bold letter g";
beginchar(chars.latin_g_BB,11u#,x_height#,desc_depth#); uni "0x1D558";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos1(cap_stem,0); pos2(hair,90); pos3(cap_stem,180); pos4(hair,270);
lft x1l=1.5u; rt x3l=w-2.5u; y1=y3=.5[y4l,y2l]; .5[x2,x4]=.5[x1,x3]; x2=x4; 
bot y2l=1/3bar_height+.25stem; top y4l=h+o; x4r:=x4r+.25u; x2r:=x2r-.25u;
p0:=z1l{down}..z2l..{up}z3l..z4l..{down}z1l;
tim1=xpart(p0 intersectiontimes ((0,y2l+tiny)--(w,y2l+tiny)));
z5r=point tim1 of p0; 
tim2=xpart(p0 intersectiontimes ((x5r-hair+tiny,0)--(x5r-hair+tiny,h)));
z5l=point tim2 of p0; z5=.5[z5l,z5r];
lft z5'=(1.75u,0);
pos6(.8cap_stem,90); pos8(hair,270);
y6l=top y7l+.5stem; y6=0; x6=x5+u; x6r:=x6r+.5hair; rt x7l=w-2.75u;
x8=x2; bot y8r=-d; 
pos9(dot_size,180); lft x9r=u; top y9=-.45d;
p1=subpath(0,.5tim2) of p0 .. z5l+hair*dir-130{dir-130}..z5'..{right}z6l..z7l..{left}z8l; 
z7r-z7l=.8cap_stem*dir(angle(direction 3 of p1)+90); z7=.5[z7r,z7l];
y9'=y7l if not bold_face:-.25dot_size fi; z9'=whatever[z9l,z5];
pos10(hair,135); pos11(hair,135); z11-z10=tiny*dir45;
z10=(.5[z2,z4]--(w-u,h)) intersectionpoint p0;
pos12(stem,45); pos12'(stem,45); x12r=w-u; y12l=y11l; z12'=z12+.5tiny*dir135;
p2=.5[z2,z4]---z11l..{dir-60}z12'l--z12l;
p3=z12r---z12'r..z11r---z10r--z10;
p4=z8r{right}..z7r..{left}z6r..{dir30}z5r;
(tim3,tim4)=p0 intersectiontimes p2;
(tim5,tim6)=p3 intersectiontimes p0;
filldraw p1..{(w,h)-z9l}z9l..z9'{left}..{down}z9r..
         subpath(0,rundy(p4,(infinity,if bold_face: 1.5f_obl else: oblu fi)).zpet) of p4
         ..subpath(rundy(p0,tim1),rundy(p0,tim3).zpet) of p0..
         subpath(rundy(p2,1),infinity) of p2{dir0}..
	 subpath(0,rundy(p3,(2,hair)).zpet) of p3..
	 subpath(rundy(p0,tim6),infinity) of p0-- cycle;
infill z1r{up}..z4r..{down}z3r..z2r..{up}cycle;
p100:=p4;
p101:=z5l+hair*dir-130{dir-130}..z5'..{right}z6l..z7l..{left}z8l;
p102:=z4r..z1r{down}..z2r..z3r..cycle;
p103:=reverse z4l..z1l{down}..z2l..z3l..cycle;
z100=bsktouch(p100,left,subpath(0,2) of p101,right);
z101=bsktouch(p100,up,p101,down);
z102=bsktouch(subpath(0,1) of p102,up,p103,down);
z103=bsktouch(subpath(1,2) of p102,down,p103,up);
z104=bsktouch(subpath(3,4) of p102,up,p103,down);
z105=bsktouch(subpath(2,3) of p102,down,p103,up);
tim100=xpart(p100 intersectiontimes (z100--(w,y100)));
tim101=xpart(p101 intersectiontimes (z100--(0,y100)));
tim102=xpart(p100 intersectiontimes (z101--(x101,-d-5)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y9)));
tim104=xpart(p102 intersectiontimes (z102--(x102,y1)));
tim105=xpart(p103 intersectiontimes (z102--(x102,y4l+5)));
tim106=xpart(p102 intersectiontimes (z103--(x103,y1)));
tim107=xpart(p103 intersectiontimes (z103--(x103,y2l-5)));
tim108=xpart(p102 intersectiontimes (z104--(x104,y1)));
tim109=xpart(p103 intersectiontimes (z104--(x104,y4l+5)));
tim110=xpart(p102 intersectiontimes (z105--(x105,y1)));
tim111=xpart(p103 intersectiontimes (z105--(x105,y2l-5)));
oblu:=bbw;
infill subpath(rundy(p101,tim101),rundy(p101,tim103).zpet) of p101
       ..subpath(rundy(p100,tim102),rundy(p100,tim100).zpet) of p100..cycle;
infill subpath(rundy(p102,tim104),rundy(p102,tim106).zpet) of p102
       ..subpath(rundy(p103,tim107).zpet,rundy(p103,tim105)) of p103..cycle;
infill subpath(rundy(p102,tim108).zpet,rundy(p102,tim110)) of p102
       ..subpath(rundy(p103,tim111),rundy(p103,tim109).zpet) of p103..cycle;
penlabels(1,2,3,4,5,6,7,8,9,10,11,12,12'); labels(5',9',100,101,102,103,104,105);
endchar;

iff known chars.latin_g_SS:
bskchar "The sans-serif letter g";
beginchar(chars.latin_g_SS,11u#,x_height#,desc_depth#); uni "0x1D5C0";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos1(curve,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
lft x1l=1.5u; rt x3l=w-2.5u; y1=y3=.5[y4l,y2l]; .5[x2,x4]=.5[x1,x3]; x2=x4; 
bot y2l=1/3bar_height+.25stem; top y4l=h+o; x4r:=x4r+.25u; x2r:=x2r-.25u;
p0:=z1l{down}..z2l..{up}z3l..z4l..{down}z1l;
tim1=xpart(p0 intersectiontimes ((0,y2l+tiny)--(w,y2l+tiny)));
z5r=point tim1 of p0; 
tim2=xpart(p0 intersectiontimes ((x5r-hair+tiny,0)--(x5r-hair+tiny,h)));
z5l=point tim2 of p0; z5=.5[z5l,z5r];
lft z5'=(1.75u,0);
pos6(stem,90); pos8(hair,270);
y6l=top y7l+.5stem; y6=0; x6=x5+u; x6r:=x6r-.5hair; rt x7l=w-2.5u;
x8=x2; bot y8r=-d; 
pos9(stem,180); lft x9r=u; top y9=-.45d;
p1=subpath(0,.5tim2) of p0 .. z5l+hair*dir-130{dir-130}..z5'..{right}z6l..z7l..{left}z8l; 
z7r-z7l=.8stem*dir(angle(direction 3 of p1)+90); z7=.5[z7r,z7l];
z9'-z9=(o,hair);
pos10(hair,135); pos11(hair,135); z11-z10=tiny*dir45;
z10=(.5[z2,z4]--(w-u,h)) intersectionpoint p0;
pos12(stem,45); pos12'(stem,45); x12r=w-u; y12l=y11l; z12'=z12+.5tiny*dir135;
p2=.5[z2,z4]---z11l..{dir-60}z12'l--z12l;
p3=z12r---z12'r..z11r---z10r--z10;
p4=z8r{right}..z7r..{left}z6r..{dir30}z5r;
(tim3,tim4)=p0 intersectiontimes p2;
(tim5,tim6)=p3 intersectiontimes p0;
filldraw p1..z9l{up}..z9'{left}..{down}z9r..
         subpath(0,rundy(p4,(infinity,if bold_face: 1.5f_obl else: oblu fi)).zpet) of p4
         ..subpath(rundy(p0,tim1),rundy(p0,tim3).zpet) of p0..
         subpath(rundy(p2,1),infinity) of p2{dir0}..
	 subpath(0,rundy(p3,(2,hair)).zpet) of p3..
	 subpath(rundy(p0,tim6),infinity) of p0-- cycle;
infill z1r{up}..z4r..{down}z3r..z2r..{up}cycle;
penlabels(1,2,3,4,5,6,7,8,9,10,11,12,12'); labels(5',9');
endchar;

charscription(11u,asc_height,0)(
path p[]; numeric tim[]; oblu:=2oblu;
pos3(stem,0); pos4(stem,0); pos5(n_str_hair,90); pos6(hair,180);
lft x1l=2u; bot y1=0; top y2=h;
rt x3r=w-2u; bot y3=0; serif_bot(3);
x4=x3; y4=.65x_height; y5r=x_height; x5=.5[x3l,x1r];
x6l=x1r; y6=.5x_height;
lowercase_points(1,2,jut);
p1:=z6l{up}..z5l..z4l---z3a..z3b{left}..{right}z3c;
p2:=z3d{right}..{left}z3e..z3f---z4r..z5r..{down}z6r;
p3:=z1f--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+hair+tiny)*up;
if y1'>y5: y1':=y5; fi;
tim3=xpart(p2 intersectiontimes((0,y1'-.5hair)--(.5w,y1'-.5hair)));
filldraw p1..z3+ser_boule*up..subpath (0,tim3) of p2..z1'---
         lowercase_stem_draw(1,2)---cycle;
penlabels(3,4,5,6); labels(1');
);

iff known chars.latin_h:
bskchar "The letter h";
beginchar(chars.latin_h,11u#, asc_height#, 0); uni "0x0068";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_hcaron:
bskchar "The letter h with caron";
beginchar(chars.latin_hcaron,11u#,asc_height#,0); uni "0x021F";
italcorr asc_height#*slant-1.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
lft x101=x5+hair; x102-x100=4.5u; y100=h+hair; y101l=1/4[x_height,y100]+hair;
hacek(100,101,102);
endchar;

iff known chars.latin_hcircumflex:
bskchar "The letter h with circumflex";
beginchar(chars.latin_hcircumflex,11u#,asc_height#,0); uni "0x0125";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
lft x101=x5+hair; x102-x100=4.5u;
circumflex(100,101,102);
endchar;

iff known chars.latin_h_BB:
bskchar "The blackboard-bold letter h";
beginchar(chars.latin_h_BB,11u#, asc_height#, 0); uni "0x1D559";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos3(.8cap_stem,0); pos4(.8cap_stem,0); pos5(n_str_hair,90); pos6(hair,180);
lft x1l=2u; bot y1=0; top y2=h;
rt x3r=w-2u; bot y3=0; serif_bot(3);
x4=x3; y4=.65x_height; y5r=x_height; x5=.5[x3l,x1r];
x6l=x1r; y6=.5x_height;
save stem; stem:=.8cap_stem;
lowercase_points(1,2,jut);
p1:=z6l{up}..z5l..z4l---z3a..z3b{left}..{right}z3c;
p2:=z3d{right}..{left}z3e..z3f---z4r..z5r..{down}z6r;
p3:=z1f--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+hair+tiny)*up;
if y1'>y5: y1':=y5; fi;
tim3=xpart(p2 intersectiontimes((0,y1'-.5hair)--(.5w,y1'-.5hair)));
filldraw p1..z3+ser_boule*up..subpath (0,tim3) of p2..z1'---
         lowercase_stem_draw(1,2)---cycle;
oblu:=f_obl; oblu.more:=1.25oblu;
bot z100=(x1l,y1b); bot z103=(x3r,y3e);
p100=subpath(3,4) of p2;
p101=subpath(1,2) of p1;
z101=bsktouch(p100,down,p101,up);
tim100=xpart(p100 intersectiontimes (z101--(x101,h)));
tim101=xpart(p101 intersectiontimes (z101--(x101,0)));
infill ifobl(2r,2b,1r,1l,more,)---obl(100,2b,1b)...z1l---obl(1r,1l,2r)---cycle;
infill subpath(0,rundy(p100,(tim100,bbw)).zpet) of p100
       ..subpath(rundy(p101,(tim101,bbw)),infinity) of p101
       ---obl(3l,4l,3r)---z3r...obl(103,3e,4r)---cycle;
penlabels(3,4,5,6); labels(1',100,101,102);
endchar;

iff known chars.latin_h_SS:
bskchar "The sans-serif letter h";
beginchar(chars.latin_h_SS,11u#, asc_height#, 0); uni "0x1D5C1";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos3(stem,0); pos4(stem,0); pos5(n_str_hair,90); pos6(hair,180);
lft x1l=2u; bot y1=0; top y2=h;
rt x3r=w-2u; bot y3=0; serif_bot(3);
x4=x3; y4=.65x_height; y5r=x_height; x5=.5[x3l,x1r];
x6l=x1r; y6=.5x_height;
lowercase_points(1,2,jut);
p1:=z6l{up}..z5l..z4l---z3a..{right}z3;
p2:=z3{right}..z3f---z4r..z5r..{down}z6r;
p3:=z1f--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+hair+tiny)*up;
if y1'>y5: y1':=y5; fi;
tim3=xpart(p2 intersectiontimes((0,y1'-.5hair)--(.5w,y1'-.5hair)));
filldraw p1..z3+ser_boule*up..subpath (0,tim3) of p2..z1'---z2r..z2b---z1a..z1..z1f---cycle;
penlabels(3,4,5,6); labels(1');
endchar;

iff known chars.latin_hstroke:
bskchar "The letter h with stroke";
beginchar(chars.latin_hstroke,11u#, asc_height#, 0); uni "0x0127";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2f_obl; oblu.light:=f_obl;
pos3(stem,0); pos4(stem,0); pos5(n_str_hair,90); pos6(hair,180);
pos7(bar,90); pos7'(bar,90); pos8(bar,90); pos8'(bar,90);
x8-x7=4u; y8=y8'=y7=y7'=.4[x_height,h]; lft x7=.5u;
x7'=x1l; x8'=x1r; bskpoints(7,8,hair,hair);
lft x1l=2u; bot y1=0; top y2=h;
rt x3r=w-2u; bot y3=0; serif_bot(3);
x4=x3; y4=.65x_height; y5r=x_height; x5=.5[x3l,x1r];
x6l=x1r; y6=.5x_height;
lowercase_points(1,2,jut);
p1:=z6l{up}..z5l..z4l---z3a..z3b{left}..{right}z3c;
p2:=z3d{right}..{left}z3e..z3f---z4r..z5r..{down}z6r;
p3:=z1f--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+hair+tiny)*up;
if y1'>y5: y1':=y5; fi;
tim3=xpart(p2 intersectiontimes((0,y1'-.5hair)--(.5w,y1'-.5hair)));
filldraw p1..z3+ser_boule*up..subpath (0,tim3) of p2..z1'---obl(8'l,1',8l).light
         ---z8ll..z8r---obl(8'r,8r,2).light---subpath(0,3) of lowercase_stem_draw(1,2)
	 ---obl(7'r,2l,7r).light---z7rr..z7l---obl(7'l,7l,1l).light
	 ---subpath(4,infinity) of lowercase_stem_draw(1,2)---cycle;
penlabels(3,4,5,6,7,7',8,8'); labels(1',7rr,8ll);
endchar;

iff known chars.latin_hbar:
bskchar "The letter h with bar (Dirac constant)";
beginchar(chars.latin_hbar,11u#, asc_height#, 0); uni "0x210F";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[], theta; oblu:=2f_obl; oblu.light:=f_obl;
pos3(stem,0); pos4(stem,0); pos5(n_str_hair,90); pos6(hair,180);
x8-x7=4u; .5[y8,y7]=.35[x_height,h]; y8-y7=stem; lft x7=.5u;
theta:=angle(z8-z7)+90;
pos7(bar,theta); pos8(bar,theta); 
x7'l=x7'r=x1l; x8'l=x8'r=x1r; bskpoints(7,8,hair,hair);
z7'l=whatever[z7l,z8l]; z8'l=whatever[z7l,z8l];
z7'r=whatever[z7r,z8r]; z8'r=whatever[z7r,z8r];
lft x1l=2u; bot y1=0; top y2=h;
rt x3r=w-2u; bot y3=0; serif_bot(3);
x4=x3; y4=.65x_height; y5r=x_height; x5=.5[x3l,x1r];
x6l=x1r; y6=.5x_height;
lowercase_points(1,2,jut);
p1:=z6l{up}..z5l..z4l---z3a..z3b{left}..{right}z3c;
p2:=z3d{right}..{left}z3e..z3f---z4r..z5r..{down}z6r;
p3:=z1f--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+hair+tiny)*up;
if y1'>y5: y1':=y5; fi;
tim3=xpart(p2 intersectiontimes((0,y1'-.5hair)--(.5w,y1'-.5hair)));
filldraw p1..z3+ser_boule*up..subpath (0,tim3) of p2..z1'---obl(8'l,1',8l).light
         ---z8ll..z8r---obl(8'r,8r,2).light---subpath(0,3) of lowercase_stem_draw(1,2)
	 ---obl(7'r,2l,7r).light---z7rr..z7l---obl(7'l,7l,1l).light
	 ---subpath(4,infinity) of lowercase_stem_draw(1,2)---cycle;
penlabels(3,4,5,6,7,7',8,8'); labels(1',7rr,8ll);
endchar;

charscription(6u,x_height,0)(
oblu:=2oblu;
x1=.5w; bot y1=0; top y2=x_height;
lowercase_stem(1,2,1.2jut).alt;
);

iff known chars.latin_dotless_i:
bskchar "The dotless i";
beginchar(chars.latin_dotless_i,6u#, x_height#, 0); uni "0x0131";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_i:
bskchar "The letter i";
beginchar(chars.latin_i,6u#, asc_height#-.5dot_size#, 0); uni "0x0069";
italcorr (asc_height#-.5dot_size#)*slant-1.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
x3=x1-ddot; top y3=h-.5dot_size;
usechar;
dot(3);
endchar;

iff known chars.latin_iacute:
bskchar "The letter i with acute";
beginchar(chars.latin_iacute,6u#, asc_height#, 0); uni "0x00ED";
italcorr asc_height#*slant-u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
x101=x2l;
usechar;
acute(100,101);
endchar;

iff known chars.latin_igrave:
bskchar "The letter i with grave";
beginchar(chars.latin_igrave,6u#,asc_height#,0); uni "0x00EC";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x2;
grave(100,101);
endchar;

iff known chars.latin_idoublegrave:
bskchar "The letter i with double grave";
beginchar(chars.latin_idoublegrave,6u#,asc_height#,0); uni "0x0209";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x102-x100=2.5u; x103r=x2r;
d_grave(100,101,102,103,whatever);
endchar;

iff known chars.latin_imacron:
bskchar "The letter i with macron";
beginchar(chars.latin_imacron,6u#,.5[asc_height#,x_height#],0); uni "0x012B";
italcorr .5[asc_height#,x_height#]*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=w-u; x100=.5u;
macron(100,101);
endchar;

iff known chars.latin_icircumflex:
bskchar "The letter i with circumflex";
beginchar(chars.latin_icircumflex,6u#,asc_height#-.1x_height#,0); uni "0x00EE";
italcorr .5[asc_height#,x_height#]*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x2l;
circumflex(100,101,102);
endchar;

iff known chars.latin_iumlaut:
bskchar "The letter i with umlaut";
beginchar(chars.latin_iumlaut,6u#,asc_height#-dot_size#,0); uni "0x00EF";
italcorr (asc_height#-dot_size#)*slant-.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
.5[x100,x101]=x2l; x100-x101=1.8dot_size;
umlaut(100,101);
endchar;

iff known chars.latin_ibreve:
bskchar "The letter i with breve";
beginchar(chars.latin_ibreve,6u#,asc_height#,0); uni "0x012D";
italcorr asc_height#*slant-u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x2l-o;
breve(100,101,102);
endchar;

iff known chars.latin_iinvbreve:
bskchar "The letter i with inverted breve";
beginchar(chars.latin_iinvbreve,6u#,asc_height#,0); uni "0x020B";
italcorr x_height#*slant-.25u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x2l;
tieacc(100,101,102);
endchar;

iff known chars.latin_itilde:
bskchar "The letter i with tilde";
beginchar(chars.latin_itilde,6u#,asc_height#,0); uni "0x0129";
italcorr asc_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101-x100=5.5u; rt x.tilde=x2l;
tilde(100,101);
endchar;

iff known chars.latin_icaron:
bskchar "The letter i with caron";
beginchar(chars.latin_icaron,6u#,asc_height#,0); uni "0x01D0";
italcorr asc_height#*slant-.25u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x2l; x102-x100=4.5u;
hacek(100,101,102);
endchar;

charscription(6u,x_height,0)(
oblu:=2oblu;
x1=.5w; bot y1=0; top y2=x_height;
save stem; stem:=.8cap_stem;
lowercase_stem(1,2,1.2jut).alt;
bot z100=(x1l,y1b);
oblu:=f_obl; oblu.more:=1.25oblu;
infill ifobl(2r,2b,1r,1l,more,)---obl(100,2b,1b)...z1l---obl(1r,1l,2r)---cycle;
);

iff known chars.latin_dotless_i_BB:
bskchar "The blackboard-bold dotless i";
beginchar(chars.latin_dotless_i_BB,6u#, x_height#, 0); uni "non";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_i_BB:
bskchar "The blackboard-bold letter i";
beginchar(chars.latin_i_BB,6u#, asc_height#-.5dot_size#, 0); uni "0x1D55A";
italcorr (asc_height#-.5dot_size#)*slant-1.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x3=x1-ddot; top y3=h-.5dot_size;
dot(3);
endchar;

charscription(6u,x_height,0)(
oblu:=2oblu;
x1=.5w; bot y1=0; top y2=x_height;
lowercase_points(1,2,1.2jut).alt;
filldraw z1f---z2r..z2b---z1a..z1..cycle;
);

iff known chars.latin_dotless_i_SS:
bskchar "The sans-serif dotless i";
beginchar(chars.latin_dotless_i_SS,6u#, x_height#, 0); uni "non";
adjust_fit(serif_fit#-.5u#,serif_fit#-.5u#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_i_SS:
bskchar "The sans-serif letter i";
beginchar(chars.latin_i_SS,6u#, asc_height#-.5dot_size#, 0); uni "0x1D5C2";
italcorr (asc_height#-.5dot_size#)*slant-1.5u#;
adjust_fit(serif_fit#-.5u#,serif_fit#-.5u#);
pickup tiny.nib;
x3=x1-ddot; top y3=h-.5dot_size;
usechar;
dot(3);
endchar;

iff known chars.latin_iogonek:
bskchar "The letter i with ogonek";
beginchar(chars.latin_iogonek,6u#,asc_height#-.5dot_size#,.85desc_depth#); uni "0x012F";
italcorr (asc_height#-.5dot_size#)*slant-1.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
oblu:=2oblu;
path p[]; numeric tim[];
x1=.5w; bot y1=0; top y2=x_height;
lowercase_points(1,2,1.2jut).alt;
p0:=lowercase_stem_draw(1,2)--z2r;
pos3(stem,0); pos4(curve,0); pos5(hair,45); pos6(hair,160);
x3-x4l=1.5u; x3=x1; x5-x4l=3u; rt x6l-x5=1.5u;
y3=0; y4=-.5d; bot y5l=-d; y6=-2/3d;
p1:=z3l{z4l-z3r}..z4l...z5l..{z3-z4}z6l..z6r{z4-z3}..z5r..z4r..z3r;
tim0=xpart(p0 intersectiontimes ((x3l,0)--(x3l,y1b)));
tim1=xpart(p0 intersectiontimes ((x3r,0)--(x3r,y1b)));
filldraw subpath(0,rundy(p0,tim0).zpet) of p0
        ..subpath(rundy(p1,0),rundy(p1,infinity).zpet) of p1
	..subpath(rundy(p0,tim1),infinity) of p0..cycle;
x0=x1-ddot; top y0=h-.5dot_size;
dot(0);
penlabels(3,4,5,6);
endchar;

iff known chars.logo_i:
bskchar "The letter i for logo";
beginchar(chars.logo_i,6u#, asc_height#-.5dot_size#, comma_depth#); uni "non";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
x3=x1-ddot; top y3=h-.5dot_size;
oblu:=2oblu;
x1=.5w; bot y1=0; top y2=x_height;
lowercase_points(1,2,1.2jut).alt;
z5=z1b-z1c;
y1c:=-d; y1a:=0;
x4=x1; z4=whatever[z1c,z1d]+o*up;
z6=z1c+ z5 rotated angle(z1d-z1c);
filldraw z2r..{(x1a-x1r,-.25serif_drop)}z2a&z2a---obl(2b,2a,1a)---z1a..z6{z1c-z1d}..{z1d-z1c}z1c
  ..z4..{z1d-z1c}z1d{right}..{left}z1e..{up}z1f---z2r&cycle; 
dot(3);
labels(1a,1b,1c,4,6);
endchar;

charscription(5u,x_height,desc_depth)(
oblu:=2oblu;
pos3(hair,-90);
bot y1=-d+like_curve; top y2=x_height; rt x1r=w-u;
bot y3r=-d; x3=if monospace: .4w else: u fi; top y4=y1; if monospace: x4=u; else: x4l=-u; fi;
lowercase_points(1,2,1.2jut).alt; 
filldraw z3r{right}...{up}z1r--z2r..{(x2a-x1r,-.25serif_drop)}z2a&
         z2a---obl(2b,2a,1a)---z1l...{left}z3l..reverse smitko(4,stem)..cycle;
penlabels(1,2,3,4); labels(4',4'',4''');
);

iff known chars.latin_dotless_j:
bskchar "The dotless j";
beginchar(chars.latin_dotless_j,5u#,x_height#,desc_depth#); uni "non";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_j:
bskchar "The letter j";
beginchar(chars.latin_j,5u#,asc_height#-.5dot_size#,desc_depth#); uni "0x006A";
italcorr (asc_height#-.5dot_size#)*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
top y5=h-.5dot_size; x5=x1-ddot;
usechar;
dot(5);
endchar;

iff known chars.latin_jcircumflex:
bskchar "The letter j with circumflex";
beginchar(chars.latin_jcircumflex,5u#,asc_height#-.1x_height#,1.5like_cap_curve#); uni "0x0135";
italcorr .5[asc_height#,x_height#]*slant+1.5u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x2l;
circumflex(100,101,102);
endchar;

iff known chars.latin_ij:
bskchar "The letter ij";
beginchar(chars.latin_ij,9.5u#,asc_height#-.5dot_size#,desc_depth#); uni "0x0133";
italcorr (asc_height#-.5dot_size#)*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric shift; shift:=w-5u;
usechar shifted (shift*right);
oblu:=2f_obl;
lft x5l=2u; bot y5=0; top y6=x_height;
top y7=top y8=h-.5dot_size; x7=x5-ddot; x8=x1-ddot+shift; 
lowercase_stem(5,6,1.2jut).alt;
dot(7); dot(8);
endchar;

charscription(5u,x_height,desc_depth)(
path p[]; numeric tim[];
oblu:=2oblu;
pos3(hair,-90);
bot y1=-d+like_curve; top y2=x_height; rt x1r=w-u;
bot y3r=-d; x3=if monospace: .4w else: u fi; top y4=y1; if monospace: x4=u; else: x4l=-u; fi;
save stem; stem:=.8cap_stem;
lowercase_points(1,2,1.2jut).alt; 
filldraw z3r{right}...{up}z1r--z2r..{(x2a-x1r,-.25serif_drop)}z2a&
         z2a---obl(2b,2a,1a)---z1l...{left}z3l..reverse smitko(4,stem)..cycle;
p100:=z1l{down}...{left}z3l;
p101:=z3r{right}..{up}z1r;
z100=bsktouch(p100,down,p101,up);
tim100=xpart(p100 intersectiontimes (z100--z1c));
tim101=xpart(p101 intersectiontimes (z100--(w,-d)));
oblu:=bbw; oblu.more:=1.25f_obl; oblu.m:=f_obl;
infill ifobl(2r,2b,1r,1l,more,m)---subpath(0,rundy(p100,tim100).zpet) of p100
       ..subpath(rundy(p101,tim101),infinity) of p101---cycle;
penlabels(1,2,3,4); labels(4',4'',4''',100);
);

iff known chars.latin_dotless_j_BB:
bskchar "The blackboard-bold dotless j";
beginchar(chars.latin_dotless_j_BB,5u#,x_height#,desc_depth#); uni "non";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_j_BB:
bskchar "The blackboard-bold letter j";
beginchar(chars.latin_j_BB,5u#,asc_height#-.5dot_size#,desc_depth#); uni "0x1D55B";
italcorr (asc_height#-.5dot_size#)*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
top y5=h-.5dot_size; x5=x1-ddot;
usechar;
dot(5);
endchar;

charscription(5u,x_height,desc_depth)(
oblu:=2oblu;
pos3(hair,-90); pos4(stem,150);
bot y1=-d+like_curve; top y2=x_height; rt x1r=w-u;
bot y3r=-d; x3=if monospace: .4w else: u fi; top y4=y1; if monospace: x4=u; else: x4l=-u; fi;
lowercase_points(1,2,1.2jut).alt; 
z4'=z4+(o,.2stem); z4''=z4+.5(stem-currentbreadth)*dir-135;
filldraw z3r{right}...{up}z1r---z2r..z2b---z1l...{left}z3l.. z4l..z4'..z4''..cycle;
penlabels(1,2,3,4); labels(4',4'',4''');
);

iff known chars.latin_dotless_j_SS:
bskchar "The sans-serif dotless j";
beginchar(chars.latin_dotless_j_SS,5u#,x_height#,desc_depth#); uni "non";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_j_SS:
bskchar "The sans-serif letter j";
beginchar(chars.latin_j_SS,5u#,asc_height#-.5dot_size#,desc_depth#); uni "0x1D5C3";
italcorr (asc_height#-.5dot_size#)*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
top y5=h-.5dot_size; x5=x1-ddot;
usechar;
dot(5);
endchar;

charscription(10.5u,asc_height,0)(
pos3(whatever,0); pos5(whatever,0);
bot y1=0; top y2=h; lft x1l=2u;
rt x3r=w-3u; top y3=x_height; rt x5r=w-2u; bot y5r=0;
lowercase_points(1,2,jut);
y4r=.45x_height; x4r=x2r; z4l=z4r+(hair-tiny,0) rotated (angle(z3r-z4r)+90);
z3l=z4l+whatever*(z3r-z4r);
x6l=x4r+hair+.75u; z6l=whatever[z4r,z3r]; 
z6'=z6l+(stem-tiny,0) rotated (angle(z5r-z6l)+90);
z5l=z6l+whatever*(z5r-z6'); z6r=whatever[z5r,z6']=whatever[z4r,z3r];
x4'=x2r; z4'=whatever[z3l,z4l];
serifs_tl(3l); serifs_tr(3r); serifs_br(5r); serifs_bl(5l);
z4r'=z4r+.5u*down; z4r''=z4r+(u,0) rotated (angle(z3r-z4r));
z6l'=z6l+(-u,0) rotated (angle(z3r-z4r));
z6l''=z6l+(u,0) rotated (angle(z5l-z6l));
z6r'=z6r+(u,0) rotated (angle(z5r-z6r)); 
z6r''=(z6r+(u,0) rotated (angle(z3r-z4r))) 
                 shifted ((hair-currentbreadth)*unitvector(z3r-z4r) rotated -90);
z2'=z4'+(1.5u,0) rotated (angle(z3l-z4l)); z2''=z4'+(0,2u);
filldraw z1a{down}..{left}z1b..z1c{right}..z1+ser_boule*up..{right}z1d..
         z1e{left}..z1f---obl(4r,1f,4r'')..z4r''..z6l''---
	 obl(5l,6l'',5r){right}..z5r+.5ser_boule*up..{right}z5r.a..
	 {left}z5r.c..diag_serif(5r,6r)---z6r'..z6r''
	 if not bold_face: ---diag_serif(3r,4r) fi ..{dir0}z3r.c..z3r.a---z3l.a..z3l.c{dir0}..
	 diag_serif(3l,4l)---z2'..{up}z2''--z2r
	 ..{(x1a-x1r,-.25serif_drop)}z2a&z2a---obl(2b,2a,1a)
	 ---cycle;
penlabels(1,2,3,4,5,6); labels(2',2'',4',4r',4r'',6l',6l'',6r',6r'');
);

iff known chars.latin_k:
bskchar "The letter k";
beginchar(chars.latin_k,10.5u#,asc_height#,0); uni "0x006B";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_kcaron:
bskchar "The letter k with caron";
beginchar(chars.latin_kcaron,10.5u#,asc_height#,0); uni "0x01E9";
italcorr asc_height#*slant-.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x100=x1r+u; x102-x100=4.5u; y100=h+hair; y101l=1/4[x_height,y100]+hair;
hacek(100,101,102);
endchar;

iff known chars.latin_kcedilla:
bskchar "The letter k with cedilla (treated as comma)";
beginchar(chars.latin_kcedilla,10.5u#,asc_height#,.75comma_depth#); uni "0x0137";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
lft x100=.5w; top y100''r=-o;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_k_BB:
bskchar "The blackboard-bold letter k";
beginchar(chars.latin_k_BB,11u#,asc_height#,0); uni "0x1D55C";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
pos3(whatever,0); pos5(whatever,0);
bot y1=0; top y2=h; lft x1l=2u;
rt x3r=w-3u; top y3=x_height; rt x5r=w-2u; bot y5r=0;
{{save stem; numeric stem; stem:=.8cap_stem;
lowercase_points(1,2,jut);
y4r=.45x_height; x4r=x2r; z4l=z4r+(hair-tiny,0) rotated (angle(z3r-z4r)+90);
z3l=z4l+whatever*(z3r-z4r);
x6l=x4r+hair+.75u; z6l=whatever[z4r,z3r]; 
z6'=z6l+(stem-tiny,0) rotated (angle(z5r-z6l)+90);
}};
z5l=z6l+whatever*(z5r-z6'); z6r=whatever[z5r,z6']=whatever[z4r,z3r];
x4'=x2r; z4'=whatever[z3l,z4l];
serifs_tl(3l); serifs_tr(3r); serifs_br(5r); serifs_bl(5l);
z4r'=z4r+.5u*down; z4r''=z4r+(u,0) rotated (angle(z3r-z4r));
z6l'=z6l+(-u,0) rotated (angle(z3r-z4r));
z6l''=z6l+(u,0) rotated (angle(z5l-z6l));
z6r'=z6r+(u,0) rotated (angle(z5r-z6r)); 
z6r''=(z6r+(u,0) rotated (angle(z3r-z4r))) 
                 shifted ((hair-currentbreadth)*unitvector(z3r-z4r) rotated -90);
z2'=z4'+(1.5u,0) rotated (angle(z3l-z4l)); z2''=z4'+(0,2u);
filldraw z1a{down}..{left}z1b..z1c{right}..z1+ser_boule*up..{right}z1d..
         z1e{left}..z1f---obl(4r,1f,4r'')..z4r''..z6l''---
	 obl(5l,6l'',5r){right}..z5r+.5ser_boule*up..{right}z5r.a..
	 {left}z5r.c..diag_serif(5r,6r)---z6r'..z6r''
	 if not bold_face: ---diag_serif(3r,4r) fi ..{dir0}z3r.c..z3r.a---z3l.a..z3l.c{dir0}..
	 diag_serif(3l,4l)---z2'..{up}z2''--z2r
	 ..{(x1a-x1r,-.25serif_drop)}z2a&z2a---obl(2b,2a,1a)
	 ---cycle;
oblu.more:=1.25oblu;
bot z100=(x1l,y1b); bot y101=y5r.c; rt z101=whatever[z5r,z6r];
infill ifobl(2r,2b,1r,1l,more,)---obl(100,2b,1b)...z1l---obl(1r,1l,2r)---cycle;
infill ifobl(6r,6l,5r,5l,,)---obl(5l,6l,5r)...{right}z5r...obl(101,5r.c,6r)---cycle;
penlabels(1,2,3,4,5,6); labels(2',2'',4',4r',4r'',6l',6l'',6r',6r'');
endchar;

iff known chars.latin_k_SS:
bskchar "The sans-serif letter k";
beginchar(chars.latin_k_SS,10.5u#,asc_height#,0); uni "0x1D5C4";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
pos3(whatever,0); pos5(whatever,0);
bot y1=0; top y2=h; lft x1l=2u;
rt x3r=w-3u; top y3=x_height; rt x5r=w-2u; bot y5r=0;
lowercase_points(1,2,jut);
y4r=.45x_height; x4r=x2r; z4l=z4r+(hair-tiny,0) rotated (angle(z3r-z4r)+90);
z3l=z4l+whatever*(z3r-z4r);
x6l=x4r+hair+.75u; z6l=whatever[z4r,z3r]; 
z6'=z6l+(stem-tiny,0) rotated (angle(z5r-z6l)+90);
z5l=z6l+whatever*(z5r-z6'); z6r=whatever[z5r,z6']=whatever[z4r,z3r];
x4'=x2r; z4'=whatever[z3l,z4l];
serifs_tl(3l); serifs_tr(3r); serifs_br(5r); serifs_bl(5l);
z4r'=z4r+.5u*down; z4r''=z4r+(u,0) rotated (angle(z3r-z4r));
z6l'=z6l+(-u,0) rotated (angle(z3r-z4r));
z6l''=z6l+(u,0) rotated (angle(z5l-z6l));
z6r'=z6r+(u,0) rotated (angle(z5r-z6r)); 
z6r''=(z6r+(u,0) rotated (angle(z3r-z4r))) 
                 shifted ((hair-currentbreadth)*unitvector(z3r-z4r) rotated -90);
z2'=z4'+(1.5u,0) rotated (angle(z3l-z4l)); z2''=z4'+(0,2u);
y100=y6r''; z100=whatever[z3r,z4r];
filldraw z1a..z1..z1f---obl(4r,1f,4r'')..z4r''..z6l''---
	 obl(5l,6l'',5r){right}..diag_serif(5r,6r)---z6r'..z100
	 ---z3r..z3l---z2'..{up}z2''---z2r..z2b---cycle;
penlabels(1,2,3,4,5,6); labels(2',2'',4',4r',4r'',6l',6l'',6r',6r'',100);
endchar;

iff known chars.latin_kra:
bskchar "The letter kra";
beginchar(chars.latin_kra,11.5u#,x_height#,0); uni "0x0138";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
oblu:=2oblu;
pos1(stem,0); pos2(stem,0);
pos3(whatever,0); pos5(whatever,0);
bot y1=0; top y2=h; lft x1l=lft x2l=2u;
rt x3r=w-3u; top y3=h; rt x5r=w-2u; bot y5r=0;
y4r=.45h; x4r=x2r; z4l=z4r+(hair-tiny,0) rotated (angle(z3r-z4r)+90);
z3l=z4l+whatever*(z3r-z4r);
x6l=x4r+hair+.5u; z6l=whatever[z4r,z3r]; z6'=z6l+(stem-tiny,0) rotated (angle(z5r-z6l)+90);
z5l=z6l+whatever*(z5r-z6'); z6r=whatever[z5r,z6']=whatever[z4r,z3r];
x4'=x2r; z4'=whatever[z3l,z4l];
serif_bot(1); drop_serif(2,jut).alt;
serif_bot(5);
serifs_tl(3l); serifs_tr(3r); 
z4r'=z4r+.5u*down; z4r''=z4r+(u,0) rotated (angle(z3r-z4r));
z6l'=z6l+(-u,0) rotated (angle(z3r-z4r));
z6l''=z6l+(u,0) rotated (angle(z5l-z6l));
z6r'=z6r+(u,0) rotated (angle(z5r-z6r)); z6r''=z6r+(u,0) rotated (angle(z3r-z4r));
x2'=x1r; z2'=whatever[z3l,z4l]; z2''=z4'+(0,2u);
z5l.b=z5a; z5r.b=z5f;
filldraw z1a{down}..{left}z1b..z1c---z1d..z1e{left}..z1f---z4r..z4r'' if x6l'>x4r'': ..z6l' fi
         ..z6l''---diag_serif(5l,6l)..{left}z5b..z5c---z5d..{left}z5e..diag_serif(5r,6r)---z6r'
	 ..z6r''--- diag_serif(3r,4r)..{dir0}z3r.c..z3r.a---z3l.a..  z3l.c{dir0}..diag_serif(3l,4l)
	 ---obl(2',3l,2'')---z2''--z2r..{(x1a-x1r,-.25serif_drop)}z2a&z2a---obl(2b,2a,1a)---cycle;
penlabels(1,2,3,4,5,6); labels(2',2'',4',4r',4r'',6l',6l'',6r',6r'');
endchar;

charscription(6u,asc_height,0)(
x1=.5w; bot y1=0; top y2=h;
lowercase_stem(1,2,jut);
);

iff known chars.latin_l:
bskchar "The letter l";
beginchar(chars.latin_l,6u#, asc_height#, 0); uni "0x006C";
italcorr asc_height#*slant-1.75u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_lacute:
bskchar "The letter l with acute";
beginchar(chars.latin_lacute,6u#, asc_height#+.3x_height#, 0); uni "0x013A";
italcorr asc_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=.5[x2a,x2l]; x100r=w-u; y101=asc_height+.75u;
acute(100,101).capital;
endchar;

iff known chars.latin_lcaron:
bskchar "The letter l with caron (treated like comma)";
beginchar(chars.latin_lcaron,6u#, asc_height#, 0); uni "0x013E";
italcorr asc_height#*slant+u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
y100''r=h; x100'''=w;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_ldot:
bskchar "The letter l with middle dot";
beginchar(chars.latin_l,6u#+dot_size#,asc_height#,0); uni "0x0140";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
top y100=x_height; x100+.5dot_size=w-u;
dot(100);
endchar;

iff known chars.latin_lcedilla:
bskchar "The letter l with cedilla (treated as comma)";
beginchar(chars.latin_lcedilla,6u#,asc_height#,.75comma_depth#); uni "0x013C";
italcorr asc_height#*slant-1.75u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x100=.5w; top y100''r=-o;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_ldotabove:
bskchar "The letter l with dot above";
beginchar(chars.latin_ldotabove,6u#,Acc_height#+o#,0); uni "non";
italcorr asc_height#*slant-1.25u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x100=x1;
dotabove(100);
endchar;

iff known chars.latin_l_BB:
bskchar "The blackboard-bold letter l";
beginchar(chars.latin_l_BB,6u#, asc_height#, 0); uni "0x1D55D";
italcorr asc_height#*slant-1.75u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
save stem; stem:=.8cap_stem;
x1=.5w; bot y1=0; top y2=h;
lowercase_stem(1,2,jut);
oblu.more:=1.25oblu;
bot z100=(x1l,y1b);
infill ifobl(2r,2b,1r,1l,more,)---obl(100,2b,1b)...z1l---obl(1r,1l,2r)---cycle;
endchar;

iff known chars.latin_l_SS:
bskchar "The sans-serif letter l";
beginchar(chars.latin_l_SS,6u#, asc_height#, 0); uni "0x1D5C5";
italcorr asc_height#*slant-1.75u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
pos3(hair,60);
x1=.5w; bot y1=0; top y2=h;
lowercase_points(1,2,jut);
x3=.5[x1,x1e]; bot y3l=-o;
filldraw z1f---z2r..z2b---z1a...{right}z3l..{left}z3r...cycle;
penlabels(3);
endchar;

iff known chars.latin_lslash:
bskchar "The letter l with slash";
beginchar(chars.latin_lslash,6u#,asc_height#,0); uni "0x0142";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric theta;
x1=.5w; bot y1=0; top y2=h;
lowercase_points(1,2,jut);
x4-x3=4u; .5[x3,x4]=x1; y4-y3=stem; .5[y3,y4]=.8[bar_height,x_height];
theta=angle(z4-z3)+90;
pos3(bar,theta);  pos4(bar,theta);
x3'l=x3'r=x1l; x4'l=x4'r=x1r; 
z3'l=whatever[z3l,z4l]; z4'l=whatever[z3l,z4l];
z3'r=whatever[z3r,z4r]; z4'r=whatever[z3r,z4r];
bskpoints(3,4,bar,bar);
filldraw z2r..{(x1a-x1r,-.25serif_drop)}z2a&z2a---obl(2b,2a,1a)---obl(3'r,2l,3r)
         ---z3rr..z3l---obl(3'l,3l,1l)---z1a..z1b{left}..{right}z1c..z1+ser_boule*up
	 ..z1d{right}..{left}z1e..{up}z1f---obl(4'l,1r,4l)---z4ll..z4r
	 ---obl(4'r,4r,2r)---z2r..cycle;
penlabels(1,2,3,3',4,4'); labels(3rr,4ll);
endchar;

iff known chars.latin_m:
bskchar "The letter m";
beginchar(chars.latin_m,16u#, x_height#, 0); uni "0x006D";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; boolean correct; correct:=true;
oblu:=6oblu;
pos3(stem,0); pos4(stem,0); pos5(n_str_hair,90); pos6(hair,180);
pos7(stem,0); pos8(stem,0); pos9(n_str_hair,90); pos10(hair,180);
lft x1l=2u; bot y1=0; top y2=h+apex_o;
x3=.5w; bot y3=bot y7=0; x4=x3; y4=y8=.75x_height; y5r=y9r=x_height; x5=.5[x3l,x1r];
x6l=x1r; y6=y10=if monospace: .75 else: .6 fi\\ x_height; x10l=x3r;
rt x7r=w-2u; x8=x7; x9=.5[x7l,x3r]; 
{{ if monospace and (x3l-x1l-stem-tiny<2jut): correct:=false; save jut; numeric jut; jut:=.4(x3l-x1l-stem-.5tiny); fi
serif_bot(3); serif_bot(7); lowercase_points(1,2,jut);}};
p1:=z6l{up}..z5l..z4l---z3a if correct:.. else: -- fi z3b{left}..{right}z3c;
p2:=z3d{right}..{left}z3e if correct:..{up} else: -- fi z3f---z10l..z9l..
    z8l---z7a if correct:.. else: -- fi z7b{left}..z7c{right}..
    z7+ser_boule*up..{right}z7d..{left}z7e
    if correct:.. else: -- fi z7f---z8r..z9r..{down}z10r;
p21:=subpath(6,infinity) of p2;
p3:=z4r{up}..z5r..{down}z6r;
p4:=z1f--z2r;
tim3=xpart(p3 intersectiontimes p4);
z1'=(p3 intersectionpoint p4)+(like_stem+tiny)*up; if y1'>y5l: y1':=y5l; fi
z0=(x4r,y1');
tim1=xpart(p21 intersectiontimes ((0,y0-.5hair)--(x9,y0-.5hair)));
tim2=xpart(p3 intersectiontimes (z0--(x5,y0)));
filldraw p1..z3+ser_boule*up..subpath (0,6) of p2 .. subpath(0,rundy(p21,(tim1,1.5u)).zpet) of p21
         ..subpath(tim2,rundy(p3,(tim3,if bold_face: 4f_obl else: if (substring(0,5) of font_identifier_) = "BSKRW": f_obl else: oblu fi fi)).zpet) of p3
	 ..broken_stem_draw(1',1,2)---cycle;
penlabels(3,4,5,6,7,8,9,10); labels(0,1');
endchar;

iff known chars.latin_m_BB:
bskchar "The blackboard-bold letter m";
beginchar(chars.latin_m_BB,16u#, x_height#, 0); uni "0x1D55E";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; boolean correct; correct:=true;
save stem; stem:=.8cap_stem;
oblu:=6oblu;
pos3(stem,0); pos4(stem,0); pos5(n_str_hair,90); pos6(hair,180);
pos7(stem,0); pos8(stem,0); pos9(n_str_hair,90); pos10(hair,180);
lft x1l=2u; bot y1=0; top y2=h+apex_o;
x3=.5w; bot y3=bot y7=0; x4=x3; y4=y8=.75x_height; y5r=y9r=x_height; x5=.5[x3l,x1r];
x6l=x1r; y6=y10=if monospace: .75 else: .6 fi\\ x_height; x10l=x3r;
rt x7r=w-2u; x8=x7; x9=.5[x7l,x3r]; 
{{ if monospace and (x3l-x1l-stem-tiny<2jut): correct:=false; save jut; numeric jut; jut:=.4(x3l-x1l-stem-.5tiny); fi
serif_bot(3); serif_bot(7); lowercase_points(1,2,jut);}};
p1:=z6l{up}..z5l..z4l---z3a if correct:.. else: -- fi z3b{left}..{right}z3c;
p2:=z3d{right}..{left}z3e if correct:..{up} else: -- fi z3f---z10l..z9l..
    z8l---z7a if correct:.. else: -- fi z7b{left}..z7c{right}..
    z7+ser_boule*up..{right}z7d..{left}z7e
    if correct:.. else: -- fi z7f---z8r..z9r..{down}z10r;
p21:=subpath(6,infinity) of p2;
p3:=z4r{up}..z5r..{down}z6r;
p4:=z1f--z2r;
tim3=xpart(p3 intersectiontimes p4);
z1'=(p3 intersectionpoint p4)+(like_stem+tiny)*up; if y1'>y5l: y1':=y5l; fi
z0=(x4r,y1');
tim1=xpart(p21 intersectiontimes ((0,y0-.5hair)--(x9,y0-.5hair)));
tim2=xpart(p3 intersectiontimes (z0--(x5,y0)));
filldraw p1..z3+ser_boule*up..subpath (0,6) of p2 .. subpath(0,rundy(p21,(tim1,1.5u)).zpet) of p21
         ..subpath(tim2,rundy(p3,(tim3,if bold_face: 4f_obl else: if (substring(0,5) of font_identifier_) = "BSKRW": f_obl else: oblu fi fi)).zpet) of p3
	 ..broken_stem_draw(1',1,2)---cycle;
oblu:=f_obl; oblu.more:=1.25oblu;
bot z100=(x1l,y1b); bot z103=(x3r,y3e); bot z104=(x7r,y7e);
p100=subpath(0,1) of p3;
p101=subpath(1,2) of p1;
p102=z8r{up}..z9r..{down}z10r;
p103=z10l{up}..z9l..{down}z8l;
z101=bsktouch(p100,down,p101,up);
z102=bsktouch(p102,down,p103,up);
tim100=xpart(p100 intersectiontimes (z101--(x101,h+o+5)));
tim101=xpart(p101 intersectiontimes (z101--(x101,0)));
tim102=xpart(p102 intersectiontimes (z102--(x102,h+o+5)));
tim103=xpart(p103 intersectiontimes (z102--(x102,0)));
infill ifobl(2r,2b,1r,1l,more,)---obl(100,2b,1b)...z1l---obl(1r,1l,2r)---cycle;
infill subpath(0,rundy(p100,(tim100,bbw)).zpet) of p100
       ..subpath(rundy(p101,(tim101,bbw)),infinity) of p101
       ---obl(3l,4l,3r)---z3r...obl(103,3e,4r)---cycle;
infill subpath(0,rundy(p102,(tim102,bbw)).zpet) of p102
       ..subpath(rundy(p103,(tim103,bbw)),infinity) of p103
       ---obl(7l,8l,7r)---z7r...obl(104,7e,8r)---cycle;
penlabels(3,4,5,6,7,8,9,10); labels(0,1',100,101,102,103,104);
endchar;

iff known chars.latin_m_SS:
bskchar "The sans-serif letter m";
beginchar(chars.latin_m_SS,16u#, x_height#, 0); uni "0x1D5C6";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; boolean correct; correct:=true;
oblu:=6oblu;
pos3(stem,0); pos4(stem,0); pos5(n_str_hair,90); pos6(hair,180);
pos7(stem,0); pos8(stem,0); pos9(n_str_hair,90); pos10(hair,180);
lft x1l=2u; bot y1=0; top y2=h+apex_o;
x3=.5w; bot y3=bot y7=0; x4=x3; y4=y8=.75x_height; y5r=y9r=x_height; x5=.5[x3l,x1r];
x6l=x1r; y6=y10=if monospace: .75 else: .6 fi\\ x_height; x10l=x3r;
rt x7r=w-2u; x8=x7; x9=.5[x7l,x3r]; 
{{ if monospace and (x3l-x1l-stem-tiny<2jut): correct:=false; save jut; numeric jut; jut:=.4(x3l-x1l-stem-.5tiny); fi
serif_bot(3); serif_bot(7); lowercase_points(1,2,jut);}};
p1:=z6l{up}..z5l..z4l---z3a..{right}z3;
p2:=z3{right}..z3f---z10l..z9l..z8l---z7a..z7..z7f---z8r..z9r..{down}z10r;
p21:=subpath(6,infinity) of p2;
p3:=z4r{up}..z5r..{down}z6r;
p4:=z1f--z2r;
tim3=xpart(p3 intersectiontimes p4);
z1'=(p3 intersectionpoint p4)+(like_stem+tiny)*up; if y1'>y5l: y1':=y5l; fi
z0=(x4r,y1');
tim1=xpart(p21 intersectiontimes ((0,y0-.5hair)--(x9,y0-.5hair)));
tim2=xpart(p3 intersectiontimes (z0--(x5,y0)));
filldraw p1..z3+ser_boule*up..subpath (0,6) of p2
         ..subpath(0,rundy(p21,(tim1,1.5u)).zpet) of p21
         ..subpath(tim2,rundy(p3,tim3).zpet) of p3
	 ..z1'..z2..z2b---z1a..z1..z1f---cycle;
penlabels(3,4,5,6,7,8,9,10); labels(0,1');
endchar;

charscription(11.5u,x_height,0)(
path p[]; numeric tim[]; oblu:=8oblu;
pos3(stem,0); pos4(stem,0); pos5(n_str_hair,90); pos6(hair,180);
lft x1l=2u; bot y1=0; top y2=h+apex_o;
rt x3r=w-2u; bot y3=0; serif_bot(3);
x4=x3; y4=.75x_height; y5r=x_height; x5=.5[x3l,x1r];
x6l=x1r; y6=.6x_height; y6l:=y6l-hair;
lowercase_points(1,2,jut);
p1:=z6l{up}..z5l..z4l---z3a..z3b{left}..{right}z3c;
p2:=z3d{right}..{left}z3e..z3f---z4r..z5r..{down}z6r;
p3:=z1f--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+tiny)*up; if y1'>y5l: y1':=y5l; fi
filldraw p1..z3+ser_boule*up..subpath (0,rundy(p2,(tim1,2u)).zpet) of p2..broken_stem_draw(1',1,2)---cycle;
penlabels(3,4,5,6); labels(1');
);

iff known chars.latin_n:
bskchar "The letter n";
beginchar(chars.latin_n,11.5u#, x_height#, 0); uni "0x006E";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_ncaron:
bskchar "The letter n with caron";
beginchar(chars.latin_ncaron,11.5u#, asc_height#, 0); uni "0x0148";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x5;
hacek(100,101,102);
endchar;

iff known chars.latin_nacute:
bskchar "The letter n with acute";
beginchar(chars.latin_nacute,11.5u#,asc_height#,0); uni "0x0144";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=.5[x5,x2r];
acute(100,101);
endchar;

iff known chars.latin_napostrophe:
bskchar "The letter n with apostrophe";
beginchar(chars.latin_napostrophe,11.5u#,asc_height#+o#,0); uni "0x0149";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
lft x100=.5u; top y100=h-.5dot_size;
comma(100,dot_size,.9hair,.8comma_depth);
endchar;

iff known chars.latin_ngrave:
bskchar "The letter n with grave";
beginchar(chars.latin_ngrave,11.5u#,asc_height#,0); uni "0x01F9";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x5;
grave(100,101);
endchar;

iff known chars.latin_ntilde:
bskchar "The letter n with tilde";
beginchar(chars.latin_ntilde,11.5u#,asc_height#,0); uni "0x00F1";
italcorr asc_height#*slant-1.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101-x100=6u; x.tilde=.5[x1r,x4l];
tilde(100,101);
endchar;

iff known chars.latin_ncedilla:
bskchar "The letter n with cedilla (treated as comma)";
beginchar(chars.latin_ncedilla,11.5u#,x_height#,.75comma_depth#); uni "0x0146";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x100=.5w; top y100''r=-o;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_n_BB:
bskchar "The blackboard-bold letter n";
beginchar(chars.latin_n_BB,11.5u#, x_height#, 0); uni "0x1D55F";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=8oblu;
save stem; stem:=.8cap_stem;
pos3(stem,0); pos4(stem,0); pos5(n_str_hair,90); pos6(hair,180);
lft x1l=2u; bot y1=0; top y2=h+apex_o;
rt x3r=w-2u; bot y3=0; serif_bot(3);
x4=x3; y4=.75x_height; y5r=x_height; x5=.5[x3l,x1r];
x6l=x1r; y6=.6x_height; y6l:=y6l-hair;
lowercase_points(1,2,jut);
p1:=z6l{up}..z5l..z4l---z3a..z3b{left}..{right}z3c;
p2:=z3d{right}..{left}z3e..z3f---z4r..z5r..{down}z6r;
p3:=z1f--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+tiny)*up; if y1'>y5l: y1':=y5l; fi
filldraw p1..z3+ser_boule*up..subpath (0,rundy(p2,(tim1,2u)).zpet) of p2..broken_stem_draw(1',1,2)---cycle;
oblu:=f_obl; oblu.more:=1.25oblu;
bot z100=(x1l,y1b); bot z103=(x3r,y3e);
p100=subpath(3,4) of p2;
p101=subpath(1,2) of p1;
z101=bsktouch(p100,down,p101,up);
tim100=xpart(p100 intersectiontimes (z101--(x101,h+o+5)));
tim101=xpart(p101 intersectiontimes (z101--(x101,0)));
infill ifobl(2r,2b,1r,1l,more,)---obl(100,2b,1b)...z1l---obl(1r,1l,2r)---cycle;
infill subpath(0,rundy(p100,(tim100,bbw)).zpet) of p100
       ..subpath(rundy(p101,(tim101,bbw)),infinity) of p101
       ---obl(3l,4l,3r)---z3r...obl(103,3e,4r)---cycle;
penlabels(3,4,5,6); labels(1',100,101,102);
endchar;

iff known chars.latin_n_SS:
bskchar "The sans-serif letter n";
beginchar(chars.latin_n_SS,11.5u#, x_height#, 0); uni "0x1D5C7";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=8oblu;
pos3(stem,0); pos4(stem,0); pos5(n_str_hair,90); pos6(hair,180);
lft x1l=2u; bot y1=0; top y2=h+apex_o;
rt x3r=w-2u; bot y3=0; serif_bot(3);
x4=x3; y4=.75x_height; y5r=x_height; x5=.5[x3l,x1r];
x6l=x1r; y6=.6x_height; y6l:=y6l-hair;
lowercase_points(1,2,jut);
p1:=z6l{up}..z5l..z4l---z3a..{right}z3;
p2:=z3{right}..z3f---z4r..z5r..{down}z6r;
p3:=z1f--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+tiny)*up; if y1'>y5l: y1':=y5l; fi
filldraw p1..z3+ser_boule*up..subpath (0,rundy(p2,(tim1,2u)).zpet) of p2..z1'..z2..z2b---z1a..z1..z1f---cycle;
penlabels(3,4,5,6); labels(1');
endchar;

iff known chars.latin_eng:
bskchar "The letter eng";
beginchar(chars.latin_eng,10.5u#, x_height#, desc_depth#); uni "0x014B";
italcorr .5[bar_height#,x_height#]*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=8oblu;
pos3(stem,0); pos4(stem,0); pos5(n_str_hair,90); pos6(hair,180);
pos7(hair,-90);
lft x1l=2u; bot y1=0; top y2=h+apex_o;
rt x3r=w-u; y3=-.5d; 
x4=x3; y4=.75x_height; y5r=x_height; x5=.5[x3l,x1r];
x6l=x1r; y6=.6x_height; y6l:=y6l-hair;
bot y7r=-d; x3-x7=3u; top y8=y7+like_curve; x7-x8l=2u;
lowercase_points(1,2,jut);
p1:=z6l{up}..z5l..z4l---z3l...{left}z7l..reverse smitko(8,stem)..{right}z7r..{up}z3r;
p2:=z3r---z4r..z5r..{down}z6r;
p3:=z1f--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+tiny)*up; if y1'>y5l: y1':=y5l; fi
filldraw p1..subpath (0,rundy(p2,(tim1,2u)).zpet) of p2..broken_stem_draw(1',1,2)---cycle;
penlabels(3,4,5,6,7,8); labels(1');
endchar;

charscription(10u,x_height,0)(
pos1(curve,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
lft x1l=u; rt x3l=w-u; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; x2=x4; bot y2l=-o; top y4l=h+o; x4r:=x4r+.25u; x2r:=x2r-.25u;
filldraw z1l{down}..z2l..{up}z3l..z4l..{down}cycle;
infill z1r{up}..z4r..{down}z3r..z2r..{up}cycle;
penlabels(1,2,3,4);
);

iff known chars.latin_o:
bskchar "The letter o";
beginchar(chars.latin_o,10u#,x_height#,0); uni "0x006F";
italcorr .5x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_oacute:
bskchar "The letter o with acute";
beginchar(chars.latin_oacute,10u#,asc_height#,0); uni "0x00F3";
italcorr asc_height#*slant-1.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4l;
acute(100,101);
endchar;

iff known chars.latin_oumlaut:
bskchar "The letter o with umlaut";
beginchar(chars.latin_oumlaut,10u#,asc_height#-dot_size#,0); uni "0x00F6";
italcorr .5x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
.5[x100,x101]=x4l; x101-x100=2/3(x3-x1);
umlaut(100,101);
endchar;

iff known chars.latin_ocircumflex:
bskchar "The letter o with circumflex";
beginchar(chars.latin_ocircumflex,10u#,asc_height#-.1x_height#,0); uni "0x00F4";
italcorr .5[x_height#,asc_height#]*slant-.75u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4r;
circumflex(100,101,102);
endchar;

iff known chars.latin_ograve:
bskchar "The letter o with grave";
beginchar(chars.latin_ograve,10u#,asc_height#,0); uni "0x00F2";
italcorr .5x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4+u;
grave(100,101);
endchar;

iff known chars.latin_odoublegrave:
bskchar "The letter o with double grave";
beginchar(chars.latin_odoublegrave,10u#,asc_height#,0); uni "0x020D";
italcorr .5x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x102-x100=3u; x102=x4;
d_grave(100,101,102,103,whatever);
endchar;

iff known chars.latin_ocaron:
bskchar "The letter o with caron";
beginchar(chars.latin_ocaron,10u#,asc_height#,0); uni "0x01D2";
italcorr asc_height#*slant-1.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4r; 
hacek(100,101,102);
endchar;

iff known chars.latin_otilde:
bskchar "The letter o with tilde";
beginchar(chars.latin_otilde,10u#,asc_height#,0); uni "0x00F5";
italcorr asc_height#*slant-u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101-x100=6u;
tilde(100,101);
endchar;

iff known chars.latin_omacron:
bskchar "The letter o with macron";
beginchar(chars.latin_omacron,10u#,.5[asc_height#,x_height#],0); uni "0x014D";
italcorr .5x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
macron(100,101);
endchar;

iff known chars.latin_odotabove:
bskchar "The letter o with dot above";
beginchar(chars.latin_odotabove,10u#,asc_height#-.5dot_size#,0); uni "0x022F";
italcorr .5x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x4;
dotabove(100);
endchar;

iff known chars.latin_ohumlaut:
bskchar "The letter o with Hungarian umlaut";
beginchar(chars.latin_ohumlaut,10u#,asc_height#,0); uni "0x0151";
italcorr asc_height#*slant-.5u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101-x100=3u; .5[x100,x101]=x4+1.75u;
h_umlaut(100,101,102,103,2u);
endchar;

iff known chars.latin_obreve:
bskchar "The letter o with breve";
beginchar(chars.latin_obreve,10u#,asc_height#+o#,0); uni "0x014F";
italcorr asc_height#*slant-1.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4r; x102-x100=5u;
breve(100,101,102);
endchar;

iff known chars.latin_oinvbreve:
bskchar "The letter o with inverted breve";
beginchar(chars.latin_oinvbreve,10u#,asc_height#+o#,0); uni "0x020F";
italcorr .5x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4r; x102-x100=5u;
tieacc(100,101,102);
endchar;

iff known chars.latin_o_masculine:
bskchar "Masculine ordinal indicator (superscript o)";
beginchar(chars.latin_o_masculine,6u#,asc_height#-.5x_height#,0); uni "0x00BA";
italcorr (asc_height#-.75x_height#)*slant-.5u#;
adjust_fit(0,0);
pickup tiny.nib;
multiply(.85)(curve,hair,vair);
usechar shifted (-x1l,-y4l) scaled .5 shifted (u+(HH-.5x_height)*slant,HH);
endchar;

iff known chars.latin_o_BB:
bskchar "The blackboard-bold letter o";
beginchar(chars.latin_o_BB,10u#,x_height#,0); uni "0x1D560";
italcorr .5x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
pos1(cap_stem,0); pos2(hair,90); pos3(cap_stem,180); pos4(hair,270);
lft x1l=u; rt x3l=w-u; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; x2=x4; bot y2l=-o; top y4l=h+o; x4r:=x4r+.25u; x2r:=x2r-.25u;
filldraw z1l{down}..z2l..{up}z3l..z4l..{down}cycle;
infill z1r{up}..z4r..{down}z3r..z2r..{up}cycle;
penlabels(1,2,3,4);
path p[]; numeric tim[];
p100:=z4r..z1r{down}..z2r..z3r..cycle;
p101:=reverse z4l..z1l{down}..z2l..z3l..cycle;
oblu:=1.25bbw;
z100=bsktouch(subpath(0,1) of p100,up,p101,down);
z101=bsktouch(subpath(1,2) of p100,down,p101,up);
z102=bsktouch(subpath(3,4) of p100,up,p101,down);
z103=bsktouch(subpath(2,3) of p100,down,p101,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y1)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y4l+5)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y1)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y2l-5)));
tim104=xpart(p100 intersectiontimes (z102--(x102,y1)));
tim105=xpart(p101 intersectiontimes (z102--(x102,y4l+5)));
tim106=xpart(p100 intersectiontimes (z103--(x103,y1)));
tim107=xpart(p101 intersectiontimes (z103--(x103,y2l-5)));
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103).zpet,rundy(p101,tim101)) of p101..cycle;
infill subpath(rundy(p100,tim104).zpet,rundy(p100,tim106)) of p100
       ..subpath(rundy(p101,tim107),rundy(p101,tim105).zpet) of p101..cycle;
labels(100,101,102,103);
endchar;

iff known chars.latin_o_SS:
bskchar "The sans-serif letter o";
beginchar(chars.latin_o_SS,10u#,x_height#,0); uni "0x1D5C8";
italcorr .5x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

charscription(10u,x_height,.85desc_depth)(
path p[];
pos1(curve,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
pos5(stem,0); pos6(curve,0); pos7(hair,45); pos8(hair,160);
lft x1l=u; rt x3l=w-u; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; x2=x4; bot y2l=-o; top y4l=h+o; x4r:=x4r+.25u; x2r:=x2r-.25u;
x5=x6l+1.5u; x5=x2; x7-x6l=3u; rt x8l=x7+1.5u;
bot y5=0; y6=-.5d; bot y7l=-d; y8=-2/3d;
p0=z1l{down}..z2l..{up}z3l..z4l..{down}z1l;
p1=z5l{z6l-z5r}..z6l...z7l..{z5-z6}z8l..z8r{z6-z5}..z7r..z6r..z5r;
filldraw subpath(0,rundy(p0,(1,stem)).zpet) of p0
         ..subpath(rundy(p1,(0,stem)),rundy(p1,infinity).zpet) of p1
	 ..subpath(rundy(p1,(1,stem)),infinity) of p0..cycle;
infill z1r{up}..z4r..{down}z3r..z2r..{up}cycle;
penlabels(1,2,3,4,5,6,7,8);
);

iff known chars.latin_oogonek:
bskchar "The letter o with ogonek";
beginchar(chars.latin_oogonek,10u#,x_height#,.85desc_depth#); uni "0x01EB";
italcorr .5x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_oogonekmacron:
bskchar "The letter o with ogonek and macron";
beginchar(chars.latin_oogonekmacron,10u#,.5[asc_height#,x_height#],.85desc_depth#); uni "0x01ED";
italcorr .5x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
macron(100,101);
endchar;

charscription(10u,x_height,0)(
numeric tim[]; path p[];
oblu:=2oblu;
pos1(curve,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
lft x1l=u; rt x3l=w-u; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; x2=x4; bot y2l=-o; top y4l=h+o; x4r:=x4r+.25u; x2r:=x2r-.25u;
z5=(w-u,h); z6=(u,0); pos5(hair, angle(z6-z5)+90); pos6(hair,angle(z6-z5)+90);
z0r=.5[z5r,z6r]; z0l=.5[z5l,z6l];
p0:=z1l{down}..z2l..z3l..z4l..{down}z1l;
p1:=z1r{up}..z4r..z3r..z2r..{up}z1r;
bskpoints(5,6,hair,hair);
(tim1,tim2)=p0 intersectiontimes (z5l--z6l);
(tim3,tim4)=p0 intersectiontimes (z6r--z5r);
(tim5,tim6)=p0 intersectiontimes (z0r--z5r);
(tim7,tim8)=p0 intersectiontimes (z5l--z0l);
(tim11,tim12)=p1 intersectiontimes (z0r--z6r);
(tim13,tim14)=p1 intersectiontimes (z0r--z5r);
(tim15,tim16)=p1 intersectiontimes (z0l--z6l);
(tim17,tim18)=p1 intersectiontimes (z5l--z0l);
filldraw subpath (0,rundy(p0,tim1).zpet) of p0..subpath(rundy((z6l--z5l),tim2),infinity) of (z5l---z6ll)..
         subpath(0,rundy(z6r--z5r,tim4).zpet) of (z6r--z5r)..
	 subpath(rundy(p0,tim3),rundy(p0,tim5).zpet) of p0..
	 subpath(rundy(z0r--z5r,tim6),infinity) of (z0r---z5rr)..
	 subpath(0,rundy(z5l--z0l,tim8).zpet) of (z5l--z0l) ..
	 subpath(rundy(p0,tim7),infinity) of p0--cycle;
infill subpath(0,rundy(z0r--z6r,tim12).zpet) of (z0r--z6r)..
       subpath(rundy(p1,tim11).zpet,rundy(p1,tim13)) of p1..
       subpath(rundy(z5r--z0r,tim14),infinity) of (z5r--z0r)--cycle;
infill subpath (0, rundy(p1,tim17).zpet) of p1..
       subpath(rundy(z5l--z0l,tim18),infinity) of (z5l--z0l)..
       subpath(0,rundy(z0l--z6l,tim16).zpet) of (z0l--z6l)..
       subpath(rundy(p1,tim15),infinity) of p1--cycle;
penlabels(0,1,2,3,4,5,6);
);

iff known chars.latin_oslash:
bskchar "The letter o slash";
beginchar(chars.latin_oslash,10u#,x_height#,0); uni "0x00F8";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_oslashacute:
bskchar "The letter o slash with acute";
beginchar(chars.latin_oslashacute,10u#,asc_height#,0); uni "0x01FF";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x4l;
acute(100,101);
endchar;

iff known chars.latin_p:
bskchar "The letter p";
beginchar(chars.latin_p,11u#,x_height#,desc_depth#); uni "0x0070";
italcorr .5x_height#*slant-.25u#;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[];
pos1(hair,0); pos1'(hair,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
rt x1r=2u+stem; rt x3l=w-u; y1=.65x_height; y3=.5h; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x1'r=x1r; y1'=.2x_height;
if (y1'/hair)<2.5: x1'l:=x1'l-.5hair; fi;
bot y2l=-o; top y4l=h+o;
lft x5l=2u; bot y5=-d; top y6r=h+o; 
lowercase_points(5,6,jut);
p0=z1l---z1'l{z2r-z1r}..z2l..z3l..z4l..{down}z1l;
p1=z1r{up}..z4r..z3r..z2r..{up}z1'r--z1r;
p2=z5r---lowercase_stem_draw(5,6);
p3=z1r{up}..z4r..z3r..z2r..(z2r+hair*left)..{up}z1'r--z1r;
z0=bsktouch(subpath(1,infinity) of p0,left,subpath(0,1) of p2,right);
tim1=xpart(p0 intersectiontimes (z0--(x2,y0)));
tim2=xpart(p2 intersectiontimes (z0--(0,y0)));
z7=bsktouch(subpath(3,infinity) of p0,left,p2,right);
tim3-3=xpart(subpath(3,infinity) of p0 intersectiontimes (z7--(x4,y7)));
tim4=xpart(p2 intersectiontimes (z7--(0,y7)));
filldraw subpath (rundy(p0,tim1), rundy(p0,tim3).zpet) of p0
         ..subpath(rundy(p2,tim4),infinity) of p2
	 ..subpath(0,rundy(p2,tim2).zpet) of p2..cycle;
infill p3..cycle;
penlabels(1,1',2,3,4); labels(7);
endchar;

iff known chars.latin_p_BB:
bskchar "The blackboard-bold letter p";
beginchar(chars.latin_p_BB,11u#,x_height#,desc_depth#); uni "0x1D561";
italcorr .5x_height#*slant-.25u#;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[];
save stem; stem:=.8cap_stem;
pos1(hair,0); pos1'(hair,0); pos2(hair,90); pos3(cap_stem,180); pos4(hair,270);
rt x1r=2u+stem; rt x3l=w-u; y1=.65x_height; y3=.5h; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x1'r=x1r; y1'=.2x_height;
if (y1'/hair)<2.5: x1'l:=x1'l-.5hair; fi;
bot y2l=-o; top y4l=h+o;
lft x5l=2u; bot y5=-d; top y6r=h+o; 
lowercase_points(5,6,jut);
p0=z1l---z1'l{z2r-z1r}..z2l..z3l..z4l..{down}z1l;
p1=z1r{up}..z4r..z3r..z2r..{up}z1'r--z1r;
p2=z5r---lowercase_stem_draw(5,6);
p3=z1r{up}..z4r..z3r..z2r..(z2r+hair*left)..{up}z1'r--z1r;
z0=bsktouch(subpath(1,infinity) of p0,left,subpath(0,1) of p2,right);
tim1=xpart(p0 intersectiontimes (z0--(x2,y0)));
tim2=xpart(p2 intersectiontimes (z0--(0,y0)));
z7=bsktouch(subpath(3,infinity) of p0,left,p2,right);
tim3-3=xpart(subpath(3,infinity) of p0 intersectiontimes (z7--(x4,y7)));
tim4=xpart(p2 intersectiontimes (z7--(0,y7)));
filldraw subpath (rundy(p0,tim1), rundy(p0,tim3).zpet) of p0
         ..subpath(rundy(p2,tim4),infinity) of p2
	 ..subpath(0,rundy(p2,tim2).zpet) of p2..cycle;
infill p3..cycle;
oblu.more:=1.25oblu;
bot z102=(x5l,y5b);
infill ifobl(6r,6b,5r,5l,more,)---obl(102,6b,5b)...z5l---obl(5r,5l,6r)---cycle;
oblu:=bbw;
p100:=subpath(2,4) of p0;
p101:=subpath(1,3) of p3;
z100=bsktouch(p100,down,p101,up);
z101=bsktouch(p100,up,p101,down);
tim100=xpart(p100 intersectiontimes (z100--(x100,h+5)));
tim101=xpart(p101 intersectiontimes (z100--(x100,0)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y2l-5)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y3)));
infill subpath(rundy(p100,tim102),rundy(p100,tim100).zpet) of p100
       ..reverse subpath(rundy(p101,tim103).zpet,rundy(p101,tim101)) of p101..cycle;
penlabels(1,1',2,3,4); labels(7,100,101,102);
endchar;

iff known chars.latin_p_SS:
bskchar "The sans-serif letter p";
beginchar(chars.latin_p_SS,11u#,x_height#,desc_depth#); uni "0x1D5C9";
italcorr .5x_height#*slant-.25u#;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[];
pos1(hair,0); pos1'(hair,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
rt x1r=2u+stem; rt x3l=w-u; y1=.65x_height; y3=.5h; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x1'r=x1r; y1'=.2x_height;
if (y1'/hair)<2.5: x1'l:=x1'l-.5hair; fi;
bot y2l=-o; top y4l=h+o;
lft x5l=2u; bot y5=-d; top y6r=h+o; 
lowercase_points(5,6,jut);
p0=z1l---z1'l{z2r-z1r}..z2l..z3l..z4l..{down}z1l;
p1=z1r{up}..z4r..z3r..z2r..{up}z1'r--z1r;
p2=z5f---z6r..z6b---z5a..z5..{up}z5f;
p3=z1r{up}..z4r..z3r..z2r..(z2r+hair*left)..{up}z1'r--z1r;
z0=bsktouch(subpath(1,infinity) of p0,left,subpath(0,1) of p2,right);
tim1=xpart(p0 intersectiontimes (z0--(x2,y0)));
tim2=xpart(p2 intersectiontimes (z0--(0,y0)));
z7=bsktouch(subpath(3,infinity) of p0,left,p2,right);
tim3-3=xpart(subpath(3,infinity) of p0 intersectiontimes (z7--(x4,y7)));
tim4=xpart(p2 intersectiontimes (z7--(0,y7)));
filldraw subpath (rundy(p0,tim1), rundy(p0,tim3).zpet) of p0
         ..subpath(rundy(p2,tim4),infinity) of p2
	 ..{up}subpath(0,rundy(p2,tim2).zpet) of p2..cycle;
infill p3..cycle;
penlabels(1,1',2,3,4); labels(7);
endchar;

iff known chars.latin_thorn:
bskchar "The letter thorn";
beginchar(chars.latin_thorn,11u#,asc_height#,desc_depth#); uni "0x00FE";
italcorr .5x_height#*slant-.25u#;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[];
pos1(hair,0); pos1'(hair,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
rt x1r=2u+stem; rt x3l=w-u; y1=.65x_height; y3=.5x_height; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x1'r=x1r; y1'=.2x_height;
if (y1'/hair)<2.5: x1'l:=x1'l-.5hair; fi;
bot y2l=-o; top y4l=x_height+o;
lft x5l=2u; bot y5=-d; top y6r=h; 
lowercase_points(5,6,jut);
p0=z1l---z1'l{z2r-z1r}..z2l..z3l..z4l..{down}z1l;
p1=z1r{up}..z4r..z3r..z2r..{up}z1'r--z1r;
p2=z5r---lowercase_stem_draw(5,6);
p3=z1r{up}..z4r..z3r..z2r..(z2r+hair*left)..{up}z1'r--z1r;
z0=bsktouch(subpath(1,infinity) of p0,left,subpath(0,1) of p2,right);
tim1=xpart(p0 intersectiontimes (z0--(x2,y0)));
tim2=xpart(p2 intersectiontimes (z0--(0,y0)));
z7=bsktouch(subpath(3,infinity) of p0,left,p2,right);
tim3-3=xpart(subpath(3,infinity) of p0 intersectiontimes (z7--(x4,y7)));
tim4=xpart(p2 intersectiontimes (z7--(0,y7)));
filldraw subpath (rundy(p0,tim1), rundy(p0,(tim3,2oblu)).zpet) of p0
         ..subpath(rundy(p2,tim4),infinity) of p2
	 ..subpath(0,rundy(p2,tim2).zpet) of p2..cycle;
infill p3..cycle;
penlabels(1,1',2,3,4); labels(0,7);
endchar;

iff known chars.latin_q:
bskchar "The letter q";
beginchar(chars.latin_q,11u#,x_height#,desc_depth#); uni "0x0071";
italcorr x_height#*slant;
adjust_fit(0,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2.5oblu;
pos1(curve,0); pos3'(hair,180); pos2(hair,90); pos3(hair,180); pos4(hair,270);
lft x1l=u; lft x3r=w-2u-stem; y3=.65x_height; y1=.5h; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x3'r=x3r; y3'=.3x_height;
if (y3'/hair)<3.5: x3'l:=x3'l+.5hair; fi;
bot y2l=-o; top y4l=h+o;
rt x5r=w-2u; bot y5=-d; top y6r=h; 
lowercase_points(5,6,jut);
p0=z3l---z3'l{z2r-z3r}..z2l..z1l..z4l..{down}z3l;
p1=z3r{up}..z4r..z1r..z2r..{up}z3'r--z3r;
p2=z5a--z6l;
p3=reverse lowercase_stem_draw(5,6);
tim1-2=xpart(subpath (2, 5) of p0 intersectiontimes p2);
tim2  =xpart(subpath (0,3) of p0 intersectiontimes ((0,0)--(w,0)));
if tim2<0: tim2:=xpart(subpath (0,3) of p0 intersectiontimes ((0,o)--(w,o))); fi;
tim3  =xpart(p3 intersectiontimes ((0,-o)--(x3'r,-o)));
z7=point tim1 of p0 + like_stem*up; if y7>y6r-.8hair: y7:=y6r-.8hair; fi
p4=z3r{up}..z4r..z1r..z2r..z2r+2hair*right..{up}z3'r--z3r;
bot rt z9=(w-u,x_height+o); z9'=z6r+stem*down;
tim4=xpart(p0 intersectiontimes ((.5w,y7)--(w,y7)));
filldraw subpath (tim2, rundy(p0,tim4).zpet) of p0..bot z6---z9--z9+down{z7-z9}..
         {down}z9'---subpath (0,tim3) of p3..cycle;
infill p4..cycle;
penlabels(1,3',2,3,4); labels(7,9,9');
endchar;

iff known chars.latin_q_BB:
bskchar "The blackboard-bold letter q";
beginchar(chars.latin_q_BB,11u#,x_height#,desc_depth#); uni "0x1D562";
italcorr x_height#*slant;
adjust_fit(0,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2.5oblu;
save stem; stem:=.8cap_stem;
pos1(cap_stem,0); pos3'(hair,180); pos2(hair,90); pos3(hair,180); pos4(hair,270);
lft x1l=u; lft x3r=w-2u-stem; y3=.65x_height; y1=.5h; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x3'r=x3r; y3'=.3x_height;
if (y3'/hair)<3.5: x3'l:=x3'l+.5hair; fi;
bot y2l=-o; top y4l=h+o;
rt x5r=w-2u; bot y5=-d; top y6r=h; 
lowercase_points(5,6,jut);
p0=z3l---z3'l{z2r-z3r}..z2l..z1l..z4l..{down}z3l;
p1=z3r{up}..z4r..z1r..z2r..{up}z3'r--z3r;
p2=z5a--z6l;
p3=reverse lowercase_stem_draw(5,6);
tim1-2=xpart(subpath (2, 5) of p0 intersectiontimes p2);
tim2  =xpart(subpath (0,3) of p0 intersectiontimes ((0,0)--(w,0)));
if tim2<0: tim2:=xpart(subpath (0,3) of p0 intersectiontimes ((0,o)--(w,o))); fi;
tim3  =xpart(p3 intersectiontimes ((0,-o)--(x3'r,-o)));
z7=point tim1 of p0 + like_stem*up; if y7>y6r-.8hair: y7:=y6r-.8hair; fi
p4=z3r{up}..z4r..z1r..z2r..z2r+2hair*right..{up}z3'r--z3r;
bot rt z9=(w-u,x_height+o); z9'=z6r+stem*down;
tim4=xpart(p0 intersectiontimes ((.5w,y7)--(w,y7)));
filldraw subpath (tim2, rundy(p0,tim4).zpet) of p0..bot z6---z9--z9+down{z7-z9}..
         {down}z9'---subpath (0,tim3) of p3..cycle;
infill p4..cycle;
bot z100=(x5r,y5e);
p100:=subpath(2,4) of p0;
p101:=subpath(1,3) of p4;
z101=bsktouch(p100,down,p101,up);
z102=bsktouch(p100,up,p101,down);
tim100=xpart(p100 intersectiontimes (z101--(x101,h+5)));
tim101=xpart(p101 intersectiontimes (z101--(x101,0)));
tim102=xpart(p100 intersectiontimes (z102--(x102,y2l-5)));
tim103=xpart(p101 intersectiontimes (z102--(x102,y3)));
oblu:=f_obl; oblu.more:=1.25f_obl;
infill ifobl(6r,6b,5r,5l,more,)---obl(5l,6b,5r)---z5r...obl(100,5e,6r)---cycle;
oblu:=bbw;
infill subpath(rundy(p100,tim102),rundy(p100,tim100).zpet) of p100
       ..reverse subpath(rundy(p101,tim103).zpet,rundy(p101,tim101)) of p101..cycle;
penlabels(1,3',2,3,4); labels(7,9,9',100,101,102);
endchar;

iff known chars.latin_q_SS:
bskchar "The sans-serif letter q";
beginchar(chars.latin_q_SS,11u#,x_height#,desc_depth#); uni "0x1D5CA";
italcorr x_height#*slant;
adjust_fit(0,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2.5oblu;
pos1(curve,0); pos3'(hair,180); pos2(hair,90); pos3(hair,180); pos4(hair,270);
lft x1l=u; lft x3r=w-2u-stem; y3=.65x_height; y1=.5h; .5[x2,x4]=.5[x1,x3]; 
x2-x4=-.5u; x3'r=x3r; y3'=.3x_height;
if (y3'/hair)<3.5: x3'l:=x3'l+.5hair; fi;
bot y2l=-o; top y4l=h+o;
rt x5r=w-2u; bot y5=-d; top y6r=h; 
lowercase_points(5,6,jut);
p0=z3l---z3'l{z2r-z3r}..z2l..z1l..z4l..{down}z3l;
p1=z3r{up}..z4r..z1r..z2r..{up}z3'r--z3r;
p2=z5a--z6l;
p3=z5f{down}..z5..z5a---z6b..z6r---z5f;
tim1-2=xpart(subpath (2, 5) of p0 intersectiontimes p2);
tim2  =xpart(subpath (0,3) of p0 intersectiontimes ((0,0)--(w,0)));
if tim2<0: tim2:=xpart(subpath (0,3) of p0 intersectiontimes ((0,o)--(w,o))); fi;
tim3  =xpart(p3 intersectiontimes ((0,-o)--(x3'r,-o)));
z7=point tim1 of p0 + like_stem*up; if y7>y6r-.8hair: y7:=y6r-.8hair; fi
p4=z3r{up}..z4r..z1r..z2r..z2r+2hair*right..{up}z3'r--z3r;
bot rt z9=(w-u,x_height+o); z9'=z6r+stem*down;
tim4=xpart(p0 intersectiontimes ((.5w,y7)--(w,y7)));
filldraw subpath (tim2, rundy(p0,tim4).zpet) of p0..z6r--subpath (0,tim3) of p3..cycle;
infill p4..cycle;
penlabels(1,3',2,3,4); labels(7,9,9');
endchar;

charscription(8.5u,x_height,0)(
path p[]; numeric tim[];
pos3(like_curve,0); pos5(hair,90); pos6(hair,180);
lft x1l=2u; bot y1=0; top y2=h+apex_o;
rt x3r=w-u; y3r=y5l-.75like_stem; 
y5r=x_height; x5=.5w+.5like_stem;
x6l=x1r; y6=.6x_height;
z4=(x3l,x_height+o);
lowercase_points(1,2,jut);
p2:=z3r{up}..{dir180}z4..{down}z6r;
p1:=z6l{up}..{dir10}z5l..z5l+(hair,-o)...z3l..z3+o*down..z3r;
p3:=z1f--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+.5hair+.5tiny)*up;
if y1'>y5r: y1':=y5r-.5hair; fi;
tim3-1=xpart(subpath (1,2) of p2 intersectiontimes ((0,y1')--(w,y1')));
filldraw p1..subpath (0,tim3) of p2..broken_stem_draw(1',1,2)---cycle;
penlabels(3,5,6); labels(1',4,7);
);

iff known chars.latin_r:
bskchar "The letter r";
beginchar(chars.latin_r,8.5u#, x_height#, 0); uni "0x0072";
italcorr .5[bar_height#,x_height#]*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_racute:
bskchar "The letter r with acute";
beginchar(chars.latin_racute,8.5u#, asc_height#, 0); uni "0x0155";
italcorr asc_height#*slant-.75u#;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
usechar;
x101=.5[x2r,x5];
acute(100,101);
endchar;

iff known chars.latin_rcaron:
bskchar "The letter r with caron";
beginchar(chars.latin_rcaron,8.5u#, asc_height#, 0); uni "0x0159";
italcorr asc_height#*slant-.75u#;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
usechar;
x101=.5[x2r,x5];
hacek(100,101,102);
endchar;

iff known chars.latin_rdoublegrave:
bskchar "The letter r with double grave";
beginchar(chars.latin_rdoublegrave,8.5u#,asc_height#,0); uni "0x0211";
italcorr .5[bar_height#,x_height#]*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
usechar;
x102-x100=3u; 
d_grave(100,101,102,103,.5[x5r,x2]);
endchar;

iff known chars.latin_rcedilla:
bskchar "The letter r with cedilla (treated as comma)";
beginchar(chars.latin_rcedilla,8.5u#,x_height#,.75comma_depth#); uni "0x0157";
italcorr .5[bar_height#,x_height#]*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
usechar;
x100=x1; top y100''r=-o;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_rinvbreve:
bskchar "The letter r with inverted breve";
beginchar(chars.latin_rinvbreve,8.5u#,asc_height#,0); uni "0x0213";
italcorr .5[bar_height#,x_height#]*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
usechar;
x101=.45[x4,x2r]; x102-x100=4.5u;
tieacc(100,101,102);
endchar;

iff known chars.latin_r_BB:
bskchar "The blackboard-bold letter r";
beginchar(chars.latin_r_BB,8.5u#, x_height#, 0); uni "0x1D563";
italcorr .5[bar_height#,x_height#]*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[];
save stem; stem:=.8cap_stem;
pos3(like_curve,0); pos5(hair,90); pos6(hair,180);
lft x1l=2u; bot y1=0; top y2=h+apex_o;
rt x3r=w-u; y3r=y5l-.75like_stem; 
y5r=x_height; x5=.5w+.5like_stem;
x6l=x1r; y6=.6x_height;
z4=(x3l,x_height+o);
lowercase_points(1,2,jut);
p2:=z3r{up}..{dir180}z4..{down}z6r;
p1:=z6l{up}..{dir10}z5l..z5l+(hair,-o)...z3l..z3+o*down..z3r;
p3:=z1f--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+.5hair+.5tiny)*up;
if y1'>y5r: y1':=y5r-.5hair; fi;
tim3-1=xpart(subpath (1,2) of p2 intersectiontimes ((0,y1')--(w,y1')));
filldraw p1..subpath (0,tim3) of p2..broken_stem_draw(1',1,2)---cycle;
oblu:=f_obl; oblu.more:=1.25oblu;
bot z100=(x1l,y1b);
infill ifobl(2r,2b,1r,1l,more,)---obl(100,2b,1b)...z1l---obl(1r,1l,2r)---cycle;
penlabels(3,5,6); labels(1',4,7,100);
math_fit(0,ic#-1.5u#);
endchar;

iff known chars.latin_r_SS:
bskchar "The sans-serif letter r";
beginchar(chars.latin_r_SS,8.5u#, x_height#, 0); uni "0x1D5CB";
italcorr .5[bar_height#,x_height#]*slant;
adjust_fit(serif_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[];
pos3(stem,0); pos5(hair,90); pos6(hair,180);
lft x1l=2u; bot y1=0; top y2=h+apex_o;
rt x3r=w-u; y3r=y5l-.75like_stem; 
y5r=x_height; x5=.5w+.5like_stem;
x6l=x1r; y6=.6x_height;
z4=(x3l,y5r);
lowercase_points(1,2,jut);
p2:=z3r{up}..z5r..{down}z6r;
p1:=z6l{up}..{dir10}z5l...{down}z3l;
p3:=z1f--z2r;
(tim1,tim2)=p2 intersectiontimes p3;
z1'=point tim2 of p3+(like_stem+.5hair+.5tiny)*up+o*right;
if y1'>y5r: y1':=y5r-.5hair; fi;
tim3-1=xpart(subpath (1,2) of p2 intersectiontimes ((0,y1')--(w,y1')));
filldraw p1..subpath (0,tim3) of p2..z1'..z2..z2b---z1a..z1..z1f---cycle;
penlabels(3,5,6); labels(1',4,7);
math_fit(0,ic#-1.5u#);
endchar;

charscription(7.7u,x_height,0)(
numeric exc; exc=(w-u)/h; oblu:=1.5oblu;
path p[]; numeric tim[];
pos2(hair,90); pos3(curve,angle((w-u,h))+180); pos4(hair,90);
pos5(stem,180); pos6(stem,180);
y5=.5[y2l,y3]+.5hair; x3-x5l=.5(y2l-y3l)*exc;
y6=.5[y4r,y3]-.5hair; rt x6l=w-u;
x2=x3=x4=.5w; top y2r=h+o; bot y4l=-o; 
y3=.5[y2l,y4r]+.5hair;
pos1(hair,0); pos1'(hair,0); x1r=x1'r+.5o=w-x5r; y1=y5-.5hair; y1'=h+o;
pos7(hair,0); pos7'(hair,0); x7l=x7'l-o=w-x6l; y7=y6+.5hair; y7'=-o;
p0=z1r{up}..z2r{left}..z5r..z3r..z6r..{left}z4r..{up}z7r;
p1=z7l{dir-80}..z4l{right}..z6l..z3l..z5l..{right}z2l..{down}z1l;
tim1=xpart(p0 intersectiontimes ((x1'l-.5o,h)--(x1'l-.5o,.5h)));
tim2=xpart(p1 intersectiontimes ((x7'r+o,0)--(x7'r+o,.5h)));
filldraw z1r---z1'r..z1'l..subpath(rundy(p0,tim1),infinity) of p0..z7l
         ---z7'l..z7'r..subpath(rundy(p1,(tim2,1.33oblu)), infinity) of p1..cycle;
penlabels(0,1,1',2,3,4,5,6,7,7'); 
);

iff known chars.latin_s:
bskchar "The letter s";
beginchar(chars.latin_s,7.7u#, x_height#, 0); uni "0x0073";
italcorr x_height#*slant-.75u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_scaron:
bskchar "The letter s with caron";
beginchar(chars.latin_scaron,7.7u#, asc_height#, 0); uni "0x0161";
italcorr asc_height#*slant-.5u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x2; x100r=u;
hacek(100,101,102);
endchar;

iff known chars.latin_scircumflex:
bskchar "The letter s with circumflex";
beginchar(chars.latin_scircumflex,7.7u#, asc_height#-.1x_height#, 0); uni "0x015D";
italcorr .5[asc_height#,x_height#]*slant-.75u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x2+o; x102-x100=5u;
circumflex(100,101,102);
endchar;

iff known chars.latin_sacute:
bskchar "The letter s with acute";
beginchar(chars.latin_sacute,7.7u#, asc_height#, 0); uni "0x015B";
italcorr x_height#*slant-.75u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=x2-u; 
acute(100,101);
endchar;

iff known chars.latin_scommabelow:
bskchar "The letter s with comma below";
beginchar(chars.latin_scommabelow,7.7u#,x_height#,.75comma_depth#); uni "0x0219";
italcorr x_height#*slant-.75u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x4; top y100''r=-2o;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_s_BB:
bskchar "The blackboard-bold letter s";
beginchar(chars.latin_s_BB,7.7u#, x_height#, 0); uni "0x1D564";
italcorr x_height#*slant-.75u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric exc; exc=(w-u)/h; oblu:=1.5oblu;
path p[]; numeric tim[];
pos2(hair,90); pos3(cap_stem,angle((w-u,h))+180); pos4(hair,90);
pos5(.8cap_stem,180); pos6(.8cap_stem,180);
y5=.5[y2l,y3]+.5hair; x3-x5l=.5(y2l-y3l)*exc;
y6=.5[y4r,y3]-.5hair; rt x6l=w-u;
x2=x3=x4=.5w; top y2r=h+o; bot y4l=-o; 
y3=.5[y2l,y4r]+.5hair;
pos1(hair,0); pos1'(hair,0); x1r=x1'r+.5o=w-.5[x5,x5r]; y1=y5-.5hair; y1'=h+o;
pos7(hair,0); pos7'(hair,0); x7l=x7'l-o=w-x6l; y7=y6+.5hair; y7'=-o;
p0=z1r{up}..z2r{left}..z5r..z3r..z6r..{left}z4r..{up}z7r;
p1=z7l{dir-80}..z4l{right}..z6l..z3l..z5l..{right}z2l..{down}z1l;
tim1=xpart(p0 intersectiontimes ((x1'l-.5o,h)--(x1'l-.5o,.5h)));
tim2=xpart(p1 intersectiontimes ((x7'r+o,0)--(x7'r+o,.5h)));
filldraw z1r---z1'r..z1'l..subpath(rundy(p0,tim1),infinity) of p0..z7l
         ---z7'l..z7'r..subpath(rundy(p1,(tim2,1.33oblu)), infinity) of p1..cycle;
oblu:=bbw;
p100:=subpath(1,5) of p0;
p101:=subpath(1,5) of p1;
z100=bsktouch(subpath(0,1) of p100,down,p101,up);
z101=bsktouch(p100,down,subpath(0,1) of p101,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y2r+5)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y5)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y6)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y4l-5)));
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103),rundy(p101,tim101).zpet) of p101..cycle;
penlabels(0,1,1',2,3,4,5,6,7,7'); labels(100,101);
endchar;

iff known chars.latin_s_SS:
bskchar "The sans-serif letter s";
beginchar(chars.latin_s_SS,7u#, x_height#, 0); uni "0x1D5CC";
italcorr x_height#*slant-.75u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric exc; exc=(w-u)/h; oblu:=1.5oblu;
path p[]; numeric tim[];
pos2(hair,90); pos3(curve,angle((w-u,h))+180); pos4(hair,90);
pos5(stem,180); pos6(stem,180);
y5=.5[y2l,y3]+.5hair; x3-x5l=.5(y2l-y3l)*exc;
y6=.5[y4r,y3]-.5hair; rt x6l=w-u;
x3=.5w; top y2r=h+o; bot y4l=-o; x2=.5[x1,x5l]; .5[x2,x4]=x3;
y3=.5[y2l,y4r]+.5hair;
pos1(hair,0); x1r=w-x5r; y1=y5+o;
pos7(hair,0); x7l=w-x6l; y7=y6;
p0=z1r{up}..z2r{left}..z5r..z3r..z6r..{left}z4r..{up}z7r;
p1=z7l{dir-90}..z4l{right}..z6l..z3l..z5l..{right}z2l..{down}z1l;
filldraw p0..p1..cycle;
penlabels(0,1,2,3,4,5,6,7); 
endchar;

iff known chars.latin_scedilla:
bskchar "The letter s with cedilla";
beginchar(chars.latin_scedilla,7.7u#, x_height#,.65desc_depth#); uni "0x015F";
italcorr x_height#*slant-.75u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric exc; exc=(w-u)/h; oblu:=1.5hair;
path p[]; numeric tim[];
pos2(hair,90); pos3(curve,angle((w-u,h))+180); pos4(hair,90);
pos5(stem,180); pos6(stem,180);
pos8(.5stem,0); pos9(.5stem,0); pos10(.8stem,0); pos11(.5stem,-110);
y5=.5[y2l,y3]+.5hair; x3-x5l=.5(y2l-y3l)*exc;
y6=.5[y4r,y3]-.5hair; rt x6l=w-u;
x2=x3=x4=.5w; top y2r=h+o; bot y4l=-o; 
y3=.5[y2l,y4r]+.5hair;
pos1(hair,0); pos1'(hair,0); x1r=x1'r+.5o=w-x5r; y1=y5-.5hair; y1'=h+o;
pos7(hair,0); pos7'(hair,0); x7l=x7'l-o=w-x6l; y7=y6+.5hair; y7'=-o;
x8=x9; z8l=z4l; y9=-hair; y10=-.5d;
rt x10r-lft x11r=4u; x8r-lft x11r=2u; y11r=-d;
p0=z1r{up}..z2r{left}..z5r..z3r..z6r..{left}z4r..{up}z7r;
p1=z7l{dir-80}..z4l{right}..z6l..z3l..z5l..{right}z2l..{down}z1l;
p2:=z9r..{down}z10r..{left}z11r..{right}z11l..{up}z10l..z9l--z8l;
p3:=reverse(z8r{down}..subpath (rundy(p2,(0,curve)),infinity) of p2);
tim1=xpart(p0 intersectiontimes ((x1'l-.5o,h)--(x1'l-.5o,.5h)));
tim2=xpart(p1 intersectiontimes ((x7'r+o,0)--(x7'r+o,.5h)));
if tim2>1: tim2:=1; fi;
tim3=xpart(p1 intersectiontimes (z9l--(x8l,y6)));
filldraw z1r---z1'r..z1'l..subpath(rundy(p0,tim1),infinity) of p0..z7l
         ---z7'l..z7'r..subpath(rundy(p1,(tim2,1.33oblu)),rundy(p1,1).zpet) of p1
	 ..subpath(rundy(p3,(0,hair)),rundy(p3,infinity).zpet) of p3
	 ..subpath(rundy(p1,tim3),infinity) of p1
	 ..cycle;
penlabels(0,1,1',2,3,4,5,6,7,7',8,9,10,11); 
endchar;

iff known chars.latin_eszet:
bskchar "The german eszet";
beginchar(chars.latin_eszet,11.5u#, asc_height#, 0); uni "0x00DF";
italcorr .5[asc_height#,x_height#]*slant-1.25u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric tim;
path p[];
pos3(hair,-90); pos4(stem,180); pos4'(stem,180);
pos6(stem,180); pos7(.9stem,180); pos8(hair,90);
lft x1l=2.5u; bot y1=0; top y2=.4[x_height,h];
top y3l=h+o; x3=.5w+.5u; .5[x2r,x4]=x3; y4=y2+hair;
lowercase_points(1,2,jut); if not bold_face: y2r:=y2r+hair; fi; x1d:=x1d-hair;
z3'r=z3r+.5hair*right; 
pos5(hair,90); pos5'(hair,90);
y5=y5'=bot x_height;
lft x5=u; x5'=x1l; x6r=x2r+stem+u; rt x7l=w-u; y7=.25x_height; y6=.5[x_height,y9];
bot y8l=-o; x8=x9=.5[x6,x7]; y9=.5[x_height,y8l]+.5hair; y7r:=y7-.225stem;
pos9(curve,angle((x7r-x6r,x_height))+180);
pos10(hair,0); pos10'(hair,0); rt x10r=x6r; x10'r=x10r+o; y10=.5[y8r,y9]+.5hair; y10'=-o;
p0:=z10l{dir-80}..{right}z8l; 
tim=xpart(p0 intersectiontimes (z10'r--z9r));
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..{left}z1e..
         {up}z1f---z2r...{right}z3r..z4r{down}..z6r..z9r..{down}z7r..{left}z8r..
	 {up}z10r..z10l---z10'l..z10'r..subpath (rundy(p0,tim),1) of p0..z7l{up}..
	 z9l..z6l..z4l{up}..z3l..z2l---obl(5'r,2l,5r)---z5r..z5l---
	 obl(5'l,5l,1l)---cycle;
penlabels(3,4,5,5',6,7,8,9,10,10');
endchar;

iff known chars.latin_long_s:
bskchar "The letter long s";
beginchar(chars.latin_long_s,6.5u#, asc_height#, 0); uni "0x017F";
italcorr asc_height#*slant+1.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric fend; fend:=stem;
pos3(hair,-90); pos4(fend,180);
lft x1l=2.5u; bot y1=0; top y2=h-like_curve;
top y3l=h+o; x3=if monospace: .6[w,x1r] else: w-1.25u fi;
.5[x2r,x4]=x3; y4''=y3r-like_hair;
z4'=z4+.2fend*down+o*left; z4''=z4+.5(fend-currentbreadth)*dir45;
lowercase_points(1,2,jut); 
if not bold_face: y2r:=y2r+hair; fi;
z3'r=z3r+.5hair*right; 
pos5(hair,90); pos5'(hair,90); 
y5=y5'=bot x_height;
lft x5=u; x5'=x1l;
filldraw z1a..z1b{left}..z1c{right}..z1+ser_boule*up..{right}z1d..
         {left}z1e..{up}z1f---z2r...{right}z3r..z4r..z4'..z4l{up}..z4''..z3l..z2l---
	 obl(5'r,2l,5r)---z5r..z5l---obl(5'l,5l,1l)---cycle;
penlabels(3,4,5,5'); labels(4',4'');
endchar;

charscription(7.5u,.4[asc_height,x_height], 0)(
pos0(hair,0); pos1(stem,0); pos2(stem,0); pos3(hair,90); pos4(hair,180);
x1=x2; x2r=.5w; x3=.5[x2r,x4]; rt x4l=w-u; 
y2=.15h; y4=2/3(x4-x3); y1=x_height; bot y3l=-o; y4l:=y4-.5(hair-currentbreadth);
top y0=h+apex_o; x0r=x1r; y0r:=y0-apex_o;
pos5(hair,90); pos6(hair,90);
y5=y6=y1; lft x5=u; rt x6=w-u; z1'l-z1l=z1'r-z1r=z1r-z1''r=.5(hair-currentbreadth)*down;
filldraw z2r..z3r..{dir(angle(z4r-z3r)+10)}z4r--z4l{dir(angle(z3l-z4l)+20)}..{left}z3l
         ..z2l---obl(1'l,2l,5l)---z5l..{right}z5r..controls (z1l+hair*dir100)..
	 z0l..z0r---obl(1''r,0r,6r)---z6r..z6l---obl(1'r,6l,2r)---cycle;
penlabels(0,1,1',2,3,4,5,6); labels(1''r);
);

iff known chars.latin_t:
bskchar "The letter t";
beginchar(chars.latin_t,7.5u#,.4[asc_height#,x_height#], 0); uni "0x0074";
italcorr x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_tcommabelow:
bskchar "The letter t with comma below";
beginchar(chars.latin_tcommabelow,7.5u#,.4[asc_height#,x_height#],.75comma_depth#); uni "0x021B";
italcorr x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=x3-o; top y100''r=-2o;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_tcaron:
bskchar "The letter t with caron (treated like comma)";
beginchar(chars.latin_tcaron,7.5u#, asc_height#, 0); uni "0x0165";
italcorr asc_height#*slant-.5u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
rt x100'''=w-u; top y100''r=h;
comma(100,.75dot_size,.5hair,.75comma_depth);
endchar;

iff known chars.latin_t_BB:
bskchar "The blackboard-bold letter t";
beginchar(chars.latin_t_BB,7.5u#,.4[asc_height#,x_height#], 0); uni "0x1D565";
italcorr x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
pos0(hair,0); pos1(.8cap_stem,0); pos2(.8cap_stem,0); pos3(hair,90); pos4(hair,180);
x1=x2; x2r=.5w; rt x3=.5[x2r,x4]; rt x4l=w-u; 
y2=.15h; y4=2/3(x4-x3); y1=x_height; bot y3l=-o; y4l:=y4-.5(hair-currentbreadth);
top y0=h+apex_o; x0r=x1r; y0r:=y0-apex_o;
pos5(hair,90); pos6(hair,90);
y5=y6=y1; lft x5=u; rt x6=w-u; z1'l-z1l=z1'r-z1r=z1r-z1''r=.5(hair-currentbreadth)*down;
filldraw z2r..z3r..{dir(angle(z4r-z3r)+10)}z4r--z4l{dir(angle(z3l-z4l)+20)}..{left}z3l
         ..z2l---obl(1'l,2l,5l)---z5l..{right}z5r..controls (z1l+hair*dir100)..
	 z0l..z0r---obl(1''r,0r,6r)---z6r..z6l---obl(1'r,6l,2r)---cycle;
path p[]; numeric tim[];
p100:=subpath(0,2) of (z1r---z2r..z3r..{dir(angle(z4r-z3r)+10)}z4r);
p101:=subpath(1,infinity) of (z4l{dir(angle(z3l-z4l)+20)}..{left}z3l..{up}z2l);
z100=bsktouch(p100,down,p101,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y2)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y3l-5)));
z101=2/3[z1r,z0r];
oblu:=.8bbw;
infill subpath(0,rundy(p100,tim100).zpet) of p100
       ..subpath(rundy(p101,tim101),infinity) of p101---ifobl(1l,101,2l,1r,,)---cycle;
penlabels(0,1,1',2,3,4,5,6); labels(1''r,100,101);
endchar;

iff known chars.latin_tcedilla:
bskchar "The letter t with cedilla";
beginchar(chars.latin_tcedilla,7.5u#,.4[asc_height#,x_height#],.65desc_depth#); uni "0x0163";
italcorr x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric tim[];
pos0(hair,0); pos1(stem,0); pos2(stem,0); pos3(hair,90); pos4(hair,180);
pos7(.5stem,0); pos8(.5stem,0); pos9(.8stem,0); pos10(.5stem,-110);
x1=x2; x2r=.5w; x3=.5[x2r,x4]; rt x4l=w-u; 
y2=.15h; y4=2/3(x4-x3); y1=x_height; bot y3l=-o; y4l:=y4-.5(hair-currentbreadth);
top y0=h+apex_o; x0r=x1r; y0r:=y0-apex_o;
pos5(hair,90); pos6(hair,90);
y5=y6=y1; lft x5=u; rt x6=w-u; z1'l-z1l=z1'r-z1r=z1r-z1''r=.5(hair-currentbreadth)*down;
x7l=x8l; z7r=z3r; y8=-hair; y9=-.5d;
rt x9r-lft x10r=4u; x7r-lft x10r=2u; y10r=-d;
p1:=z4l{dir(angle(z3l-z4l)+20)}..{left}z3l..z2l;
p2:=z8r..{down}z9r..{left}z10r..{right}z10l..{up}z9l..z8l--z7l;
p3:=z7r{down}..subpath (rundy(p2,(0,curve)),infinity) of p2;
tim1=xpart(p1 intersectiontimes (z8l--(x7l,y2)));
filldraw z2r..z3r..{dir(angle(z4r-z3r)+10)}z4r--subpath(0,rundy(p1,1).zpet) of p1..subpath(rundy(p3,0),rundy(p3,infinity).zpet) of p3..subpath(rundy(p1,tim1),infinity) of p1---obl(1'l,2l,5l)---z5l..{left}z5r..controls (z1l+hair*dir100)..z0l..z0r---obl(1''r,0r,6r)---z6r..z6l---obl(1'r,6l,2r)---cycle;
penlabels(0,1,1',2,3,4,5,6,7,8,9,10); labels(1''r);
endchar;

iff known chars.latin_tstroke:
bskchar "The letter t with stroke";
beginchar(chars.latin_tstroke,7.5u#,.4[asc_height#,x_height#], 0); uni "0x0167";
italcorr x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
pos0(hair,0); pos1(stem,0); pos2(stem,0); pos3(hair,90); pos4(hair,180);
pos5(hair,90); pos6(hair,90);
pos7(bar,90); pos7'(bar,90); pos8(bar,90); pos8'(bar,90);
x1=x2; x2r=.5w; x3=.5[x2r,x4]; rt x4l=w-u; 
y2=.15h; y4=2/3(x4-x3); y1=x_height; bot y3l=-o; y4l:=y4-.5(hair-currentbreadth);
top y0=h+apex_o; x0r=x1r; y0r:=y0-apex_o;
y5=y6=y1; lft x5=u; rt x6=w-u; z1'l-z1l=z1'r-z1r=z1r-z1''r=.5(hair-currentbreadth)*down;
x8-x7=4u if bold_face: +.5u fi; y8=y8'=y7=y7'=bar_height; .5[x7,x8]=x1+o;
x7'=x1l; x8'=x1r; bskpoints(7,8,hair,hair);
filldraw z2r..z3r..{dir(angle(z4r-z3r)+10)}z4r--z4l{dir(angle(z3l-z4l)+20)}
         ..{left}z3l..z2l---obl(7'l,2l,7l)---z7l..z7rr---obl(7'r,7rr,1l)
	 ---obl(1'l,2l,5l)---z5l..{left}z5r..controls (z1l+hair*dir100)
	 ..z0l..z0r---obl(1''r,0r,6r)---z6r..z6l---obl(1'r,6l,2r)
	 ---obl(8'r,1r,8r)---z8r..z8ll---obl(8'l,8l,2r)---cycle;
penlabels(0,1,1',2,3,4,5,6,7,7',8,8'); labels(1''r,7rr,8ll);
endchar;

iff known chars.latin_t_SS:
bskchar "The sans-serif letter t";
beginchar(chars.latin_t_SS,7.5u#,.4[asc_height#,x_height#], 0); uni "0x1D5CD";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
pos0(hair,0); pos1(stem,0); pos2(stem,0); pos3(hair,90); pos4(hair,180);
x1=x2; x2r=.5w; x3=.5[x2r,x4]; rt x4l=w-u; 
y2=.15h; y4=2/3(x4-x3); y1=x_height; bot y3l=-o; y4l:=y4-.5(hair-currentbreadth);
top y0=h+apex_o; x0r=x1r; y0r:=y0-apex_o;
pos5(hair,90); pos6(hair,90);
y5=y6=y1; lft x5=u; rt x6=w-u; z1'l-z1l=z1'r-z1r=z1r-z1''r=.5(hair-currentbreadth)*down;
y5'=y5r; x5'=x1l;
oblu:=cap_hair;
filldraw z2r..z3r..{dir(angle(z4r-z3r)+10)}z4r..z4l{dir(angle(z3l-z4l)+20)}..{left}z3l..z2l---obl(1'l,2l,5l)---z5l..z5r---obl(5',5r,0l)---z0l..z0r---obl(1''r,0r,6r)---z6r..z6l---obl(1'r,6l,2r)---cycle;
penlabels(0,1,1',2,3,4,5,6); labels(1''r,5');
endchar;

charscription(11u,x_height,0)(
path p[]; numeric tim[];
pos1(stem,0); pos2(stem,0); pos4(stem,0);
pos5(n_str_hair,90); pos6(hair,90);
lft x1l=2u; x2=x1; rt x3r=w-2u; x3=x4;
bot y3=0; top y2= top y4=h; y4=y4';
y1=.25x_height;
serifs_tl(2l); serifs_tl(4l);
lowercase_points(3,4',jut); 
y5l=0; x5=.5[x3l,x1r];
x6l=x3l; y6=.4x_height;
oblu:=.5f_obl;
p1:=z6r{down}..z5r..z1r---obl(2r,1r,2l)---z2l.a..z2l.c---z2l.c+.5hair*right
    ..z2l.b---z1l..z5l..{up}z6l;
p2:=z6l---(reverse lowercase_lower_u_serif(3,.5hair))---obl(4r,3f,4l)
    ---z4l.a..z4l.c---z4l.c+.5hair*right..z4l.b;
tim0=y3a-like_hair;
tim1-7=xpart(subpath(7,length p1) of p1 intersectiontimes ((.5w,tim0)--(w,tim0)));
tim2  =xpart(p2 intersectiontimes ((0,tim0)--(x3,tim0)));
filldraw subpath(0,tim1) of p1..subpath(rundy(p2,tim2),infinity) of p2---cycle;
penlabels(1,2,4,5,6,7); 
);

iff known chars.latin_u:
bskchar "The letter u";
beginchar(chars.latin_u,11u#, x_height#, 0); uni "0x0075";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_uacute:
bskchar "The letter u with acute";
beginchar(chars.latin_uacute,11u#, asc_height#, 0); uni "0x00FA";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=.5[x2r,x4'a];
acute(100,101);
endchar;

iff known chars.latin_uring:
bskchar "The letter u with ring";
beginchar(chars.latin_uring,11u#, asc_height#, 0); uni "0x016F";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x100=.5[x2r,x4'a]; lft x101=x2r;
ring(100,101);
endchar;

iff known chars.latin_uumlaut:
bskchar "The letter u with umlaut";
beginchar(chars.latin_uumlaut,11u#, asc_height#-dot_size#, 0); uni "0x00FC";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x100=x2; x101=x4l;
umlaut(100,101);
endchar;

iff known chars.latin_ugrave:
bskchar "The letter u with grave";
beginchar(chars.latin_ugrave,11u#,asc_height#,0); uni "0x00F9";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x5;
grave(100,101);
endchar;

iff known chars.latin_udoublegrave:
bskchar "The letter u with double grave";
beginchar(chars.latin_udoublegrave,11u#,asc_height#,0); uni "0x0215";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x102-x100=3u; 
d_grave(100,101,102,103,x5-o);
endchar;

iff known chars.latin_umacron:
bskchar "The letter u with macron";
beginchar(chars.latin_umacron,11u#,.5[asc_height#,x_height#],0); uni "0x016B";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x100=x1r; x101=x3l;
macron(100,101);
endchar;

iff known chars.latin_ucaron:
bskchar "The letter u with caron";
beginchar(chars.latin_ucaron,11u#,asc_height#,0); uni "0x01D4";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x5;
hacek(100,101,102);
endchar;

iff known chars.latin_ucircumflex:
bskchar "The letter u with circumflex";
beginchar(chars.latin_ucircumflex,11u#,asc_height#-.1x_height#,0); uni "0x00FB";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x5;
circumflex(100,101,102);
endchar;

iff known chars.latin_ubreve:
bskchar "The letter u with breve";
beginchar(chars.latin_ubreve,11u#,asc_height#,0); uni "0x016D";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x5; x102-x100=5u;
breve(100,101,102);
endchar;

iff known chars.latin_uinvbreve:
bskchar "The letter u with inverted breve";
beginchar(chars.latin_uinvbreve,11u#,asc_height#,0); uni "0x0217";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x5; x102-x100=5u;
tieacc(100,101,102);
endchar;

iff known chars.latin_uhumlaut:
bskchar "The letter u with Hungarian umlaut";
beginchar(chars.latin_uhumlaut,11.3u#,asc_height#,0); uni "0x0171";
italcorr asc_height#*slant-1.5u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101-x100=3u; .5[x100,x101]=x5+1.5u;
h_umlaut(100,101,102,103,2u);
endchar;

iff known chars.latin_utilde:
bskchar "The letter u with tilde";
beginchar(chars.latin_utilde,11u#,asc_height#,0); uni "0x0169";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101-x100=6u; x.tilde=x5-o;
tilde(100,101);
endchar;

iff known chars.latin_u_BB:
bskchar "The blackboard-bold letter u";
beginchar(chars.latin_u_BB,11u#, x_height#, 0); uni "0x1D566";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[];
save stem; stem:=.8cap_stem;
pos1(stem,0); pos2(stem,0); pos4(stem,0);
pos5(n_str_hair,90); pos6(hair,90);
lft x1l=2u; x2=x1; rt x3r=w-2u; x3=x4;
bot y3=0; top y2= top y4=h; y4=y4';
y1=.25x_height;
serifs_tl(2l); serifs_tl(4l);
lowercase_points(3,4',jut); 
y5l=0; x5=.5[x3l,x1r];
x6l=x3l; y6=.4x_height;
oblu:=.5f_obl;
p1:=z6r{down}..z5r..z1r---obl(2r,1r,2l)---z2l.a..z2l.c---z2l.c+.5hair*right
    ..z2l.b---z1l..z5l..{up}z6l;
p2:=z6l---(reverse lowercase_lower_u_serif(3,.5hair))---obl(4r,3f,4l)
    ---z4l.a..z4l.c---z4l.c+.5hair*right..z4l.b;
tim0=y3a-like_hair;
tim1-7=xpart(subpath(7,length p1) of p1 intersectiontimes ((.5w,tim0)--(w,tim0)));
tim2  =xpart(p2 intersectiontimes ((0,tim0)--(x3,tim0)));
filldraw subpath(0,tim1) of p1..subpath(rundy(p2,tim2),infinity) of p2---cycle;
oblu:=2f_obl; oblu.more:=1.25f_obl;
bot z101=(x2l,y2l.c);
p100:=z1l{down}..z5l..{up}z6l;
p101:=z6r{down}..z5r..{up}z1r;
z100=bsktouch(p100,up,p101,down);
tim100=xpart(p100 intersectiontimes (z100--(x100,y5l-5-u)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y1)));
infill ifobl(4'r,4'b,3r,3l,more,)---z3a..z3..z3f---cycle;
oblu.m:=f_obl; oblu:=bbw;
infill ifobl(2r,2l.b,1r,1l,more,)
       ---subpath(0,rundy(p100,tim100).zpet) of p100
       ..subpath(rundy(p101,tim101),infinity) of p101---cycle;
penlabels(1,2,4,5,6,7); labels(100,101);
endchar;

iff known chars.latin_u_SS:
bskchar "The sans-serif letter u";
beginchar(chars.latin_u_SS,11u#, x_height#, 0); uni "0x1D5CE";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
pos1(stem,0); pos2(stem,0); pos4(stem,0);
pos5(n_str_hair,90); pos6(hair,90);
lft x1l=2u; x2=x1; rt x3r=w-2u; x3=x4;
bot y3=0; top y2= top y4=h; y4=y4';
y1=.25x_height;
serifs_tl(2l); serifs_tl(4l);
lowercase_points(3,4',jut); 
y5l=0; x5=.5[x3l,x1r];
x6l=x3l; y6=.3x_height;
oblu:=.5f_obl;
filldraw z6r{down}..z5r..z1r---z2r..z2l.b---z1l..z5l---z3l..z3f---z4r..{down}z4l.b---cycle;
penlabels(1,2,4,5,6,7); 
endchar;

iff known chars.latin_uogonek:
bskchar "The letter u with ogonek";
beginchar(chars.latin_uogonek,11u#,x_height#,.85desc_depth#); uni "0x0173";
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
path p[]; numeric tim[];
pos1(stem,0); pos2(stem,0); pos4(stem,0);
pos5(n_str_hair,90); pos6(hair,90);
lft x1l=2u; x2=x1; rt x3r=w-2u; x3=x4;
bot y3=0; top y2= top y4=h; y4=y4';
y1=.25x_height;
serifs_tl(2l); serifs_tl(4l);
lowercase_points(3,4',jut); 
y5l=0; x5=.5[x3l,x1r];
x6l=x3l; y6=.4x_height;
pos8(stem,0); pos9(curve,0); pos10(hair,45); pos11(hair,160);
x8-x9l=1.5u; x8l=x3l; x10-x9l=3u; rt x11l-x10=1.5u;
bot y8=0; y9=-.5d; bot y10l=-d; y11=-2/3d;
oblu:=.5f_obl;
p1:=z6r{down}..z5r..z1r---obl(2r,1r,2l)---z2l.a..z2l.c---z2l.c+.5hair*right
    ..z2l.b---z1l..z5l..{up}z6l;
p2:=z6l---reverse (z3f{down}..{right}z3e..{left}z3d..z8r..z9r..z10r
                   ..{z8-z9}z11r..z11l{z9-z8}..z10l..z9l..{z8r-z9l}z8l---z3a)
    ---obl(4r,3f,4l) ---z4l.a..z4l.c---z4l.c+.5hair*right..z4l.b;
tim0=y3a-like_hair;
tim1-7=xpart(subpath(7,length p1) of p1 intersectiontimes ((.5w,tim0)--(w,tim0)));
tim2  =xpart(p2 intersectiontimes ((0,tim0)--(x3,tim0)));
filldraw subpath(0,tim1) of p1..subpath(rundy(p2,tim2),infinity) of p2---cycle;
penlabels(1,2,4,5,6,7,8,9,10,11); 
endchar;

iff known chars.latin_v:
bskchar "The letter v";
beginchar(chars.latin_v,11u#,x_height#,0); uni "0x0076";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
numeric alpha, right_stem, left_stem;
pickup tiny.nib;
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3l=.5w; bot y3l=-apex_o;
left_stem=stem;
right_stem=hair;
alpha=diag_ratio(2,left_stem,y1l-y3l,x3l-x1l);
pos1(alpha*left_stem,0); pos2(alpha*right_stem,0);
pos1'(alpha*left_stem,0); pos2'(alpha*right_stem,0);
pos4(.65hair,90); pos5(.65hair,90);
z1'l=z3l=z2'r;
z3'=whatever[z1'r,z1r]=whatever[z2'l,z2l]; 
y3'l=y3'r=y3'+.25[hair,stem]; 
z3'l=whatever[z3',z1r]; z3'r=whatever[z3',z2l];
serifs_tl(1l); serifs_tr(1r);
serifs_tr(2r); serifs_tl(2l);
filldraw z1l.a{left}..{right}z1l.c..diag_serif(1l,3l)--z3l--
         diag_serif(2r,3l)..{right}z2r.c..z2r.a---z2l.a..{right}z2l.c
	 ..diag_serif(2l,3')---z3'r..z3'l---diag_serif(1r,3')
	 ..z1r.c{right}..z1r.a{left}..z1+serif_bend..{left}cycle;
penlabels(1,1',2,2',3,3',4,5,6,7);
endchar;

iff known chars.latin_v_BB:
bskchar "The blackboard-bold letter v";
beginchar(chars.latin_v_BB,11u#,x_height#,0); uni "0x1D567";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
numeric alpha, right_stem, left_stem;
pickup tiny.nib;
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3l=.5w; bot y3l=-apex_o;
left_stem=.8cap_stem;
right_stem=hair;
alpha=diag_ratio(2,left_stem,y1l-y3l,x3l-x1l);
pos1(alpha*left_stem,0); pos2(alpha*right_stem,0);
pos1'(alpha*left_stem,0); pos2'(alpha*right_stem,0);
pos4(.65hair,90); pos5(.65hair,90);
z1'l=z3l=z2'r;
z3'=whatever[z1'r,z1r]=whatever[z2'l,z2l]; 
y3'l=y3'r=y3'+.25[hair,stem]; 
z3'l=whatever[z3',z1r]; z3'r=whatever[z3',z2l];
serifs_tl(1l); serifs_tr(1r);
serifs_tr(2r); serifs_tl(2l);
filldraw z1l.a{left}..{right}z1l.c..diag_serif(1l,3l)--z3l--
         diag_serif(2r,3l)..{right}z2r.c..z2r.a---z2l.a..{right}z2l.c
	 ..diag_serif(2l,3')---z3'r..z3'l---diag_serif(1r,3')
	 ..z1r.c{right}..z1r.a{left}..z1+serif_bend..{left}cycle;
oblu:=f_obl; oblu.more:=1.25oblu;
infill ifobl(1l,1r,3l,3',more,)---ifobl(3',3l,1r,1l,,)---cycle;
penlabels(1,1',2,2',3,3',4,5,6,7);
math_fit(0,ic#-2u#);
endchar;

iff known chars.latin_v_SS:
bskchar "The sans-serif letter v";
beginchar(chars.latin_v_SS,11u#,x_height#,0); uni "0x1D5CF";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
numeric alpha, right_stem, left_stem;
pickup tiny.nib;
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3l=.5w; bot y3l=-apex_o;
left_stem=stem;
right_stem=hair;
alpha=diag_ratio(2,left_stem,y1l-y3l,x3l-x1l);
pos1(alpha*left_stem,0); pos2(alpha*right_stem,0);
pos1'(alpha*left_stem,0); pos2'(alpha*right_stem,0);
pos4(.65hair,90); pos5(.65hair,90);
z1'l=z3l=z2'r;
z3'=whatever[z1'r,z1r]=whatever[z2'l,z2l]; 
y3'l=y3'r=y3'+.25[hair,stem]; 
z3'l=whatever[z3',z1r]; z3'r=whatever[z3',z2l];
serifs_tl(1l); serifs_tr(1r);
serifs_tr(2r); serifs_tl(2l);
filldraw diag_serif(1l,3l)---z3l---diag_serif(2r,3l)...z2
         ...diag_serif(2l,3')---z3'r..z3'l---diag_serif(1r,3')...z1...cycle;
penlabels(1,1',2,2',3,3',4,5,6,7);
math_fit(0,ic#-1u#);
endchar;

charscription(14.5u,x_height,0)(
numeric alpha[], right_stem, left_stem;
oblu:=2oblu;
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3=.5w if monospace: +.5(stem-hair) fi; 
top y3=h if monospace and (x2r-x1l<4stem): -1/3(x2r-x1l) else: +o fi;
.5[x4,x5]=x3; x5-x4=.35w;
bot y4=bot y5=-apex_o;
left_stem=stem;
right_stem=hair;
alpha1=diag_ratio(1,left_stem,y1l-y4,x4-x1l);
alpha2=diag_ratio(1,right_stem,y2r-y5,x2r-x5);
alpha3=diag_ratio(1,left_stem,y3-y5,x5-x3);
alpha4=diag_ratio(1,right_stem,y3-y4,x3-x4);
pos1(alpha1*left_stem,0); pos2(alpha2*right_stem,0);
serifs_tl(1l); serifs_tr(1r);
serifs_tl(2l); serifs_tr(2r);
bot y1'=bot y2'=-o; z1'=z1r+whatever*(z1l-z4); z2'=z2l+whatever*(z2r-z5);
y5'=y4'=y3; x3-x5'=alpha3*(left_stem-tiny); x4'-x3=alpha4*(right_stem-tiny);
z0=whatever[z4,z4']=whatever[z5,z5'];
z2''=whatever[z2l,z2']=whatever[z3,z5+(x3-x5')*right];
z1''=whatever[z1r,z1']=whatever[z3,z4+(x4'-x3)*left];
filldraw z1l.a..{right}z1l.c..diag_serif(1l,4)---z4---obl(0,4,5)---z5
         ---diag_serif(2r,5)..{right}z2r.c..z2r.a---z2l.a..{right}z2l.c
	 ..diag_serif(2l,2')---obl(2'',2l,3)---z3---obl(1'',3,1r)
	 ---diag_serif(1r,1'')..z1r.c{right}..z1r.a{left}..
	 z1+serif_bend..{left}cycle;
penlabels(1,2,3,4,5,6,7); labels(0,1',1'',2',2'',4',5');
);

iff known chars.latin_w:
bskchar "The letter w";
beginchar(chars.latin_w,14.5u#,x_height#,0); uni "0x0077";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_wcircumflex:
bskchar "The letter w with circumflex";
beginchar(chars.latin_wcircumflex,14.5u#,asc_height#-.1x_height#,0); uni "0x0175";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=x4'+o;
circumflex(100,101,102);
endchar;

iff known chars.latin_wgrave:
bskchar "The letter w with grave";
beginchar(chars.latin_wgrave,14.5u#,asc_height#,0); uni "0x1E81";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
.5[x100,x101]=x4'-u;
grave(100,101);
endchar;

iff known chars.latin_wacute:
bskchar "The letter w with acute";
beginchar(chars.latin_wacute,14.5u#,asc_height#,0); uni "0x1E83";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
.5[x100,x101]=x4';
acute(100,101);
endchar;

iff known chars.latin_wumlaut:
bskchar "The letter w with umlaut";
beginchar(chars.latin_wumlaut,14.5u#,asc_height#-dot_size#,0); uni "0x1E85";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x100=x1''; x101=x2'';
umlaut(100,101);
endchar;

iff known chars.latin_w_BB:
bskchar "The blackboard-bold letter w";
beginchar(chars.latin_w_BB,14.5u#,x_height#,0); uni "0x1D568";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric alpha[], right_stem, left_stem;
oblu:=2oblu;
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3=.5w if monospace: +.5(stem-hair) fi; 
top y3=h if monospace and (x2r-x1l<4stem): -1/3(x2r-x1l) else: +o fi;
.5[x4,x5]=x3; x5-x4=.35w;
bot y4=bot y5=-apex_o;
left_stem=.8cap_stem;
right_stem=hair;
alpha1=diag_ratio(1,left_stem,y1l-y4,x4-x1l);
alpha2=diag_ratio(1,right_stem,y2r-y5,x2r-x5);
alpha3=diag_ratio(1,left_stem,y3-y5,x5-x3);
alpha4=diag_ratio(1,right_stem,y3-y4,x3-x4);
pos1(alpha1*left_stem,0); pos2(alpha2*right_stem,0);
serifs_tl(1l); serifs_tr(1r);
serifs_tl(2l); serifs_tr(2r);
bot y1'=bot y2'=-o; z1'=z1r+whatever*(z1l-z4); z2'=z2l+whatever*(z2r-z5);
y5'=y4'=y3; x3-x5'=alpha3*(left_stem-tiny); x4'-x3=alpha4*(right_stem-tiny);
z0=whatever[z4,z4']=whatever[z5,z5'];
z2''=whatever[z2l,z2']=whatever[z3,z5+(x3-x5')*right];
z1''=whatever[z1r,z1']=whatever[z3,z4+(x4'-x3)*left];
filldraw z1l.a..{right}z1l.c..diag_serif(1l,4)---z4---obl(0,4,5)---z5
         ---diag_serif(2r,5)..{right}z2r.c..z2r.a---z2l.a..{right}z2l.c
	 ..diag_serif(2l,2')---obl(2'',2l,3)---z3---obl(1'',3,1r)
	 ---diag_serif(1r,1'')..z1r.c{right}..z1r.a{left}..
	 z1+serif_bend..{left}cycle;
oblu:=f_obl; oblu.more:=1.25oblu; oblu.m:=2oblu;
infill ifobl(1l,1r,4,1'',more,)---ifobl(1'',4,1r,1l,,)---cycle;
infill ifobl(0,3,5,2'',more,m)---ifobl(2'',5,3,0,,)---cycle;
penlabels(1,2,3,4,5,6,7); labels(0,1',1'',2',2'',4',5');
math_fit(0,ic#-2u#);
endchar;

iff known chars.latin_w_SS:
bskchar "The sans-serif letter w";
beginchar(chars.latin_w_SS,14.5u#,x_height#,0); uni "0x1D5D0";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric alpha[], right_stem, left_stem;
oblu:=2oblu;
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3=.5w if monospace: +.5(stem-hair) fi; 
top y3=h if monospace and (x2r-x1l<4stem): -1/3(x2r-x1l) else: +o fi;
.5[x4,x5]=x3; x5-x4=.35w;
bot y4=bot y5=-apex_o;
left_stem=stem;
right_stem=hair;
alpha1=diag_ratio(1,left_stem,y1l-y4,x4-x1l);
alpha2=diag_ratio(1,right_stem,y2r-y5,x2r-x5);
alpha3=diag_ratio(1,left_stem,y3-y5,x5-x3);
alpha4=diag_ratio(1,right_stem,y3-y4,x3-x4);
pos1(alpha1*left_stem,0); pos2(alpha2*right_stem,0);
serifs_tl(1l); serifs_tr(1r);
serifs_tl(2l); serifs_tr(2r);
bot y1'=bot y2'=-o; z1'=z1r+whatever*(z1l-z4); z2'=z2l+whatever*(z2r-z5);
y5'=y4'=y3; x3-x5'=alpha3*(left_stem-tiny); x4'-x3=alpha4*(right_stem-tiny);
z0=whatever[z4,z4']=whatever[z5,z5'];
z2''=whatever[z2l,z2']=whatever[z3,z5+(x3-x5')*right];
z1''=whatever[z1r,z1']=whatever[z3,z4+(x4'-x3)*left];
filldraw diag_serif(1l,4)---z4---obl(0,4,5)---z5---diag_serif(2r,5)...z2
         ...diag_serif(2l,2')---obl(2'',2l,3)---z3---obl(1'',3,1r)
	 ---diag_serif(1r,1'')...z1...cycle;
penlabels(1,2,3,4,5,6,7); labels(0,1',1'',2',2'',4',5');
math_fit(0,ic#-1u#);
endchar;

iff known chars.latin_x:
bskchar "The letter x";
beginchar(chars.latin_x,11.5u#,x_height#,0); uni "0x0078";
italcorr x_height#*slant-.25u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric alpha[];
oblu:=1.5oblu;
lft x1l=2.25u; top y1l=h; rt x2r=w-2u; bot y2r=0;
x3r=w-x1l; top y3r=h; lft x4l=2u; bot y4l=0;
alpha1=diag_ratio(2,stem,y1l-y2r,x1l-x2r);
alpha2=diag_ratio(1,hair,y3r-y4l,x3r-x4l);
pos1(alpha1*stem,0); pos2(alpha1*stem,0);
pos3(alpha2*hair,0); pos4(alpha2*hair,0);
serifs_tl(1l); serifs_tr(1r); serifs_bl(2l); serifs_br(2r);
serifs_tl(3l); serifs_tr(3r); serifs_bl(4l); serifs_br(4r);
z1'=whatever[z1l,z2l]=whatever[z3l,z4l]; 
z2'=whatever[z1r,z2r]=whatever[z3r,z4r];
z3'=whatever[z1r,z2r]=whatever[z3l,z4l];
z4'=whatever[z1l,z2l]=whatever[z3r,z4r]; 
filldraw z1l.a..{right}z1l.c..diag_serif(1l,2l)---obl(1',1l,4l)
         ---diag_serif(4l,1')..{left}z4l.c..z4l.a{right}..
	 z4+ser_boule*up..{right}z4r.a..{left}z4r.c
	 ..diag_serif(4r,4')---obl(4',4r,2l)---diag_serif(2l,1l)..
	 {left}z2l.c..z2l.a{right}..z2+ser_boule*up..{right}z2r.a..{left}z2r.c..
	 diag_serif(2r,1r)---obl(2',2r,3r)---diag_serif(3r,2')..
	 {right}z3r.c..{left}z3r.a..z3..{left}z3l.a..{right}z3l.c..
	 diag_serif(3l,3')---obl(3',3l,1r)---diag_serif(1r,3')..
	 {right}z1r.c..{left}z1r.a..z1+serif_bend..{left}cycle;
penlabels(1,2,3,4,4l.bb); labels(1',2',3',4',5');
endchar;

iff known chars.latin_x_BB:
bskchar "The blackboard-bold letter x";
beginchar(chars.latin_x_BB,11.5u#,x_height#,0); uni "0x1D569";
italcorr x_height#*slant-.25u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
save stem; stem:=.8cap_stem;
numeric alpha[];
oblu:=1.5oblu;
lft x1l=2.25u; top y1l=h; rt x2r=w-2u; bot y2r=0;
x3r=w-x1l; top y3r=h; lft x4l=2u; bot y4l=0;
alpha1=diag_ratio(2,stem,y1l-y2r,x1l-x2r);
alpha2=diag_ratio(1,hair,y3r-y4l,x3r-x4l);
pos1(alpha1*stem,0); pos2(alpha1*stem,0);
pos3(alpha2*hair,0); pos4(alpha2*hair,0);
serifs_tl(1l); serifs_tr(1r); serifs_bl(2l); serifs_br(2r);
serifs_tl(3l); serifs_tr(3r); serifs_bl(4l); serifs_br(4r);
z1'=whatever[z1l,z2l]=whatever[z3l,z4l]; 
z2'=whatever[z1r,z2r]=whatever[z3r,z4r];
z3'=whatever[z1r,z2r]=whatever[z3l,z4l];
z4'=whatever[z1l,z2l]=whatever[z3r,z4r]; 
filldraw z1l.a..{right}z1l.c..diag_serif(1l,2l)---obl(1',1l,4l)
         ---diag_serif(4l,1')..{left}z4l.c..z4l.a{right}..
	 z4+ser_boule*up..{right}z4r.a..{left}z4r.c
	 ..diag_serif(4r,4')---obl(4',4r,2l)---diag_serif(2l,1l)..
	 {left}z2l.c..z2l.a{right}..z2+ser_boule*up..{right}z2r.a..{left}z2r.c..
	 diag_serif(2r,1r)---obl(2',2r,3r)---diag_serif(3r,2')..
	 {right}z3r.c..{left}z3r.a..z3..{left}z3l.a..{right}z3l.c..
	 diag_serif(3l,3')---obl(3',3l,1r)---diag_serif(1r,3')..
	 {right}z1r.c..{left}z1r.a..z1+serif_bend..{left}cycle;
oblu:=f_obl; oblu.more:=1.25oblu;
bot y100=y2r.c; z100=whatever[z2r.bb,z1r];
infill ifobl(1r,1l,2r,2l,,more)---obl(2l,1r,2r)---z2r...obl(100,2r.c,1r)---cycle;
penlabels(1,2,3,4,4l.bb); labels(1',2',3',4',5',100);
endchar;

iff known chars.latin_x_SS:
bskchar "The sans-serif letter x";
beginchar(chars.latin_x_SS,11.5u#,x_height#,0); uni "0x1D5D1";
italcorr x_height#*slant-.25u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric alpha[];
oblu:=1.5oblu;
lft x1l=2.25u; top y1l=h; rt x2r=w-2u; bot y2r=0;
x3r=w-x1l; top y3r=h; lft x4l=2u; bot y4l=0;
alpha1=diag_ratio(2,stem,y1l-y2r,x1l-x2r);
alpha2=diag_ratio(1,hair,y3r-y4l,x3r-x4l);
pos1(alpha1*stem,0); pos2(alpha1*stem,0);
pos3(alpha2*hair,0); pos4(alpha2*hair,0);
serifs_tl(1l); serifs_tr(1r); serifs_bl(2l); serifs_br(2r);
serifs_tl(3l); serifs_tr(3r); serifs_bl(4l); serifs_br(4r);
z1'=whatever[z1l,z2l]=whatever[z3l,z4l]; 
z2'=whatever[z1r,z2r]=whatever[z3r,z4r];
z3'=whatever[z1r,z2r]=whatever[z3l,z4l];
z4'=whatever[z1l,z2l]=whatever[z3r,z4r]; 
filldraw diag_serif(1l,2l)---obl(1',1l,4l)---diag_serif(4l,1')...z4
         ...diag_serif(4r,4')---obl(4',4r,2l)---diag_serif(2l,1l)...z2
	 ...diag_serif(2r,1r)---obl(2',2r,3r)---diag_serif(3r,2')...z3
	 ...diag_serif(3l,3')---obl(3',3l,1r)---diag_serif(1r,3')...z1...cycle;
penlabels(1,2,3,4,4l.bb); labels(1',2',3',4',5');
endchar;

charscription(11.5u,x_height,desc_depth)(
numeric alpha, right_stem, left_stem, tim[]; oblu:=2oblu;
path p[];
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3l=.52w; bot y3l=-u;
left_stem=stem;
right_stem=hair;
alpha=diag_ratio(2,left_stem,y1l-y3l,x3l-x1l);
pos1(alpha*left_stem,0); pos2(alpha*right_stem,0);
pos1'(alpha*left_stem,0); pos2'(alpha*right_stem,0);
pos4(whatever,0); pos5(dot_size,260);
z1'l=z3l=z2'r;
z3'=whatever[z1'r,z1r]=whatever[z2'l,z2l]; 
y3'l=y3'r=y3'+.25[hair,stem]; 
z3'l=whatever[z3',z1r]; z3'r=whatever[z3',z2l];
serifs_tl(1l); serifs_tr(1r);
serifs_tr(2r); serifs_tl(2l);
y4=-d+dot_size+hair; z4l=whatever[z2l,z3']; z4r=whatever[z3l,z2r];
y6=y3'l; z6=whatever[z3l,z1l];
bot y5r=-d; x5=x1; rt z5'=(x5-1/3dot_size,y5); if rt x5'<u: x5':=lft u;fi
z4'=z3l+(alpha*right_stem-currentbreadth)*unitvector(z1l-z3l);
p0=z1l.a{left}..z1l.c{right}..diag_serif(1l,3l)--z4';
p1=z4'--z4l;
tim1=xpart(p0 intersectiontimes ((0,y6)--(w,y6)));
filldraw subpath(0,rundy(p0,infinity).zpet) of p0..subpath(rundy(p1,0),1) of p1
         ..{left}z5l..z5'..{right}z5r...z4r---z3l---
         diag_serif(2r,3l)..{right}z2r.c..z2r.a---z2l.a..{right}z2l.c
	 ..diag_serif(2l,3')---z3'r+oblu*unitvector(z2l-z3'r)..
	 z3'l+.75oblu*unitvector(z1r-z3'l)---diag_serif(1r,3')
	 ..z1r.c{right}..z1r.a{left}..z1+serif_bend..{left}cycle;
penlabels(1,1',2,2',3,3',4,5); labels(4',6);
);

iff known chars.latin_y:
bskchar "The letter y";
beginchar(chars.latin_y,11.5u#,x_height#,desc_depth#); uni "0x0079";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_ygrave:
bskchar "The letter y with grave";
beginchar(chars.latin_ygrave,11.5u#,asc_height#,desc_depth#); uni "0x1EF3";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=.5[x2l.c,x1r.c];
grave(100,101);
endchar;

iff known chars.latin_yacute:
bskchar "The letter y with acute";
beginchar(chars.latin_yacute,11.5u#,asc_height#,desc_depth#); uni "0x00FD";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x101=.5[x2l.c,x1r.c];
acute(100,101);
endchar;

iff known chars.latin_ymacron:
bskchar "The letter y with macron";
beginchar(chars.latin_ymacron,11.5u#,.5[asc_height#,x_height#],desc_depth#); uni "0x0233";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x100=x1r; x101=x2l;
macron(100,101);
endchar;

iff known chars.latin_yumlaut:
bskchar "The letter y with umlaut";
beginchar(chars.latin_yumlaut,11.5u#,asc_height#-dot_size#,desc_depth#); uni "0x00FF";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
x100=x1r; x101=x2l;
umlaut(100,101);
endchar;

iff known chars.latin_ycircumflex:
bskchar "The letter y with circumflex";
beginchar(chars.latin_ycircumflex,11.5u#,asc_height#-.1x_height#,desc_depth#); uni "0x0177";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
usechar;
numeric oblu; oblu:=hair;
x101=x3';
circumflex(100,101,102);
endchar;

iff known chars.latin_y_BB:
bskchar "The blackboard-bold letter y";
beginchar(chars.latin_y_BB,11.5u#,x_height#,desc_depth#); uni "0x1D56A";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric alpha, right_stem, left_stem, tim[]; oblu:=2oblu;
path p[];
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3l=.52w; bot y3l=-u;
left_stem=.8cap_stem;
right_stem=hair;
alpha=diag_ratio(2,left_stem,y1l-y3l,x3l-x1l);
pos1(alpha*left_stem,0); pos2(alpha*right_stem,0);
pos1'(alpha*left_stem,0); pos2'(alpha*right_stem,0);
pos4(whatever,0); pos5(dot_size,260);
z1'l=z3l=z2'r;
z3'=whatever[z1'r,z1r]=whatever[z2'l,z2l]; 
y3'l=y3'r=y3'+.25[hair,stem]; 
z3'l=whatever[z3',z1r]; z3'r=whatever[z3',z2l];
serifs_tl(1l); serifs_tr(1r);
serifs_tr(2r); serifs_tl(2l);
y4=-d+dot_size+hair; z4l=whatever[z2l,z3']; z4r=whatever[z3l,z2r];
y6=y3'l; z6=whatever[z3l,z1l];
bot y5r=-d; x5=x1; rt z5'=(x5-1/3dot_size,y5); if rt x5'<u: x5':=lft u;fi
z4'=z3l+(alpha*right_stem-currentbreadth)*unitvector(z1l-z3l);
p0=z1l.a{left}..z1l.c{right}..diag_serif(1l,3l)--z4';
p1=z4'--z4l;
tim1=xpart(p0 intersectiontimes ((0,y6)--(w,y6)));
filldraw subpath(0,rundy(p0,infinity).zpet) of p0..subpath(rundy(p1,0),1) of p1
         ..{left}z5l..z5'..{right}z5r...z4r---z3l---
         diag_serif(2r,3l)..{right}z2r.c..z2r.a---z2l.a..{right}z2l.c
	 ..diag_serif(2l,3')---z3'r+oblu*unitvector(z2l-z3'r)..
	 z3'l+.75oblu*unitvector(z1r-z3'l)---diag_serif(1r,3')
	 ..z1r.c{right}..z1r.a{left}..z1+serif_bend..{left}cycle;
oblu:=f_obl; oblu.more:=1.25oblu;
infill ifobl(1l,1r,4',3',more,)---ifobl(3',4',1r,1l,,)---cycle;
penlabels(1,1',2,2',3,3',4,5); labels(4',6);
math_fit(0,ic#-2u#);
endchar;

iff known chars.latin_y_SS:
bskchar "The sans-serif letter y";
beginchar(chars.latin_y_SS,11.5u#,x_height#,desc_depth#); uni "0x1D5D2";
italcorr x_height#*slant;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny.nib;
numeric alpha, right_stem, left_stem, tim[]; oblu:=2oblu;
path p[];
lft x1l=2u; rt x2r=w-2u; top y1l=top y2r=h;
x3l=.52w; bot y3l=-u;
left_stem=stem;
right_stem=hair;
alpha=diag_ratio(2,left_stem,y1l-y3l,x3l-x1l);
pos1(alpha*left_stem,0); pos2(alpha*right_stem,0);
pos1'(alpha*left_stem,0); pos2'(alpha*right_stem,0);
pos4(whatever,0); pos5(stem,260);
z1'l=z3l=z2'r;
z3'=whatever[z1'r,z1r]=whatever[z2'l,z2l]; 
y3'l=y3'r=y3'+.25[hair,stem]; 
z3'l=whatever[z3',z1r]; z3'r=whatever[z3',z2l];
serifs_tl(1l); serifs_tr(1r);
serifs_tr(2r); serifs_tl(2l);
y4=-d+dot_size+hair; z4l=whatever[z2l,z3']; z4r=whatever[z3l,z2r];
y6=y3'l; z6=whatever[z3l,z1l];
bot y5r=-d; x5=x1; rt z5'=(x5-1/3dot_size,y5); if rt x5'<u: x5':=lft u;fi
z4'=z3l+(alpha*right_stem-currentbreadth)*unitvector(z1l-z3l);
p0=diag_serif(1l,3l)--z4';
p1=z4'--z4l;
tim1=xpart(p0 intersectiontimes ((0,y6)--(w,y6)));
filldraw subpath(0,rundy(p0,infinity).zpet) of p0..subpath(rundy(p1,0),1) of p1
         ..{left}z5l..z5'..{right}z5r...z4r---z3l---
         diag_serif(2r,3l)...z2
	 ...diag_serif(2l,3')---z3'r+oblu*unitvector(z2l-z3'r)..
	 z3'l+.75oblu*unitvector(z1r-z3'l)---diag_serif(1r,3')
	 ...z1...cycle;
penlabels(1,1',2,2',3,3',4,5); labels(4',6);
math_fit(0,ic#-1u#);
endchar;

charscription(9u,x_height,0)(
oblu:=2oblu;
numeric alpha;
lft x1l=u; bot y1l=0; rt x2r=w-u; top y2r=h;
x2r-x2l=x1r-x1l;
alpha=diag_ratio(2,stem,y2r-y1l,x2r-x1l);
pos1(alpha*stem,0); pos2(alpha*stem,0);
pos3(.5beak,80); pos4(.6beak,80);
z3a=z3r+hair*right; z3b=z3r+(stem,-hair+currentbreadth);
x3l=1.3u; top y3r=h; z3c=z3l+(hair-currentbreadth)*dir(angle(z3l-z3)+90);
y2'=y2-hair+currentbreadth; z2'=whatever[z2l,z1l];
y1'=y1+hair-currentbreadth; z1'=whatever[z2r,z1r];
bot y4l=0; x4r=w-u; z4b=z4r+(hair-currentbreadth)*dir(angle(z4l-z4)-90);
y4a=y4l+hair-currentbreadth; x4a=.5w;
filldraw z2r---z3a..z3r---z3l..z3c{dir80}..z3b---obl(2',3b,1l)---z1l---z4l
---z4r..{down}z4b...if not bold_face: z4a--- else: {left}fi obl(1',4a,2r)---cycle;
penlabels(1,2,3,4); labels(1',2',3a,3b,3c,4a,4b,4c);
);

iff known chars.latin_z:
bskchar "The letter z";
beginchar(chars.latin_z,9u#,x_height#,0); uni "0x007A";
italcorr x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.latin_zcaron:
bskchar "The letter z with caron";
beginchar(chars.latin_zcaron,9u#,asc_height#,0); uni "0x017E";
italcorr asc_height#*slant-.5u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x101=.5[x3r,x2r];
hacek(100,101,102);
endchar;

iff known chars.latin_zdotabove:
bskchar "The letter z with dot above";
beginchar(chars.latin_zdotabove,9u#,asc_height#-.5dot_size#,0); uni "0x017C";
italcorr x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
x100=.5[x3r,x2r];
dotabove(100);
endchar;

iff known chars.latin_zacute:
bskchar "The letter z with acute";
beginchar(chars.latin_zacute,9u#,asc_height#,0); uni "0x017A";
italcorr x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
.25[x101,x100]=.5[x3r,x2r];
acute(100,101);
endchar;

iff known chars.latin_z_BB:
bskchar "The blackboard-bold letter z";
beginchar(chars.latin_z_BB,9u#,x_height#,0); uni "0x1D56B";
italcorr x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
oblu:=2oblu;
numeric alpha;
lft x1l=u; bot y1l=0; rt x2r=w-u; top y2r=h;
x2r-x2l=x1r-x1l;
alpha=diag_ratio(2,.8cap_stem,y2r-y1l,x2r-x1l);
pos1(alpha*.8cap_stem,0); pos2(alpha*.8cap_stem,0);
pos3(.5beak,80); pos4(.6beak,80);
z3a=z3r+hair*right; z3b=z3r+(stem,-hair+currentbreadth);
x3l=1.3u; top y3r=h; z3c=z3l+(hair-currentbreadth)*dir(angle(z3l-z3)+90);
y2'=y2-hair+currentbreadth; z2'=whatever[z2l,z1l];
y1'=y1+hair-currentbreadth; z1'=whatever[z2r,z1r];
bot y4l=0; x4r=w-u; z4b=z4r+(hair-currentbreadth)*dir(angle(z4l-z4)-90);
y4a=y4l+hair-currentbreadth; x4a=.5w;
filldraw z2r---z3a..z3r---z3l..z3c{dir80}..z3b---obl(2',3b,1l)---z1l---z4l
---z4r..{down}z4b...if not bold_face: z4a--- else: {left}fi obl(1',4a,2r)---cycle;
oblu:=f_obl; oblu.more:=2oblu;
infill ifobl(2l,2r,1l,1r,,more)---ifobl(1',1l,2r,2l,,)---cycle;
penlabels(1,2,3,4); labels(1',2',3a,3b,3c,4a,4b,4c);
endchar;

iff known chars.latin_z_SS:
bskchar "The sans-serif letter z";
beginchar(chars.latin_z_SS,9u#,x_height#,0); uni "0x1D5D3";
italcorr x_height#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
oblu:=2oblu;
numeric alpha;
lft x1l=u; bot y1l=0; rt x2r=w-u; top y2r=h;
x2r-x2l=x1r-x1l;
alpha=diag_ratio(2,stem,y2r-y1l,x2r-x1l);
pos1(alpha*stem,0); pos2(alpha*stem,0);
pos3(hair,90); pos4(hair,90);
x3l=1.3u; top y3r=h; 
y2'=y2-hair+currentbreadth; z2'=whatever[z2l,z1l];
y1'=y1+hair-currentbreadth; z1'=whatever[z2r,z1r];
bot y4l=0; x4r=w-u; 
filldraw z2r---z3r+stem*right...z3...z3l+stem*right---obl(2',3l,1l)---z1l
         ---z4l+stem*left...z4...z4r+stem*left---obl(1',4r,2r)---cycle;
penlabels(1,2,3,4); labels(1',2');
endchar;

bskboundary;

skal:=.5;
charscription(figwu(if medieval: 9.5u else: 11u fi),medfigu,0)(
numeric sair; sair=if medieval: vair else: hair fi;
pos1(curve,0); pos2(sair,90); pos3(curve,180); pos4(sair,270);
lft x1l=u; rt x3l=w-u; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; x2-x4=0; bot y2l=-o; top y4l=h+o;
filldraw z1l{down}..z2l..z3l..z4l..{down}cycle;
infill z1r{up}..z4r..z3r..z2r..{up}cycle;
penlabels(1,2,3,4);
);

iff known chars.numeral_zero:
bskchar "The numeral 0";
beginchar(chars.numeral_zero,figw(if medieval: 9.5u else: 11u fi),medfig,0); uni "0x0030";
italcorr .5h#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.superscript_numeral_zero:
bskchar "The superscript numeral 0";
beginchar(chars.superscript_numeral_zero,if monofig: 5.5u# else: if medieval: 5.75u# else:6.5u#fi fi,asc_height#,0); uni "0x2070";
italcorr (asc_height#-x_height#)*slant;
adjust_fit(0,0);
pickup tiny.nib;
multiply(1.7skal)(curve,hair,vair);
usechar shifted (-x1l,0) scaled skal shifted (u+(HH-skal*fig_height)*slant,HH-skal*fig_height);
endchar;

iff known chars.numeral_zero_BB:
bskchar "The blackboard-bold numeral 0";
beginchar(chars.numeral_zero_BB,figw(if medieval: 9.5u else: 11u fi),medfig,0); uni "0x1D7D8";
italcorr .5h#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
numeric sair; sair=if medieval: vair else: hair fi;
pos1(cap_stem,0); pos2(sair,90); pos3(cap_stem,180); pos4(sair,270);
lft x1l=u; rt x3l=w-u; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; x2-x4=0; bot y2l=-o; top y4r=h+o;
filldraw z1l{down}..z2l..z3l..z4l..{down}cycle;
infill z1r{up}..z4r..z3r..z2r..{up}cycle;
path p[]; numeric tim[];
p100:=z4r..z1r{down}..z2r..z3r..cycle;
p101:=reverse z4l..z1l{down}..z2l..z3l..cycle;
oblu:=1.25bbw;
z100=bsktouch(subpath(0,1) of p100,up,p101,down);
z101=bsktouch(subpath(1,2) of p100,down,p101,up);
z102=bsktouch(subpath(3,4) of p100,up,p101,down);
z103=bsktouch(subpath(2,3) of p100,down,p101,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y1)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y4l+5)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y1)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y2l-5)));
tim104=xpart(p100 intersectiontimes (z102--(x102,y1)));
tim105=xpart(p101 intersectiontimes (z102--(x102,y4l+5)));
tim106=xpart(p100 intersectiontimes (z103--(x103,y1)));
tim107=xpart(p101 intersectiontimes (z103--(x103,y2l-5)));
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103).zpet,rundy(p101,tim101)) of p101..cycle;
infill subpath(rundy(p100,tim104).zpet,rundy(p100,tim106)) of p100
       ..subpath(rundy(p101,tim107),rundy(p101,tim105).zpet) of p101..cycle;
labels(100,101,102,103);
penlabels(1,2,3,4);
endchar;

iff known chars.numeral_zero_SS:
bskchar "The sans-serif numeral 0";
beginchar(chars.numeral_zero_SS,figw(if medieval: 9.5u else: 11u fi),medfig,0); uni "0x1D7E2";
italcorr .5h#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
pos1(curve,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
lft x1l=u; rt x3l=w-u; y1=y3=.5h; .5[x2,x4]=.5[x1,x3]; x2-x4=0; bot y2l=-o; top y4l=h+o;
filldraw z1l{down}..z2l..z3l..z4l..{down}cycle;
infill z1r{up}..z4r..z3r..z2r..{up}cycle;
penlabels(1,2,3,4);
endchar;

charscription(figwu(if medieval: 9.5u else: 11u fi),medfigu,0)(
path p;
numeric sair; sair=if medieval: vair else: hair fi;
pos1(curve,0); pos2(sair,90); pos3(curve,180); pos4(sair,270);
lft x1l=u; rt x3l=w-u; y1=y3=y0=.5h; .5[x2,x4]=.5[x1,x3]=x0; x2-x4=0; bot y2l=-o; top y4r=h+o;
p:=z1r{up}..z4r..z3r..z2r..{up}cycle;
z5=p intersectionpoint ((x0,.25[y4r,y3])--(w,.25[y4r,y3])); z6=z5+stem*unitvector(z0-z5); .5[z6,z7]=z0;
pos6(hair,angle(z7-z6)+90); pos7(hair,angle(z7-z6)+90);
filldraw z1l{down}..z2l..z3l..z4l..{down}cycle;
infill p;
filldraw bskrule(6,7,hair,hair);
penlabels(0,1,2,3,4,5,6,7);
);

iff known chars.numeral_zero_slash:
bskchar "The numeral 0 with slash";
beginchar(chars.numeral_zero_slash,figw(if medieval: 9.5u else: 11u fi),medfig,0); uni "non";
italcorr .5h#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.superscript_numeral_zero_slash:
bskchar "The superscript numeral 0 with slash";
beginchar(chars.superscript_numeral_zero_slash,if monofig: 5.5u# else: if medieval: 5.75u# else:6.5u#fi fi,asc_height#,0); uni "non";
italcorr (asc_height#-x_height#)*slant;
adjust_fit(0,0);
pickup tiny.nib;
multiply(1.7skal)(curve,hair,vair);
usechar shifted (-x1l,0) scaled skal shifted (u+(HH-skal*fig_height)*slant,HH-skal*fig_height);
endchar;

charscription(figwu(8u),medfigu,0)(
pos1(dig_stem,0); pos2(dig_stem,0);
pos3(hair,90);
oblu:=f_obl;
x1=.5w; bot y1=0; x2=x1; top y2=h;
lft x3=u; x4=x1l; 
if medieval:
  y3=y2-if monofig: 1.5 \\fi hair; y4=y3-.5o;
  filldraw one_serif(1)---z2r--z2{dir200}..{left}z3r..z3l---obl(4,3l,1l)--cycle;
else:
  y3=.9h-o; y4=y3+o;
  path p[]; p1=z3l{right}..z4; p0=z4---one_serif(1);
  filldraw subpath(rundy(p0,0),infinity) of p0---z2r{dir200}..{left}z3r..
           subpath(0,rundy(p1,1).zpet) of p1..cycle;
fi
penlabels(1,2,3); labels(4);
);

let _saved_char_one=_saved_char;
numeric _saved_w_one; _saved_w_one:=_saved_w;

iff known chars.numeral_one:
bskchar "The numeral 1";
beginchar(chars.numeral_one,figw(8u),medfig,0); uni "0x0031";
adjust_fit(0,serif_fit#);
pickup tiny.nib;
usechar;
endchar;

iff known chars.superscript_numeral_one:
bskchar "The superscript numeral 1";
beginchar(chars.superscript_numeral_one,if monofig: 5.5u# else: 5u# fi,asc_height#,0); uni "0x00B9";
adjust_fit(0,0);
pickup tiny.nib;
multiply(1.7skal)(curve,hair,vair,serif_o,dig_stem);
usechar shifted (-x3,0) scaled skal shifted (u+(HH-skal*fig_height)*slant,HH-skal*fig_height);
endchar;

iff known chars.numeral_one_BB:
bskchar "The blackboard-bold numeral 1";
beginchar(chars.numeral_one_BB,figw(8u),medfig,0); uni "0x1D7D9";
adjust_fit(0,serif_fit#);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0);
pos3(hair,90);
oblu:=f_obl;
x1=.5w; bot y1=0; x2=x1; top y2=h;
lft x3=u; x4=x1l; 
if medieval:
  y3=y2-if monofig: 1.5 \\fi hair; y4=y3-.5o;
  filldraw one_serif(1)---z2r--z2{dir200}..{left}z3r..z3l---obl(4,3l,1l)--cycle;
else:
  y3=.9h-o; y4=y3+o;
  path p[]; p1=z3l{right}..z4; p0=z4---one_serif(1);
  filldraw subpath(rundy(p0,0),infinity) of p0---z2r{dir200}..{left}z3r..
           subpath(0,rundy(p1,1).zpet) of p1..cycle;
fi
bot z100=(x1l,y1f);
infill ifobl(4,2r,1l,1r,,)---obl(1r,2r,1l)---z1l...obl(100,1f,2l)---cycle;
penlabels(1,2,3); labels(4);
endchar;

iff known chars.numeral_one_SS:
bskchar "The sans-serif numeral 1";
beginchar(chars.numeral_one_SS,figw(8u),medfig,0); uni "0x1D7E3";
adjust_fit(0,serif_fit#-1.5u#);
pickup tiny.nib;
pos1(stem,0); pos2(stem,0);
pos3(hair,90);
oblu:=f_obl;
x1=.5w; bot y1=0; x2=x1; top y2=h;
lft x3=u; x4=x1l; 
y3=y2-hair; y4=y3-.5o; z1a=z1l+.75u*up; z1b=z1r+.75u*up;
filldraw z1a..z1..z1b---z2r--z2{dir200}..{left}z3r..z3l---obl(4,3l,1l)---cycle;
penlabels(1,2,3); labels(4);
endchar;

charscription(figwu(if medieval: 9u else: 10u fi),medfigu,0)(
path p[];  oblu:=3f_obl;
pos1(.45[hair,stem],180); pos2(hair,90); pos3(curve,0); pos0(vair,-60);
lft x1r=u; y1=2/3h+hair; top y2r=h+o; x2=.5w-hair; y0l=y1-2hair; x0=.35[x2,x1];
rt x3r=w-if medieval:1.5\\ fi u; y3=2/3h; lft x4l=u; bot y4l=0; 
rt x8=w-u; y8=stem-tiny; y7=-hair; z7=z8+whatever*dir-135;
x6=x7-hair; bot y6=0; 
p0:=z4l{dir if medieval: 40 else:20 fi}..{up}z3l;
z4r=(((0,y8)--(w,y8)) intersectionpoint p0)+vair*right;
p1:=z3r{down}..{dir-140}z4r;
p2=z4r--z8;
filldraw p0..z2l{left}..z1l..{dir60}z0l..{dir-120}z0r..z1r..{right}z2r..
         subpath(0,rundy(p1,(1,curve)).zpet) of p1..subpath(rundy(p2,(0,curve)),infinity) of p2&z8
         ..{dir(angle(z7-z8)+15)}z7+.25vair*right..z7{up}..z6---cycle;
penlabels(0,1,2,3,4); labels(6,7,8);
);

iff known chars.numeral_two:
bskchar "The numeral 2";
beginchar(chars.numeral_two,figw(if medieval: 9u else: 10u fi),medfig,0); uni "0x0032";
italcorr 2/3h#*slant-.75u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.superscript_numeral_two:
bskchar "The superscript numeral 2";
beginchar(chars.superscript_numeral_two,if monofig: 5.5u# else: if medieval: 5.5u# else: 6u# fi fi,asc_height#,0); uni "0x00B2";
adjust_fit(0,0);
pickup tiny.nib;
multiply(1.7skal)(curve,hair,vair);
usechar shifted (-x1r,0) scaled skal shifted (u+(HH-skal*fig_height)*slant,HH-skal*fig_height);
endchar;

iff known chars.fraction_one_half:
bskchar "Fraction one half";
beginchar(chars.fraction_one_half,5.5u#,asc_height#,0); uni "0x00BD";
adjust_fit(0,0);
pickup tiny.nib;
numeric zv; zv:=if medieval: .5 else: .4 fi;
multiply(1.7zv)(curve,hair,vair);
usechar shifted (-x2-hair,0) scaled zv shifted (.5WW,0);
save x,y;
let _saved_char=_saved_char_one;
_saved_w:=_saved_w_one;
usechar shifted -(x1,0) scaled zv shifted (.5WW+(HH-zv*fig_height)*slant,HH-zv*fig_height);
pos10(hair,90); pos11(hair,90);
lft x10=u; rt x11=w-u; y10=y11=if medieval: bar_height else: .5[x_height,bar_height] fi if bold_face: + .5hair fi;
filldraw bskrule(10,11,hair,hair);
penlabels(10,11);
endchar;

iff known chars.numeral_two_BB:
bskchar "The blackboard-bold numeral 2";
beginchar(chars.numeral_two_BB,figw(if medieval: 9u else: 10u fi),medfig,0); uni "0x1D7DA";
italcorr 2/3h#*slant-.75u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=3f_obl;
pos1(.45[hair,stem],180); pos2(hair,90); pos3(cap_stem,0); pos0(vair,-60);
lft x1r=u; y1=2/3h+hair; top y2r=h+o; x2=.5w-hair; y0l=y1-2hair; x0=.35[x2,x1];
rt x3r=w-if medieval:1.5\\ fi u; y3=2/3h; lft x4l=u; bot y4l=0; 
rt x8=w-u; y8=stem-tiny; y7=-hair; z7=z8+whatever*dir-135;
x6=x7-hair; bot y6=0; 
p0:=z4l{dir if medieval: 40 else:20 fi}..{up}z3l;
z4r=(((0,y8)--(w,y8)) intersectionpoint p0)+.5cap_stem*right;
p1:=z3r{down}..{dir-140}z4r;
p2=z4r--z8;
filldraw p0..z2l{left}..z1l..{dir60}z0l..{dir-120}z0r..z1r..{right}z2r..
         subpath(0,rundy(p1,(1,curve)).zpet) of p1..subpath(rundy(p2,(0,curve)),infinity) of p2&z8
         ..{dir(angle(z7-z8)+15)}z7+.25vair*right..z7{up}..z6---cycle;
p100:=p0..{left}z2l;
p101:=z2r{right}..p1;
z100=bsktouch(p100,up,subpath(0,1) of p101,down);
tim100=xpart(p100 intersectiontimes (z100--(x100,y3)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y2r+5)));
z101=bsktouch(subpath(0,1) of p100,2dir-45,p101,2dir135);
tim102=xpart(p100 intersectiontimes (z101--(0,y101)));
tim103=xpart(p101 intersectiontimes (z101--(w,y101)));
oblu:=bbw;
infill subpath(rundy(p101,tim101),rundy(p101,(tim103,.8oblu)).zpet) of p101
       ..subpath(rundy(p100,(tim102,.8oblu)),rundy(p100,tim100).zpet) of p100
       ..cycle;
penlabels(0,1,2,3,4); labels(6,7,8,100,101);
endchar;

iff known chars.numeral_two_SS:
bskchar "The sans-serif numeral 2";
beginchar(chars.numeral_two_SS,figw(if medieval: 9u else: 10u fi),medfig,0); uni "0x1D7E4";
italcorr 2/3h#*slant-.75u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[];  oblu:=3f_obl;
pos1(.45[hair,stem],180); pos2(hair,90); pos3(curve,0); pos0(hair,-60);
lft x1r=u; y1=2/3h+hair; top y2r=h+o; x2=.5w-hair; y0l=y1-2hair; x0=.35[x2,x1];
rt x3r=w-if medieval:1.5\\ fi u; y3=2/3h; lft x4l=u; bot y4l=0; 
rt x8=w-u; y8=stem-tiny; y7=-hair; z7=z8+whatever*dir-135;
x6=x7-hair; bot y6=0; 
p0:=z4l{dir if medieval: 40 else:20 fi}..{up}z3l;
z4r=(((0,y8)--(w,y8)) intersectionpoint p0)+vair*right;
p1:=z3r{down}..{dir-140}z4r;
p2=z4r--z8;
filldraw p0..z2l{left}..z1l..{dir60}z0l..{dir-120}z0r..z1r..{right}z2r..
         subpath(0,rundy(p1,(1,curve)).zpet) of p1..subpath(rundy(p2,(0,curve)),infinity) of p2&z8...(x7,y6)---cycle;
penlabels(0,1,2,3,4); labels(6,7,8);
endchar;

charscription(figwu(9.5u),medfigu,medfigdu)(
numeric tim[]; oblu:=if bold_face: 2f_obl else: 4f_obl fi; 
path p[];
pos1(.45[hair,stem],180); pos2(hair,90); pos3(curve,0); pos4(.45[hair,stem],0); pos0(vair,-60);
pos5(hair,90); pos6(curve,0); pos7(like_hair,270); 
lft x1r=1.5u; y1=y3+hair; top y2r=h+o; x2=.5w-hair; y0l=y3-hair; x0=.35[x2,x1];
rt x3r=w-1.75u; y3=if medieval: 2/3h else: .8h fi; lft x4l=1.5u; 
bot y4l=.5(h-d); z4'=(x4l,y4l-like_hair);
x5=.5w; y5=y4+hair; rt x6r=w-u; y6=.5[y4,-d];
x7=.55[x5,x4]; bot y7r=-d; rt x8r=u; y8=y7+1.25like_stem;
p0=z4l{dir40}..{up}z3l..z2l{left}..z1l..{dir60}z0l;
p1=z0l{dir60}..{dir-120}z0r..z1r..{right}z2r..z3r{down}..{dir-140}z4r..z4'..{dir40}z4l;
p2=z4l..z5r..z6r..z7r..smitko(8,curve)..z7l..z6l..z5l..z4';
p3=subpath(3,infinity) of p2;
z9=bsktouch(p1,down,p2,up);
tim1-3=xpart(subpath(3,infinity) of p1 intersectiontimes (z9--(x9,y3)));
tim2=xpart(p2 intersectiontimes (z9--(x9,y6)));
(tim3,tim4-3)=p1 intersectiontimes p3;
filldraw p0..subpath(0,rundy(p1,tim1).zpet) of p1
         ..subpath(rundy(p2,tim2),rundy(p2,(tim4,f_obl)).zpet) of p2
	 ..subpath(tim3,infinity) of p1
	 ..cycle;
penlabels(0,1,2,3,4,5,6,7,8); labels(4',9);
);

let _saved_char_three=_saved_char;
numeric _saved_w_three; _saved_w_three:=_saved_w;

iff known chars.numeral_three:
bskchar "The numeral 3";
beginchar(chars.numeral_three,figw(9.5u),medfig,medfigd); uni "0x0033";
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.superscript_numeral_three:
bskchar "The superscript numeral 3";
beginchar(chars.superscript_numeral_three,if monofig: 5.5u# else: 5.75u# fi,asc_height#,0); uni "0x00B3";
adjust_fit(0,0);
pickup tiny.nib;
multiply(1.7skal)(curve,hair,stem,like_hair,like_stem);
usechar shifted (-x8r,0) scaled skal shifted (u+(HH-skal*fig_height)*slant,HH-skal*fig_height);
endchar;

iff known chars.fraction_one_third:
bskchar "Fraction one third";
beginchar(chars.fraction_one_third,5.5u#,asc_height#,0); uni "0x2153";
adjust_fit(0,0);
pickup tiny.nib;
numeric zv; zv:=if medieval: .5 else: .4 fi;
multiply(1.7zv)(curve,hair,stem,like_hair,like_stem);
usechar shifted (-x2-hair,0) scaled zv shifted (.5WW,0);
save x,y;
let _saved_char=_saved_char_one;
_saved_w:=_saved_w_one;
usechar shifted -(x1,0) scaled zv shifted (.5WW+(HH-zv*fig_height)*slant,HH-zv*fig_height);
pos10(hair,90); pos11(hair,90);
lft x10=u; rt x11=w-u; y10=y11=if medieval: bar_height else: .5[x_height,bar_height] fi if bold_face: + .5hair fi;
filldraw bskrule(10,11,hair,hair);
penlabels(10,11);
endchar;

iff known chars.numeral_three_BB:
bskchar "The blackboard-bold numeral 3";
beginchar(chars.numeral_three_BB,figw(9.5u),medfig,medfigd); uni "0x1D7DB";
adjust_fit(0,0);
pickup tiny.nib;
numeric tim[]; oblu:=if bold_face: 2f_obl else: 4f_obl fi; 
path p[];
pos1(.45[hair,stem],180); pos2(hair,90); pos3(cap_stem,0); pos4(.45[hair,stem],0); pos0(vair,-60);
pos5(hair,90); pos6(cap_stem,0); pos7(like_hair,270); 
lft x1r=1.5u; y1=y3+hair; top y2r=h+o; x2=.5w-hair; y0l=y3-hair; x0=.35[x2,x1];
rt x3r=w-1.75u; y3=if medieval: 2/3h else: .8h fi; lft x4l=1.5u; 
bot y4l=.5(h-d); z4'=(x4l,y4l-like_hair);
x5=.5w; y5=y4+hair; rt x6r=w-u; y6=.5[y4,-d];
x7=.55[x5,x4]; bot y7r=-d; rt x8r=u; y8=y7+1.25like_stem;
p0=z4l{dir40}..{up}z3l..z2l{left}..z1l..{dir60}z0l;
p1=z0l{dir60}..{dir-120}z0r..z1r..{right}z2r..z3r{down}..{dir-140}z4r..z4'..{dir40}z4l;
p2=z4l..z5r..z6r..z7r..smitko(8,curve)..z7l..z6l..z5l..z4';
p3=subpath(3,infinity) of p2;
z9=bsktouch(p1,down,p2,up);
tim1-3=xpart(subpath(3,infinity) of p1 intersectiontimes (z9--(x9,y3)));
tim2=xpart(p2 intersectiontimes (z9--(x9,y6)));
(tim3,tim4-3)=p1 intersectiontimes p3;
filldraw p0..subpath(0,rundy(p1,tim1).zpet) of p1
         ..subpath(rundy(p2,tim2),rundy(p2,(tim4,f_obl)).zpet) of p2
	 ..subpath(tim3,infinity) of p1
	 ..cycle;
p100:=subpath(0,2) of p0;
p101:=subpath(3,5) of p1;
p102:=subpath(1,3) of p2;
p103:=subpath(5,infinity) of p2;
z100=bsktouch(p100,up,subpath(0,1) of p101,down);
tim100=xpart(p100 intersectiontimes (z100--(x100,y3)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y2r+5)));
z101=bsktouch(subpath(0,1) of p100,dir-50,p101,dir120);
tim102=xpart(p100 intersectiontimes (z101--(0,y101)));
tim103=xpart(p101 intersectiontimes (z101--(w,y101)));
z102=bsktouch(p102,down,p103,up);
tim104=xpart(p102 intersectiontimes (z102--(x102,y5r+5)));
tim105=xpart(p103 intersectiontimes (z102--(x102,y6)));
z103=bsktouch(p102,bbs*up,p103,down);
tim106=xpart(p102 intersectiontimes (z103--(x103,y7r-u)));
tim107=xpart(p103 intersectiontimes (z103--(x103,y6)));
oblu:=bbw;
infill subpath(rundy(p101,tim101),rundy(p101,tim103).zpet) of p101
       ..subpath(rundy(p100,tim102),rundy(p100,tim100).zpet) of p100
       ..cycle;
infill subpath(rundy(p103,tim107),rundy(p103,tim105).zpet) of p103
       ..reverse subpath(rundy(p102,tim106).zpet,rundy(p102,tim104)) of p102
       ..cycle;
penlabels(0,1,2,3,4,5,6,7,8); labels(4',9,100,101,102,103);
endchar;

iff known chars.numeral_three_SS:
bskchar "The sans-serif numeral 3";
beginchar(chars.numeral_three_SS,figw(9.5u),medfig,medfigd); uni "0x1D7E5";
adjust_fit(0,0);
pickup tiny.nib;
numeric tim[]; oblu:=if bold_face: 2f_obl else: 4f_obl fi; 
path p[];
pos1(.45[hair,stem],180); pos2(hair,90); pos3(curve,0); pos4(.45[hair,stem],0); pos0(hair,-60);
pos5(hair,90); pos6(curve,0); pos7(hair,270); pos8(curve,150); 
lft x1r=1.5u; y1=y3+hair; top y2r=h+o; x2=.5w-hair; y0l=y3-hair; x0=.35[x2,x1];
rt x3r=w-1.75u; y3=if medieval: 2/3h else: .8h fi; lft x4l=1.5u; 
bot y4l=.5(h-d); z4'=(x4l,y4l-like_hair);
x5=.5w; y5=y4+hair; rt x6r=w-u; y6=.5[y4,-d];
x7=.55[x5,x4]; bot y7r=-d; rt x8r=u; y8=y7+1.25like_stem;
p0=z4l{dir40}..{up}z3l..z2l{left}..z1l..{dir60}z0l;
p1=z0l{dir60}..{dir-120}z0r..z1r..{right}z2r..z3r{down}..{dir-140}z4r..z4'..{dir40}z4l;
p2=z4l..z5r..z6r..z7r..{up}z8r..{down}z8l..z7l..z6l..z5l..z4';
p3=subpath(3,infinity) of p2;
z9=bsktouch(p1,down,p2,up);
tim1-3=xpart(subpath(3,infinity) of p1 intersectiontimes (z9--(x9,y3)));
tim2=xpart(p2 intersectiontimes (z9--(x9,y6)));
(tim3,tim4-3)=p1 intersectiontimes p3;
filldraw p0..subpath(0,rundy(p1,tim1).zpet) of p1
         ..subpath(rundy(p2,tim2),rundy(p2,(tim4,f_obl)).zpet) of p2
	 ..subpath(tim3,infinity) of p1
	 ..cycle;
penlabels(0,1,2,3,4,5,6,7,8); labels(4',9);
endchar;

charscription(figwu(12u),medfigu,medfigdu)(
oblu:=2f_obl; oblu.light:=.5oblu;
pos1(dig_stem,0); pos2(dig_stem,0); pos4(hair,90); pos5(stem,30);
rt x1r= rt x2r=w-3.5u; bot y1=-d; top y2=h+apex_o;
lft x3l=u; y3l=if medieval: -stem else: .5x_height fi; z4l=(x1r+hair,y3l); rt x5r=w-u; y5l=y3l;
z2'=whatever[z2r,z3l]=whatever[z1l,z2l];
z3l'=z3l+(hair-tiny,0) rotated(angle(z2r-z3l)-90); x2''=x2'; z2''=z3l'+whatever*(z2r-z3l);
z4'=whatever[z3l',z2'']=whatever[z4r,(x3l,y4r)];
z4l'=(x1r,y4l); z4r'=(x1r,y4r); z4l''=(x1l,y4l); z4r''=(x1l,y4r); z1'=(x1l,y4r);
cap_serifs_bl(1l); cap_serifs_br(1r);
filldraw z1r.b---obl(4l',1r,5l)if bold_face:.light fi
         ---z5l..z5r if x4-x1r>oblu.light:..z4r fi
	 ..obl(4r',4r,2r).light---z2r--
         z2'--z3l---obl(4l'',3l,1l)if bold_face:.light fi
	 ---z1l.b..{dir181}z1l.a{right}..z1+ser_boule*up..
	 {right}z1r.a{dir179}..cycle;
infill obl(4',4r,2'')---obl(2'',4',1')---obl(1',2'',4')---cycle;
penlabels(1,2,3,4,5); labels(2',2'',3l',4',4l',4r');
);

let _saved_char_four=_saved_char;
numeric _saved_w_four; _saved_w_four:=_saved_w;

iff known chars.numeral_four:
bskchar "The numeral 4";
beginchar(chars.numeral_four,figw(12u),medfig,medfigd); uni "0x0034";
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.superscript_numeral_four:
bskchar "The superscript numeral 4";
beginchar(chars.superscript_numeral_four,if monofig: 5.5u# else: 7u# fi,asc_height#,0); uni "0x2074";
adjust_fit(0,0);
pickup tiny.nib;
multiply(1.7skal)(curve,hair,vair,dig_stem);
usechar shifted (-x3l,0) scaled skal shifted (u+(HH-skal*fig_height)*slant,HH-skal*fig_height);
endchar;

iff known chars.fraction_one_quarter:
bskchar "Fraction one quarter";
beginchar(chars.fraction_one_quarter,7u#,asc_height#,0); uni "0x00BC";
adjust_fit(0,0);
pickup tiny.nib;
numeric zv; zv:=if medieval: .5 else: .4 fi;
multiply(1.7zv)(curve,hair,stem,like_hair,like_stem);
usechar shifted (-.5w,0) scaled zv shifted (.5WW,0);
save x,y;
let _saved_char=_saved_char_one;
_saved_w:=_saved_w_one;
usechar shifted -(x1,0) scaled zv shifted (.5WW+(HH-zv*fig_height)*slant,HH-zv*fig_height);
pos10(hair,90); pos11(hair,90);
lft x10=u; rt x11=w-u; y10=y11=if medieval: bar_height else: .5[x_height,bar_height] fi if bold_face: +.5hair fi;
filldraw bskrule(10,11,hair,hair);
penlabels(10,11);
endchar;

iff known chars.fraction_three_quarters:
bskchar "Fraction three quarters";
beginchar(chars.fraction_three_quarters,7u#,asc_height#,0); uni "0x00BE";
adjust_fit(0,0);
pickup tiny.nib;
numeric zv; zv:=if medieval: .5 else: .4 fi;
multiply(1.7zv)(curve,hair,stem,like_hair,like_stem);
let _saved_char=_saved_char_four;
_saved_w:=_saved_w_four;
usechar shifted (-.5w,0) scaled zv shifted (.5WW,0);
save x,y;
let _saved_char=_saved_char_three;
_saved_w:=_saved_w_three;
usechar shifted -(x2+hair,if medieval: y7 else: 0 fi) scaled zv shifted (.5WW+(HH-zv*fig_height)*slant,HH-zv*fig_height);
pos10(hair,90); pos11(hair,90);
lft x10=u; rt x11=w-u; y10=y11=if medieval: bar_height else: .5[x_height,bar_height] fi if bold_face: +.5hair fi;
filldraw bskrule(10,11,hair,hair);
penlabels(10,11);
endchar;

iff known chars.numeral_four_BB:
bskchar "The blackboard-bold numeral 4";
beginchar(chars.numeral_four_BB,figw(12u),medfig,medfigd); uni "0x1D7DC";
adjust_fit(0,0);
pickup tiny.nib;
oblu:=2f_obl; oblu.light:=.5oblu;
pos1(cap_stem,0); pos2(cap_stem,0); pos4(hair,90); pos5(stem,30);
rt x1r= rt x2r=w-3.5u; bot y1=-d; top y2=h+apex_o;
lft x3l=u; y3l=if medieval: -stem else: .5x_height fi; z4l=(x1r+hair,y3l); rt x5r=w-u; y5l=y3l;
z2'=whatever[z2r,z3l]=whatever[z1l,z2l];
z3l'=z3l+(hair-tiny,0) rotated(angle(z2r-z3l)-90); x2''=x2'; z2''=z3l'+whatever*(z2r-z3l);
z4'=whatever[z3l',z2'']=whatever[z4r,(x3l,y4r)];
z4l'=(x1r,y4l); z4r'=(x1r,y4r); z4l''=(x1l,y4l); z4r''=(x1l,y4r); z1'=(x1l,y4r);
cap_serifs_bl(1l); cap_serifs_br(1r);
filldraw z1r.b---obl(4l',1r,5l)if bold_face:.light fi
         ---z5l..z5r if x4-x1r>oblu.light:..z4r fi
	 ..obl(4r',4r,2r).light---z2r--
         z2'--z3l---obl(4l'',3l,1l)if bold_face:.light fi
	 ---z1l.b..{dir181}z1l.a{right}..z1+ser_boule*up..
	 {right}z1r.a{dir179}..cycle;
infill obl(4',4r,2'')---obl(2'',4',1')---obl(1',2'',4')---cycle;
bot z100=(x1l,y1l.c);
oblu:=f_obl; oblu.more:=2oblu;
infill ifobl(2',2r,100,1r,,more)%obl(2',100,2r)---obl(2r,2',1r).more
       ---obl(1r,2r,1l)---z1l...obl(100,1l.c,2l)---cycle;
penlabels(1,2,3,4,5); labels(2',2'',3l',4',4l',4r');
endchar;

iff known chars.numeral_four_SS:
bskchar "The sans-serif numeral 4";
beginchar(chars.numeral_four_SS,figw(11.5u),medfig,medfigd); uni "0x1D7E5";
adjust_fit(0,0);
pickup tiny.nib;
oblu:=2f_obl; oblu.light:=.5oblu;
pos1(dig_stem,0); pos2(dig_stem,0); pos4(hair,90); pos5(hair,90);
rt x1r= rt x2r=w-3u; bot y1=-d; top y2=h+apex_o;
lft x3l=u; y3l=if medieval: -stem else: .5x_height fi; z4l=(x1r+hair,y3l); rt x5r=w-u; y5l=y3l;
z2'=whatever[z2r,z3l]=whatever[z1l,z2l];
z3l'=z3l+(hair-tiny,0) rotated(angle(z2r-z3l)-90); x2''=x2'; z2''=z3l'+whatever*(z2r-z3l);
z4'=whatever[z3l',z2'']=whatever[z4r,(x3l,y4r)];
z4l'=(x1r,y4l); z4r'=(x1r,y4r); z4l''=(x1l,y4l); z4r''=(x1l,y4r); z1'=(x1l,y4r);
cap_serifs_bl(1l); cap_serifs_br(1r);
filldraw z1r.b---obl(4l',1r,5l)if bold_face:.light fi
         ---z5l..z5r---obl(4r',4r,2r).light---z2r--
         z2'--z3l---obl(4l'',3l,1l)if bold_face:.light fi
	 ---z1l.b...z1...cycle;
infill obl(4',4r,2'')---obl(2'',4',1')---obl(1',2'',4')---cycle;
penlabels(1,2,3,4,5); labels(2',2'',3l',4',4l',4r');
endchar;

charscription(figwu(if medieval: 10.5u else: 9.5u fi),medfigu,medfigdu)(
numeric theta; theta=if medieval: 0 else: 10 fi;
path p[];
oblu:=2f_obl;
pos1(hair,0); pos2(hair,0); pos3(stem,75);
pos4(hair,-90); pos5(curve,180); pos6(hair,90);
x1l=if monofig: 2u else: 3u fi; top y1l=h+apex_o; x2=x1; 
y2=if medieval: .2x_height else: .5[bar_height,x_height] fi; z3r=z2r; z2'=(x2r,.5[y4,y2]);
x4=.5w; rt x5l=w-u; 
y4=y2+ if known superscript: .5\\fi (if not medieval: .8\\fi stem); 
y5=.48[y4,y6];
x6=.5w-o; bot y6l=-d; 
lft x7r=u; y7=y6+if known superscript: 3 else: 4 fi /3like_curve; x8=w-u; y8=y1+.5apex_o;
z1'=z1r+if bold_face:.8\\fi curve*down;
p0=z1l---z2l..{down}z3l..(x3r,y3l)..{up}z3r..{up}z2r..{right}z4r..
   {down}z5r..{left}z6r..(reverse smitko(7,curve))..z6l{right}..
   {up}z5l;
p1=z5l{up}..z4l..z2';
p2=z2'--z1';
p3=z1'..{dir(70-theta)}z8{dir(-140-theta)}..z1l;
filldraw p0&subpath(0,rundy(p1,infinity).zpet) of p1..subpath (rundy(p2,0),rundy(p2,infinity).zpet) of p2..
subpath(rundy(p3,0),infinity) of p3&cycle;
penlabels(1,2,3,4,5,6,7); labels(1',2',8);
);

iff known chars.numeral_five:
bskchar "The numeral 5";
beginchar(chars.numeral_five,figw(if medieval: 10.5u else: 9.5u fi),medfig,medfigd); uni "0x0035";
italcorr h#*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.superscript_numeral_five:
bskchar "The superscript numeral 5";
beginchar(chars.superscript_numeral_five,if monofig: 5.5u# else: if medieval: 6.25u# else: 5.75u#fi fi,asc_height#,0); uni "0x2075";
adjust_fit(0,0);
pickup tiny.nib; boolean superscript; superscript=true;
multiply(1.7skal)(curve,hair,stem);
usechar shifted (-x7r,0) scaled skal shifted (u+(HH-skal*fig_height)*slant,HH-skal*fig_height);
endchar;

iff known chars.numeral_five_BB:
bskchar "The blackboard-bold numeral 5";
beginchar(chars.numeral_five_BB,figw(if medieval: 10.5u else: 9.5u fi),medfig,medfigd); uni "0x1D7DD";
italcorr h#*slant;
adjust_fit(0,0);
pickup tiny.nib;
numeric theta; theta=if medieval: 0 else: 10 fi;
path p[]; numeric tim[];
oblu:=2f_obl;
pos1(hair,0); pos2(hair,0); pos3(stem,75);
pos4(hair,-90); pos5(cap_stem,180); pos6(hair,90);
x1l=if monofig: 2u else: 3u fi; top y1l=h+apex_o; x2=x1; 
y2=if medieval: .2x_height else: .5[bar_height,x_height] fi; z3r=z2r; z2'=(x2r,.5[y4,y2]);
x4=.5w; rt x5l=w-u; 
y4=y2+ if known superscript: .5\\fi (if not medieval: .8\\fi stem); 
y5=.48[y4,y6];
x6=.5w-o; bot y6l=-d; 
lft x7r=u; y7=y6+if known superscript: 3 else: 4 fi /3like_curve; x8=w-u; y8=y1+.5apex_o;
z1'=z1r+if bold_face:.8\\fi curve*down;
p0=z1l---z2l..{down}z3l..(x3r,y3l)..{up}z3r..{up}z2r..{right}z4r..
   {down}z5r..{left}z6r..(reverse smitko(7,curve))..z6l{right}..
   {up}z5l;
p1=z5l{up}..z4l..z2';
p2=z2'--z1';
p3=z1'..{dir(70-theta)}z8{dir(-140-theta)}..z1l;
filldraw p0&subpath(0,rundy(p1,infinity).zpet) of p1..subpath (rundy(p2,0),rundy(p2,infinity).zpet) of p2..
subpath(rundy(p3,0),infinity) of p3&cycle;
p100:=z2'..z4l..{down}z5l..{left}z6l;
p101:=subpath(6,8) of p0;
p102:=subpath(0,1) of p3;
p103:=subpath(1,2) of p3;
z100=bsktouch(p100,down,p101,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y4l+5)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y5)));
z101=bsktouch(p100,up,p101,down);
tim102=xpart(p100 intersectiontimes (z101--(x101,y6l-u)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y5)));
z102=bsktouch(p102,up,p103,down);
tim104=xpart(p102 intersectiontimes (z102--(x102,y4)));
tim105=xpart(p103 intersectiontimes (z102--(x102,y8)));
oblu:=bbw;
infill subpath(rundy(p101,tim103).zpet,rundy(p101,tim101)) of p101
       ..reverse subpath(rundy(p100,tim102).zpet,rundy(p100,tim100)) of p100
       ..cycle;
infill subpath(rundy(p102,(0,f_obl)),rundy(p102,tim104).zpet) of p102
       ..subpath(rundy(p103,tim105),rundy(p103,(1,2f_obl)).zpet) of p103..cycle;
penlabels(1,2,3,4,5,6,7); labels(1',2',8,100,101,102);
endchar;

iff known chars.numeral_five_SS:
bskchar "The sans-serif numeral 5";
beginchar(chars.numeral_five_SS,figw(if medieval: 10.5u else: 9.5u fi),medfig,medfigd); uni "0x1D7E6";
italcorr h#*slant;
adjust_fit(0,0);
pickup tiny.nib;
numeric theta; theta=if medieval: 0 else: 10 fi;
path p[];
oblu:=2f_obl;
pos1(hair,0); pos2(hair,0); pos3(hair,0);
pos4(hair,-90); pos5(curve,180); pos6(hair,90); pos7(curve,150);
x1l=if monofig: 2u else: 3u fi; top y1l=h+apex_o; x2=x1; 
y2=if medieval: .2x_height else: .5[bar_height,x_height] fi; x3r=x2r; y3r=y2r-hair; z2'=(x2r,.5[y4,y2]);
x4=.5w; rt x5l=w-u; 
y4=y2+ if known superscript: .5\\fi (if not medieval: .8\\fi stem); 
y5=.48[y4,y6];
x6=.5w-o; bot y6l=-d; 
lft x7r=u; y7=y6+if known superscript: 3 else: 4 fi /3like_curve; x8=w-u; y8=y1+.5apex_o;
z1'=z1r+if bold_face:.8\\fi curve*down;
p0=z1l---z2l..{down}z3l..{up}z3r..{up}z2r..{right}z4r..
   {down}z5r..{left}z6r..{up}z7l..{down}z7r..z6l{right}..
   {up}z5l;
p1=z5l{up}..z4l..z2';
p2=z2'--z1';
p3=z1'..{dir(70-theta)}z8{dir(-140-theta)}..z1l;
filldraw p0&subpath(0,rundy(p1,infinity).zpet) of p1..subpath (rundy(p2,0),rundy(p2,infinity).zpet) of p2..
subpath(rundy(p3,0),infinity) of p3&cycle;
penlabels(1,2,3,4,5,6,7); labels(1',2',8);
endchar;

charscription(figwu(10u),fig_height,0)(
path p[]; numeric tim[]; oblu:=2oblu;
pos1(vair,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
pos5(curve,0); pos6(hair,-90); pos7(curve,160);
rt x3l=w-u; y1=y3=.5x_height; x2=x4=.5w+.5hair; bot y2l=-o; .5[y4r,y2r]=y3;
lft x5l=u; y5l=y1l+stem; top y6l=h+o; x6=.5w+.75stem;
rt x7l=w-u; y7=y6r-like_stem;
p0=z2r{left}..z5r..{right}z6r; x1r=xpart (((0,y1)--(.5w,y1))intersectionpoint p0);
p1=z2l{right}..z3l..z4l..{down}z1l;
p2=z2r{left}..z5r..{right}z6r;
z0=bsktouch(p1,left,subpath(.2,infinity) of p2,right);
tim1=xpart(p1 intersectiontimes (z0--(x4,y0)));
tim2=xpart(p2 intersectiontimes (z0--(0,y0)));
filldraw z7r{down}..z7l{up}..{left}z6l..z5l..{right}z2l..
         subpath(0,rundy(p1,tim1).zpet) of p1..
	 subpath(rundy(p2,tim2),infinity) of p2..cycle;
infill z1r{up}..z4r..z3r..z2r..cycle;
penlabels(0,1,2,3,4,5,6,7);
);

iff known chars.numeral_six:
bskchar "The numeral 6";
beginchar(chars.numeral_six,figw(10u),fig_height#,0); uni "0x0036";
italcorr .5[fig_height#,x_height#]*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.superscript_numeral_six:
bskchar "The superscript numeral 6";
beginchar(chars.superscript_numeral_six,if monofig: 5.5u# else: 6u# fi,asc_height#,0); uni "0x2076";
adjust_fit(0,0);
pickup tiny.nib; 
multiply(1.7skal)(curve,hair,vair,stem);
usechar shifted (-x5l,0) scaled skal shifted (u+(HH-skal*fig_height)*slant,HH-skal*fig_height);
endchar;

iff known chars.numeral_six_BB:
bskchar "The blackboard-bold numeral 6";
beginchar(chars.numeral_six_BB,figw(10u),fig_height#,0); uni "0x1D7DE";
italcorr .5[fig_height#,x_height#]*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos1(vair,0); pos2(hair,90); pos3(cap_stem,180); pos4(hair,270);
pos5(cap_stem,0); pos6(hair,-90); pos7(curve,160);
rt x3l=w-u; y1=y3=.5x_height; x2=x4=.5w+.5hair; bot y2l=-o; .5[y4r,y2r]=y3;
lft x5l=u; y5l=y1l+stem; top y6l=h+o; x6=.5w+.75stem;
rt x7l=w-u; y7=y6r-like_stem;
p0=z2r{left}..z5r..{right}z6r; x1r=xpart (((0,y1)--(.5w,y1))intersectionpoint p0);
p1=z2l{right}..z3l..z4l..{down}z1l;
p2=z2r{left}..z5r..{right}z6r;
z0=bsktouch(p1,left,subpath(.2,infinity) of p2,right);
tim1=xpart(p1 intersectiontimes (z0--(x4,y0)));
tim2=xpart(p2 intersectiontimes (z0--(0,y0)));
filldraw z7r{down}..z7l{up}..{left}z6l..z5l..{right}z2l..
         subpath(0,rundy(p1,tim1).zpet) of p1..
	 subpath(rundy(p2,tim2),infinity) of p2..cycle;
infill z1r{up}..z4r..z3r..z2r..cycle;
p100:=z4r..z3r..z2r..{up}z1r..cycle;
p101:=p1;
p102:=z6l{left}..z5l..{right}z2l;
p103:=p2;
oblu:=1.25bbw;
z100=bsktouch(p100,up,p101,down);
z101=bsktouch(p100,down,p101,up);
z102=bsktouch(p102,up,p103,down);
z103=bsktouch(p102,down,p103,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y1)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y4l+5)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y1)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y2l-5)));
tim104=xpart(p102 intersectiontimes (z102--(x102,y2l-5)));
tim105=xpart(p103 intersectiontimes (z102--(x102,y1)));
tim106=xpart(p102 intersectiontimes (z103--(x103,y6l+5)));
tim107=xpart(p103 intersectiontimes (z103--(x103,y1)));
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103),rundy(p101,tim101).zpet) of p101..cycle;
infill subpath(rundy(p102,tim106),rundy(p102,tim104).zpet) of p102
       ..subpath(rundy(p103,tim105),rundy(p103,tim107).zpet) of p103..cycle;
penlabels(0,1,2,3,4,5,6,7); labels(100,101,102,103);
endchar;

iff known chars.numeral_six_SS:
bskchar "The sans-serif numeral 6";
beginchar(chars.numeral_six_SS,figw(10u),fig_height#,0); uni "0x1D7E7";
italcorr .5[fig_height#,x_height#]*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos1(hair,0); pos2(hair,90); pos3(curve,180); pos4(hair,270);
pos5(curve,0); pos6(hair,-90); pos7(curve,160);
rt x3l=w-u; y1=y3=.5x_height; x2=x4=.5w+.5hair; bot y2l=-o; .5[y4r,y2r]=y3;
lft x5l=u; y5l=y1l+stem; top y6l=h+o; x6=.5w+.75stem;
rt x7l=w-u; y7=y6r-like_stem;
p0=z2r{left}..z5r..{right}z6r; x1r=xpart (((0,y1)--(.5w,y1))intersectionpoint p0);
p1=z2l{right}..z3l..z4l..{down}z1l;
p2=z2r{left}..z5r..{right}z6r;
z0=bsktouch(p1,left,subpath(.2,infinity) of p2,right);
tim1=xpart(p1 intersectiontimes (z0--(x4,y0)));
tim2=xpart(p2 intersectiontimes (z0--(0,y0)));
filldraw z7r{down}..z7l{up}..{left}z6l..z5l..{right}z2l..
         subpath(0,rundy(p1,tim1).zpet) of p1..
	 subpath(rundy(p2,tim2),infinity) of p2..cycle;
infill z1r{up}..z4r..z3r..z2r..cycle;
penlabels(0,1,2,3,4,5,6,7);
endchar;

charscription(figwu(11u),medfigu,medfigdu)(
path p; numeric tim[];
pos1(hair,0); pos2(curve,0); pos3(stem,90); pos4(.4(h+d),80);
rt top z1r=(w-u,h); lft x2l=2.5u; top y2=-d+.5stem; 
y3r=y1r; y4r=y1r+if not medieval: .5\\fi stem; lft x4l=u; x3=x4r+hair; x3l:=x3l+o;
p:=z2l{dir80}...{z1-z2r}z1l; tim1=xpart(p intersectiontimes ((0,y3l)--(w,y3l))); z1'=point tim1 of p + u*left;
filldraw z1r{z2r-z1}...{dir-100}z2r..subpath(0,rundy(p,(tim1,curve)).zpet) of p..z1'
         ---z3l..{z4l-z4r}z4l..z4l+left--z4r{down}..z3r---cycle;
penlabels(1,2,3,4); labels(1');
);

iff known chars.numeral_seven:
bskchar "The numeral 7";
beginchar(chars.numeral_seven,figw(11u),medfig,medfigd); uni "0x0037";
italcorr h#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.superscript_numeral_seven:
bskchar "The superscript numeral 7";
beginchar(chars.superscript_numeral_seven,if monofig: 5.5u# else: 6.5u# fi,asc_height#,0); uni "0x2077";
adjust_fit(0,0);
pickup tiny.nib;
multiply(1.7skal)(curve,hair,stem);
usechar shifted (-x4l,0) scaled skal shifted (u+(HH-skal*fig_height)*slant,HH-skal*fig_height);
endchar;

iff known chars.numeral_seven_BB:
bskchar "The blackboard-bold numeral 7";
beginchar(chars.numeral_seven_BB,figw(11u),medfig,medfigd); uni "0x1D7DF";
italcorr h#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[];
pos1(.5cap_stem,0); pos2(cap_stem,0); pos3(stem,90); pos4(.4(h+d),80);
rt top z1r=(w-u,h); lft x2l=2.5u; top y2=-d+.5stem; 
y3r=y1r; y4r=y1r+if not medieval: .5\\fi stem; lft x4l=u; x3=x4r+hair; x3l:=x3l+o;
p0:=z2l{dir80}...{z1-z2r}z1l; tim1=xpart(p0 intersectiontimes ((0,y3l)--(w,y3l))); z1'=point tim1 of p0 + u*left;
filldraw z1r{z2r-z1}...{dir-100}z2r..subpath(0,rundy(p0,(tim1,curve)).zpet) of p0..z1'
         ---z3l..{z4l-z4r}z4l..z4l+left--z4r{down}..z3r---cycle;
p100:=z1r{z2r-z1}...{dir-100}z2r;
p101:=p0;
z100=bsktouch(p100,2left,p101,2right);
tim100=xpart(p100 intersectiontimes (z100--(w,y100)));
tim101=xpart(p101 intersectiontimes (z100--(0,y100)));
oblu:=bbw;
infill subpath(rundy(p100,tim100),infinity) of p100
       ..subpath(0,rundy(p101,tim101).zpet) of p101..cycle;
penlabels(1,2,3,4); labels(1',100);
endchar;

iff known chars.numeral_seven_SS:
bskchar "The sans-serif numeral 7";
beginchar(chars.numeral_seven_SS,figw(11u),medfig,medfigd); uni "0x1D7E8";
italcorr h#*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
path p; numeric tim[];
pos1(hair,0); pos2(curve,0); pos3(stem,90); pos4(stem,90);
rt top z1r=(w-u,h); lft x2l=2.5u; top y2=-d+.5stem; 
y3r=y4r=y1r; lft x4l=u; x3=x4r+hair; x3l:=x3l+o;
p:=z2l{dir80}...{z1-z2r}z1l; tim1=xpart(p intersectiontimes ((0,y3l)--(w,y3l))); z1'=point tim1 of p + u*left;
filldraw z1r{z2r-z1}...{dir-100}z2r..subpath(0,rundy(p,(tim1,curve)).zpet) of p..z1'
         ---z4l+.5stem*right...z4...z4r+.5stem*right---cycle;
penlabels(1,2,3,4); labels(1');
endchar;

charscription(figwu(9u),fig_height,0)(
path p[]; numeric testem, tlstem, tim[]; oblu:=2f_obl;
testem=.5[curve, hair]; tlstem=.75[curve,stem];
pos1(testem,0); pos2(tlstem,180); pos3(tlstem,180); pos4(testem,0);
pos5(vair,90); pos6(vair,90);
lft x1l=u; rt x2l=w-u; x3r=u+hair; x4r=w-x3r; y1=y2=.27h; y3=y4=.76h;
x5=x6=.5w; bot y5l=-o; top y6r=h+o; z0=whatever[z1,z4]=whatever[z2,z3];
p0:=z6{left}..z3..z0..z2..{left}z5; pos0(curve,angle(direction 2 of p0)-90);
p1=z6r{left}..z3r..z0r..z2r..z5r{left};
p2=z4l{down}..z0{dir-160}..{down}z1l;
p3=z5l{right}..z2l..z0l..z3l..{right}z6l;
p4=z1r{up}..z0{dir20}..{up}z4r;
p5=z6l{left}..z3l..z0l..z2l..z5l{left};
(tim1,tim2)=p1 intersectiontimes p2;
(tim3,tim4)=p3 intersectiontimes p4;
(tim5,tim6)=p5 intersectiontimes p2;
(tim7,tim8)=p1 intersectiontimes p4;
filldraw subpath(0,rundy(p1,tim1).zpet) of p1..
         subpath(rundy(p2,tim2),infinity) of p2..
	 subpath(0,rundy(p3,tim3).zpet) of p3..
	 subpath(rundy(p4,tim4),infinity) of p4..cycle;
infill subpath(0,rundy(p5,tim5).zpet) of p5 .. 
       (reverse subpath(0,rundy(p2,tim6).zpet) of p2) .. cycle;
infill subpath(rundy(p1,tim7),infinity) of p1..
       subpath(0,rundy(p4,tim8).zpet) of p4..cycle;
penlabels(0,1,2,3,4,5,6);
);

iff known chars.numeral_eight:
bskchar "The numeral 8";
beginchar(chars.numeral_eight,figw(9u),fig_height#,0); uni "0x0038";
italcorr .5[fig_height#,x_height#]*slant-.5u#;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.superscript_numeral_eight:
bskchar "The superscript numeral 8";
beginchar(chars.superscript_numeral_eight,if monofig: 5.5u# else: 5.5u# fi,asc_height#,0); uni "0x2078";
adjust_fit(0,0);
pickup tiny.nib;
multiply(1.7skal)(curve,hair,vair,stem);
usechar shifted (-x1l,0) scaled skal shifted (u+(HH-skal*fig_height)*slant,HH-skal*fig_height);
endchar;

iff known chars.numeral_eight_BB:
bskchar "The blackboard-bold numeral 8";
beginchar(chars.numeral_eight_BB,figw(9u),fig_height#,0); uni "0x1D7E0";
italcorr .5[fig_height#,x_height#]*slant-.5u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric testem, tlstem, tim[]; oblu:=2f_obl;
testem=.5[curve, cap_stem]; tlstem=cap_stem;
pos1(testem,0); pos2(tlstem,180); pos3(tlstem,180); pos4(testem,0);
pos5(vair,90); pos6(vair,90);
lft x1l=u; rt x2l=w-u; x3r=u+hair; x4r=w-x3r; y1=y2=.27h; y3=y4=.76h;
x5=x6=.5w; bot y5l=-o; top y6r=h+o; z0=whatever[z1,z4]=whatever[z2,z3];
p0:=z6{left}..z3..z0..z2..{left}z5; pos0(curve,angle(direction 2 of p0)-90);
p1=z6r{left}..z3r..z0r..z2r..z5r{left};
p2=z4l{down}..z0{dir-160}..{down}z1l;
p3=z5l{right}..z2l..z0l..z3l..{right}z6l;
p4=z1r{up}..z0{dir20}..{up}z4r;
p5=z6l{left}..z3l..z0l..z2l..z5l{left};
(tim1,tim2)=p1 intersectiontimes p2;
(tim3,tim4)=p3 intersectiontimes p4;
(tim5,tim6)=p5 intersectiontimes p2;
(tim7,tim8)=p1 intersectiontimes p4;
filldraw subpath(0,rundy(p1,tim1).zpet) of p1..
         subpath(rundy(p2,tim2),infinity) of p2..
	 subpath(0,rundy(p3,tim3).zpet) of p3..
	 subpath(rundy(p4,tim4),infinity) of p4..cycle;
infill subpath(0,rundy(p5,tim5).zpet) of p5 .. 
       (reverse subpath(0,rundy(p2,tim6).zpet) of p2) .. cycle;
infill subpath(rundy(p1,tim7),infinity) of p1..
       subpath(0,rundy(p4,tim8).zpet) of p4..cycle;
p100:=p1;
p101:=p3;
p102:=z6l{right}..p2;
p103:=p4..{left}z6r;
p104:=p2..{right}z5l;
p105:=z5r{left}..p4;
z100=bsktouch(subpath(0,1) of p100,down,p101,up);
z101=bsktouch(p100,down,subpath(0,1) of p101,up);
z102=bsktouch(subpath(0,1) of p102,dir45,p103,dir-135);
z103=bsktouch(subpath(1,infinity) of p102,dir-45,p103,dir135);
z104=bsktouch(p104,dir-45,subpath(1,2) of p105,dir135);
z105=bsktouch(p104,dir45,subpath(0,1) of p105,dir-135);
tim100=xpart(p100 intersectiontimes (z100--(x100,y6r+5)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y3)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y2)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y5l-5)));
tim104=xpart(p102 intersectiontimes (z102--(x102,y4)));
tim105=xpart(p103 intersectiontimes (z102--(x102,y6r+5)));
tim106=xpart(p102 intersectiontimes (z103--(x103,y4)));
tim107=xpart(p103 intersectiontimes (z103--(x103,y1)));
tim108=xpart(p104 intersectiontimes (z104--(x104,y3)));
tim109=xpart(p105 intersectiontimes (z104--(x104,y1)));
tim110=xpart(p104 intersectiontimes (z105--(x105,y5l-5)));
tim111=xpart(p105 intersectiontimes (z105--(x105,y1)));
oblu:=bbw;
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103),rundy(p101,tim101).zpet) of p101..cycle;
infill subpath(rundy(p102,tim104),rundy(p102,tim106).zpet) of p102
       ..subpath(rundy(p103,tim107),rundy(p103,tim105).zpet) of p103..cycle;
infill subpath(rundy(p104,tim108),rundy(p104,tim110).zpet) of p104
       ..subpath(rundy(p105,tim111),rundy(p105,tim109).zpet) of p105..cycle;
penlabels(0,1,2,3,4,5,6); labels(100,101,102,103,104,105);
endchar;

iff known chars.numeral_eight_SS:
bskchar "The sans-serif numeral 8";
beginchar(chars.numeral_eight_SS,figw(9u),fig_height#,0); uni "0x1D7E9";
italcorr .5[fig_height#,x_height#]*slant-.5u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric testem, tlstem, tim[]; oblu:=2f_obl;
testem=.5[curve, stem]; tlstem=.75[curve,stem];
pos1(testem,0); pos2(tlstem,180); pos3(tlstem,180); pos4(testem,0);
pos5(hair,90); pos6(hair,90);
lft x1l=u; rt x2l=w-u; x3r=u+hair; x4r=w-x3r; y1=y2=.27h; y3=y4=.76h;
x5=x6=.5w; bot y5l=-o; top y6r=h+o; z0=whatever[z1,z4]=whatever[z2,z3];
p0:=z6{left}..z3..z0..z2..{left}z5; pos0(curve,angle(direction 2 of p0)-90);
p1=z6r{left}..z3r..z0r..z2r..z5r{left};
p2=z4l{down}..z0{dir-160}..{down}z1l;
p3=z5l{right}..z2l..z0l..z3l..{right}z6l;
p4=z1r{up}..z0{dir20}..{up}z4r;
p5=z6l{left}..z3l..z0l..z2l..z5l{left};
(tim1,tim2)=p1 intersectiontimes p2;
(tim3,tim4)=p3 intersectiontimes p4;
(tim5,tim6)=p5 intersectiontimes p2;
(tim7,tim8)=p1 intersectiontimes p4;
filldraw subpath(0,rundy(p1,tim1).zpet) of p1..
         subpath(rundy(p2,tim2),infinity) of p2..
	 subpath(0,rundy(p3,tim3).zpet) of p3..
	 subpath(rundy(p4,tim4),infinity) of p4..cycle;
infill subpath(0,rundy(p5,tim5).zpet) of p5 .. 
       (reverse subpath(0,rundy(p2,tim6).zpet) of p2) .. cycle;
infill subpath(rundy(p1,tim7),infinity) of p1..
       subpath(0,rundy(p4,tim8).zpet) of p4..cycle;
penlabels(0,1,2,3,4,5,6);
endchar;

charscription(figwu(10u),medfigu,medfigdu)(
path p[]; numeric tim[]; oblu:=2oblu;
pos1(vair,0); pos2(hair,-90); pos3(curve,180); pos4(hair,90);
pos5(curve,0); pos6(hair,-90); pos7(curve,160);
lft x3r=u; y1=y3; x2+.5hair=x4=.5w-.5hair; top y4r=h+o; .5[y4l,y2l]=y3; y2=if medieval:-hair else: h-x_height fi;
rt x5r=w-u; y5r=y1r-stem;
bot y6r=-d-o; x6=.5w-.75stem;
lft x7r=u; y7=y6r+like_stem;
p0=z4l{right}..z5l..{left}z6l; x1l=xpart (((.5w,y1)--(w,y1))intersectionpoint p0);
p1=z2r{right}..z1r{up}..z4r..z3r;
p2=z4l{right}..z5l..{left}z6l;
z0=bsktouch(p1,right,p2,left);
tim1=xpart(p1 intersectiontimes (z0--(.5w,y0)));
tim2=xpart(p2 intersectiontimes (z0--(w,y0)));
filldraw z7l{up}..{down}z7r..z6r{right}..z5r..z4r..z3r..{right}z2r..
         subpath(0,rundy(p1,tim1).zpet) of p1..
         subpath(rundy(p2,tim2),infinity) of p2..cycle;
infill z1l{up}..z4l..z3l..z2l..cycle;
penlabels(1,2,3,4,5,6,7);
);

iff known chars.numeral_nine:
bskchar "The numeral 9";
beginchar(chars.numeral_nine,figw(10u),medfig,medfigd); uni "0x0039";
italcorr if medieval: .4x_height# else: (fig_height#-.5x_height#)fi*slant;
adjust_fit(0,0);
pickup tiny.nib;
usechar;
endchar;

iff known chars.superscript_numeral_nine:
bskchar "The superscript numeral 9";
beginchar(chars.superscript_numeral_nine,if monofig: 5.5u# else: 6u# fi,asc_height#,0); uni "0x2079";
adjust_fit(0,0);
pickup tiny.nib;
multiply(1.7skal)(curve,hair,vair);
usechar shifted (-x3r,0) scaled skal shifted (u+(HH-skal*fig_height)*slant,HH-skal*fig_height);
endchar;

iff known chars.numeral_nine_BB:
bskchar "The blackboard-bold numeral 9";
beginchar(chars.numeral_nine_BB,figw(10u),medfig,medfigd); uni "0x1D7E1";
italcorr if medieval: .4x_height# else: (fig_height#-.5x_height#)fi*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos1(vair,0); pos2(hair,-90); pos3(cap_stem,180); pos4(hair,90);
pos5(cap_stem,0); pos6(hair,-90); pos7(curve,160);
lft x3r=u; y1=y3; x2+.5hair=x4=.5w-.5hair; top y4r=h+o; .5[y4l,y2l]=y3; y2=if medieval:-hair else: h-x_height fi;
rt x5r=w-u; y5r=y1r-stem;
bot y6r=-d-o; x6=.5w-.75stem;
lft x7r=u; y7=y6r+like_stem;
p0=z4l{right}..z5l..{left}z6l; x1l=xpart (((.5w,y1)--(w,y1))intersectionpoint p0);
p1=z2r{right}..z1r{up}..z4r..z3r;
p2=z4l{right}..z5l..{left}z6l;
z0=bsktouch(p1,right,p2,left);
tim1=xpart(p1 intersectiontimes (z0--(.5w,y0)));
tim2=xpart(p2 intersectiontimes (z0--(w,y0)));
filldraw z7l{up}..{down}z7r..z6r{right}..z5r..z4r..z3r..{right}z2r..
         subpath(0,rundy(p1,tim1).zpet) of p1..
         subpath(rundy(p2,tim2),infinity) of p2..cycle;
infill z1l{up}..z4l..z3l..z2l..cycle;
p100:=z6r{right}..z5r..z4r..z3r..{right}z2r;
p101:=z1l{down}..z2l..z3l..z4l..cycle;
p102:=p100;
p103:=p2;
oblu:=1.25bbw;
z100=bsktouch(subpath(2,infinity) of p100,down,p101,up);
z101=bsktouch(p100,up,p101,down);
z102=bsktouch(p102,up,p103,down);
z103=bsktouch(p102,down,p103,up);
tim100=xpart(p100 intersectiontimes (z100--(x100,y4r+5)));
tim101=xpart(p101 intersectiontimes (z100--(x100,y1)));
tim102=xpart(p100 intersectiontimes (z101--(x101,y2r-5)));
tim103=xpart(p101 intersectiontimes (z101--(x101,y1)));
tim104=xpart(p102 intersectiontimes (z102--(x102,y6r-5)));
tim105=xpart(p103 intersectiontimes (z102--(x102,y1)));
tim106=xpart(p102 intersectiontimes (z103--(x103,y4r+5)));
tim107=xpart(p103 intersectiontimes (z103--(x103,y1)));
infill subpath(rundy(p100,tim100),rundy(p100,tim102).zpet) of p100
       ..subpath(rundy(p101,tim103),rundy(p101,tim101).zpet) of p101..cycle;
infill subpath(rundy(p102,tim104),rundy(p102,tim106).zpet) of p102
       ..subpath(rundy(p103,tim107),rundy(p103,tim105).zpet) of p103..cycle;
penlabels(1,2,3,4,5,6,7); labels(100,101,102,103);
endchar;

iff known chars.numeral_nine_SS:
bskchar "The sans-serif numeral 9";
beginchar(chars.numeral_nine_SS,figw(10u),medfig,medfigd); uni "0x1D7EA";
italcorr if medieval: .4x_height# else: (fig_height#-.5x_height#)fi*slant;
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[]; oblu:=2oblu;
pos1(hair,0); pos2(hair,-90); pos3(curve,180); pos4(hair,90);
pos5(curve,0); pos6(hair,-90); pos7(curve,160);
lft x3r=u; y1=y3; x2+.5hair=x4=.5w-.5hair; top y4r=h+o; .5[y4l,y2l]=y3; y2=if medieval:-hair else: h-x_height fi;
rt x5r=w-u; y5r=y1r-stem;
bot y6r=-d-o; x6=.5w-.75stem;
lft x7r=u; y7=y6r+like_stem;
p0=z4l{right}..z5l..{left}z6l; x1l=xpart (((.5w,y1)--(w,y1))intersectionpoint p0);
p1=z2r{right}..z1r{up}..z4r..z3r;
p2=z4l{right}..z5l..{left}z6l;
z0=bsktouch(p1,right,p2,left);
tim1=xpart(p1 intersectiontimes (z0--(.5w,y0)));
tim2=xpart(p2 intersectiontimes (z0--(w,y0)));
filldraw z7l{up}..{down}z7r..z6r{right}..z5r..z4r..z3r..{right}z2r..
         subpath(0,rundy(p1,tim1).zpet) of p1..
         subpath(rundy(p2,tim2),infinity) of p2..cycle;
infill z1l{up}..z4l..z3l..z2l..cycle;
penlabels(1,2,3,4,5,6,7);
endchar;

iff known chars.sign_query:
bskchar "Question mark";
beginchar(chars.sign_query, 9.5u#, asc_height#, 0); uni "0x003F";
italcorr .5[asc_height#,x_height#]*slant-.25u#;
adjust_fit(punct_fit#,0);
pickup tiny.nib;
path p[];
bot z0=(2u+.5dot_size,.5dot_size); dot(0);
pos1(hair,90); pos2(curve,180); pos3(curve,0); pos4(like_hair,-135); pos5(hair,0);
z2'=z2+.2curve*down+o*right; 
z2''=z2+.5(curve-currentbreadth)*dir135;
x1=.45w; top y1r=h+o; 
y2''=1/4[h,x_height]; lft x2r=u; 
rt x3r=w-u; y3=.5[y1r,y4l];
lft x4l=x0+.25stem-.25dot_size; y4=.75x_height;
z4'=(x4l-.5stem, y4l); y5=y0+.5dot_size+stem; z5=whatever[z0,.5[z4',z4l]];
p0=z3r{down}..z4;
p1=z4r--z5r;
filldraw z5l---z4'..z4l..z3l{up}..z1l{left}..{dir-70}z2l..z2'..{up}z2r..z2''..{right}z1r..
         subpath(0,rundy(p0,1).zpet) of p0..subpath(rundy(p1,0),1) of p1..cycle;
penlabels(1,2,3,4,5); labels(2',2'',4');
endchar;

iff known chars.sign_interrobang:
bskchar "Interrobang mark";
beginchar(chars.sign_interrobang, 9.5u#, asc_height#, 0); uni "0x203D";
italcorr .5[asc_height#,x_height#]*slant-.25u#;
adjust_fit(punct_fit#,0);
pickup tiny.nib;
path p[]; numeric tim[];
bot z0=(2u+.5dot_size,.5dot_size); dot(0);
pos1(hair,90); pos2(curve,180); pos3(curve,0); pos4(like_hair,-135); pos5(hair,0);
penpos6(dot_size,0); pos7(hair,0); x6=x7=x0;
z2'=z2+.2curve*down+o*right; 
z2''=z2+.5(curve-currentbreadth)*dir135;
x1=.45w; top y1r=h+o; 
y2''=1/4[h,x_height]; lft x2r=u; 
rt x3r=w-u; y3=.5[y1r,y4l];
lft x4l=x0+.25stem-.25dot_size; y4=.75x_height;
z4'=(x4l-.5stem, y4l); y5=y0+.5dot_size+stem; z5=whatever[z0,.5[z4',z4l]];
y6=h-.5stem; bot y7=dot_size+stem; y7r:=y7r+.5hair;
p0=z3r{down}..z4;
p1=z4r--z5r;
p2=z5l---z4'..z4l..z3l{up}..z1l{left}..{dir-70}z2l..z2'..{up}z2r;
p3=z2r{up}..z2''..{right}z1r..subpath(0,rundy(p0,1).zpet) of p0..subpath(rundy(p1,0),1) of p1;
p4=z7l---z6l..z6r{z7r-z6r}..z7r{z7r-.5[z6,z6r]}..{z6l-z7l}z7l;
(tim0-3,tim1)=subpath(3,infinity) of p2 intersectiontimes subpath(0,2) of p4;
(tim2,tim3)=subpath(0,2) of p3 intersectiontimes subpath(0,1.5) of p4;
(tim4,tim5-1)=subpath(0,3) of p3 intersectiontimes subpath(1,infinity) of p4;
(tim6-3,tim7-2)=subpath(3,6) of p3 intersectiontimes subpath(2,infinity) of p4;
(tim8,tim9-2)=subpath(0,3) of p2 intersectiontimes subpath(2,infinity) of p4;
(tim10-3,tim11-1)=subpath(3,5) of p2 intersectiontimes subpath(1,infinity) of p4;
filldraw subpath(0,rundy(p4,(tim1,2oblu)).zpet) of p4
         ..subpath(rundy(p2,(tim0,2oblu)),infinity) of p2
	 ..subpath(0,rundy(p3,tim2).zpet) of p3
	 ..subpath(rundy(p4,tim3),rundy(p4,tim5).zpet) of p4
	 ..subpath(rundy(p3,tim4),rundy(p3,tim6).zpet) of p3
	 ..subpath(rundy(p4,tim7),infinity) of p4..cycle;
infill subpath(rundy(p2,tim8),rundy(p2,tim10).zpet) of p2
       ..subpath(rundy(p4,tim11),rundy(p4,tim9).zpet) of p4..cycle;
penlabels(1,2,3,4,5,6,7); labels(2',2'',4');
endchar;

iff known chars.sign_query_double:
bskchar "Double question mark";
beginchar(chars.sign_query_double, 16u#, asc_height#, 0); uni "0x2047";
italcorr .5[asc_height#,x_height#]*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[];
bot z0=(2u+.5dot_size,.5dot_size); dot(0);
pos1(hair,90); pos2(curve,180); pos3(curve,0); pos4(like_hair,-135); pos5(hair,0);
z2'=z2+.2curve*down+o*right; 
z2''=z2+.5(curve-currentbreadth)*dir135;
x1=.45(w-6.5u); top y1r=h+o; 
y2''=1/4[h,x_height]; lft x2r=u; 
rt x3r=w-8.5u; y3=.5[y1r,y4l];
lft x4l=x0+.25stem-.25dot_size; y4=.75x_height;
z4'=(x4l-.5stem, y4l); y5=y0+.5dot_size+stem; z5=whatever[z0,.5[z4',z4l]];
p0=z3r{down}..z4;
p1=z4r--z5r;
z6=z0 shifted (w-u-x3r,0); dot(6);
filldraw z5l---z4'..z4l..z3l{up}..z1l{left}..{dir-70}z2l..z2'..{up}z2r..z2''..{right}z1r..
         subpath(0,rundy(p0,1).zpet) of p0..subpath(rundy(p1,0),1) of p1..cycle;
filldraw (z5l---z4'..z4l..z3l{up}..z1l{left}..{dir-70}z2l..z2'..{up}z2r..z2''..{right}z1r..
         subpath(0,rundy(p0,1).zpet) of p0..subpath(rundy(p1,0),1) of p1..cycle) shifted (w-u-x3r,0);
penlabels(1,2,3,4,5); labels(2',2'',4');
endchar;

iff known chars.sign_query_exclam:
bskchar "Question exclamation  mark";
beginchar(chars.sign_query_exclam, 13.5u#, asc_height#, 0); uni "0x2048";
italcorr .5[asc_height#,x_height#]*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[];
bot z0=(2u+.5dot_size,.5dot_size); dot(0);
pos1(hair,90); pos2(curve,180); pos3(curve,0); pos4(like_hair,-135); pos5(hair,0);
z2'=z2+.2curve*down+o*right; 
z2''=z2+.5(curve-currentbreadth)*dir135;
x1=.45(w-4u); top y1r=h+o; 
y2''=1/4[h,x_height]; lft x2r=u; 
rt x3r=w-5u; y3=.5[y1r,y4l];
lft x4l=x0+.25stem-.25dot_size; y4=.75x_height;
z4'=(x4l-.5stem, y4l); y5=y0+.5dot_size+stem; z5=whatever[z0,.5[z4',z4l]];
p0=z3r{down}..z4;
p1=z4r--z5r;
filldraw z5l---z4'..z4l..z3l{up}..z1l{left}..{dir-70}z2l..z2'..{up}z2r..z2''..{right}z1r..
         subpath(0,rundy(p0,1).zpet) of p0..subpath(rundy(p1,0),1) of p1..cycle;
bot y6=.5dot_size; x6=w-3u; dot(6);
penpos7(dot_size,0); pos8(hair,0); x7=x8=x6;
y7=h-.5stem; bot y8=dot_size+stem; y8r:=y8r+.5hair;
filldraw z7l---z8l..{.5[z7,z7r]-z8r}z8r..{z7r-z8r}z7r..cycle;
penlabels(1,2,3,4,5,7,8,); labels(2',2'',4');
endchar;

iff known chars.sign_exclam_query:
bskchar "Exclamation  query mark";
beginchar(chars.sign_exclam_query, 13.5u#, asc_height#, 0); uni "0x2049";
italcorr .5[asc_height#,x_height#]*slant-.25u#;
adjust_fit(0,0);
pickup tiny.nib;
path p[];
bot z0=(6u+.5dot_size,.5dot_size); dot(0);
pos1(hair,90); pos2(curve,180); pos3(curve,0); pos4(like_hair,-135); pos5(hair,0);
z2'=z2+.2curve*down+o*right; 
z2''=z2+.5(curve-currentbreadth)*dir135;
x1=4u+.45(w-4u); top y1r=h+o; 
y2''=1/4[h,x_height]; lft x2r=5u; 
rt x3r=w-u; y3=.5[y1r,y4l];
lft x4l=x0+.25stem-.25dot_size; y4=.75x_height;
z4'=(x4l-.5stem, y4l); y5=y0+.5dot_size+stem; z5=whatever[z0,.5[z4',z4l]];
p0=z3r{down}..z4;
p1=z4r--z5r;
filldraw z5l---z4'..z4l..z3l{up}..z1l{left}..{dir-70}z2l..z2'..{up}z2r..z2''..{right}z1r..
         subpath(0,rundy(p0,1).zpet) of p0..subpath(rundy(p1,0),1) of p1..cycle;
bot y6=.5dot_size; x6=3u; dot(6);
penpos7(dot_size,0); pos8(hair,0); x7=x8=x6;
y7=h-.5stem; bot y8=dot_size+stem; y8r:=y8r+.5hair;
filldraw z7l---z8l..{.5[z7,z7r]-z8r}z8r..{z7r-z8r}z7r..cycle;
penlabels(1,2,3,4,5,7,8,); labels(2',2'',4');
endchar;

iff known chars.sign_turned_query:
bskchar "Turned question mark";
beginchar(chars.sign_turned_query, 9.5u#, asc_height#-desc_depth#, desc_depth#); uni "non";
adjust_fit(0,0);
pickup tiny.nib;
path p[];
top z0=(2u+.5dot_size,h-.5dot_size); dot(0);
pos1(hair,-90); pos2(curve,180); pos3(curve,0); pos4(like_hair,135); pos5(hair,0);
z2'=z2+.2curve*up+o*right; 
z2''=z2+.5(curve-currentbreadth)*dir-135;
x1=.45w; bot y1r=-d-o; 
y2''=1/4[-d,-d+(asc_height-x_height)]; lft x2r=u; 
rt x3r=w-u; y3=.5[y1r,y4l];  
lft x4l=x0+.25stem-.25dot_size; y4=-d+(asc_height-.75x_height);
z4'=(x4l-.5stem, y4l); y5=y0-.5dot_size-stem; z5=whatever[z0,.5[z4',z4l]];
p0=z3r{up}..z4;
p1=z4r--z5r;
filldraw z5l---z4'..z4l..z3l{down}..z1l{left}..{dir70}z2l..z2'..{down}z2r..z2''..{right}z1r..
         subpath(0,rundy(p0,1).zpet) of p0..subpath(rundy(p1,0),1) of p1..cycle;
penlabels(1,2,3,4,5); labels(2',2'',4');
endchar;

iff known chars.sign_spanish_query:
bskchar "Reversed question mark";
beginchar(chars.sign_spanish_query, 9.5u#, asc_height#-desc_depth#, desc_depth#); uni "0x00BF";
adjust_fit(0,0);
pickup tiny.nib;
path p[];
top z0=(w-2u-.5dot_size,h-.5dot_size); dot(0);
pos1(hair,-90); pos2(curve,0); pos3(curve,180); pos4(like_hair,45); pos5(hair,180);
z2'=z2+.2curve*up+o*left; 
z2''=z2+.5(curve-currentbreadth)*dir-45;
x1=.55w; bot y1r=-d-o; 
y2''=1/4[-d,-d+(asc_height-x_height)]; rt x2r=w-u; 
lft x3r=u; y3=.5[y1r,y4l];  
rt x4l=x0-.25stem+.25dot_size; y4=-d+(asc_height-.75x_height);
z4'=(x4l+.5stem, y4l); y5=y0-.5dot_size-stem; z5=whatever[z0,.5[z4',z4l]];
p0=z3r{up}..z4;
p1=z4r--z5r;
filldraw z5l---z4'..z4l..z3l{down}..z1l{right}..{dir110}z2l..z2'..{down}z2r..z2''..{left}z1r..
         subpath(0,rundy(p0,1).zpet) of p0..subpath(rundy(p1,0),1) of p1..cycle;
penlabels(1,2,3,4,5); labels(2',2'',4');
endchar;

iff known chars.sign_gnaborretni:
bskchar "Reversed interrobang mark";
beginchar(chars.sign_gnaborretni, 9.5u#, asc_height#-desc_depth#, desc_depth#); uni "non";
adjust_fit(0,0);
pickup tiny.nib;
path p[]; numeric tim[];
top z0=(w-2u-.5dot_size,h-.5dot_size); dot(0);
pos1(hair,-90); pos2(curve,0); pos3(curve,180); pos4(like_hair,45); pos5(hair,180);
penpos6(dot_size,180); pos7(hair,180); x6=x7=x0;
z2'=z2+.2curve*up+o*left; 
z2''=z2+.5(curve-currentbreadth)*dir-45;
x1=.55w; bot y1r=-d-o; 
y2''=1/4[-d,-d+(asc_height-x_height)]; rt x2r=w-u; 
lft x3r=u; y3=.5[y1r,y4l];  
rt x4l=x0-.25stem+.25dot_size; y4=-d+(asc_height-.75x_height);
z4'=(x4l+.5stem, y4l); y5=y0-.5dot_size-stem; z5=whatever[z0,.5[z4',z4l]];
y6=-d+.5stem; top y7=h-dot_size-stem; y7r:=y7r-.5hair;
p0=z3r{up}..z4;
p1=z4r--z5r;
p2=z5l---z4'..z4l..z3l{down}..z1l{right}..{dir110}z2l..z2'..{down}z2r;
p3=z2r{down}..z2''..{left}z1r..subpath(0,rundy(p0,1).zpet) of p0..subpath(rundy(p1,0),1) of p1;
p4=z7l---z6l..z6r{z7r-z6r}..z7r{z7r-.5[z6,z6r]}..{z6l-z7l}z7l;
(tim0-3,tim1)=subpath(3,infinity) of p2 intersectiontimes subpath(0,2) of p4;
(tim2,tim3)=subpath(0,2) of p3 intersectiontimes subpath(0,1.5) of p4;
(tim4,tim5-1)=subpath(0,3) of p3 intersectiontimes subpath(1,infinity) of p4;
(tim6-3,tim7-2)=subpath(3,6) of p3 intersectiontimes subpath(2,infinity) of p4;
(tim8,tim9-2)=subpath(0,3) of p2 intersectiontimes subpath(2,infinity) of p4;
(tim10-3,tim11-1)=subpath(3,5) of p2 intersectiontimes subpath(1,infinity) of p4;
filldraw subpath(0,rundy(p4,(tim1,2oblu)).zpet) of p4
         ..subpath(rundy(p2,(tim0,2oblu)),infinity) of p2
	 ..subpath(0,rundy(p3,tim2).zpet) of p3
	 ..subpath(rundy(p4,tim3),rundy(p4,tim5).zpet) of p4
	 ..subpath(rundy(p3,tim4),rundy(p3,tim6).zpet) of p3
	 ..subpath(rundy(p4,tim7),infinity) of p4..cycle;
infill subpath(rundy(p2,tim8),rundy(p2,tim10).zpet) of p2
       ..subpath(rundy(p4,tim11),rundy(p4,tim9).zpet) of p4..cycle;
penlabels(1,2,3,4,5,6,7); labels(2',2'',4');
endchar;

iff known chars.sign_ampersand:
bskchar "Ampersand";
beginchar(chars.sign_ampersand, 14u#, asc_height#, 0); uni "0x0026";
italcorr x_height#*slant;
adjust_fit(0,0);
pickup tiny.nib;
numeric alpha, tim[];
path p[];
numeric radius; radius:=2hair; oblu:=2oblu;
pos1(hair,180); pos4(hair,-90); pos5(hair,180);
rt x1r=w-u-hair; y1=y2; top y4l=h+o; x4-x3'=if monospace:expansion_factor*fi (y4-y3');
lft x3l=if monospace: 2u else:3u fi +stem; 
rt x2r=x1r-if monospace:.85expansion_factor*fi(y2r+u); y3l=x_height; y2r=.25x_height; 
alpha=diag_ratio(2,stem,y3l-y2r,x3l-x2r);
pos2(alpha*stem,0); pos3(alpha*stem,0); pos3'(stem,0);
.5[x3'r,rt x5r-if not monospace:.5\\fi hair]=x4; y5=y3'=.5[x_height,h]; 
x3'r-x3r=(y3'-y3)*cosd(angle(z3-z2)); 
bot y2'=-o; x2'=.5[x2r,x1l];
pos6(curve,180); pos7(.5[hair,stem],270); pos8(hair,-45); pos9(hair,270); pos10(stem,180);
lft x6r=u; y6r-y7r=x7-x6; bot y7r=-o; x7=x3; x8=x2;
y8=bar_height; top y9l=x_height+o; x9=.5[x8,w-u]+.5hair;
z10'=z10+.2stem*down+o*left; z10''=z10+.5(stem-currentbreadth)*dir 45;
rt x10l=w-u; y10''=y9r-hair; 
p0=z1l{z2'+u*right-z1l}..{left}z2'..z2l---z3l..z3'l..z4l..{down}z5l..{down}z6l;
p1=z6l{down}..z7l..z8l..{right}z9l..z10''..{down}z10l..z10'..
   z10r..z9r{left}..z8r..z7r..{up}z6r;
p2=z6r{up}..z5r{up}..z4r..z3'r..z3r---z2r..{up}z1r;
(tim0,tim1-9)=p0 intersectiontimes (subpath (9,infinity) of p1);
(tim2,tim3)=p2 intersectiontimes p0;
(tim4-3,tim5-5)=(subpath(3,infinity) of p2) intersectiontimes subpath(5,infinity) of p0;
(tim6-3,tim7)=(subpath(3,infinity) of p2) intersectiontimes p1;
(tim8-8,tim9)=(subpath(8,infinity) of p1) intersectiontimes p2;
(tim10,tim11-3)=p2 intersectiontimes subpath (3,infinity) of p2;
(tim12,tim13)=p1 intersectiontimes p0;
(tim14,tim15-5)=p0 intersectiontimes subpath(5,infinity) of p0;
filldraw subpath(0,rundy(p0,tim0).zpet) of p0..subpath(rundy(p1,tim1),infinity) of p1..subpath (0,rundy(p2,tim2).zpet) of p2..subpath(rundy(p0,tim3),rundy(p0,tim5).zpet) of p0..subpath(rundy(p2,tim4),rundy(p2,(tim6,hair)).zpet) of p2..subpath(rundy(p1,(2,f_obl)),8) of p1..subpath (8,rundy(p1,tim8).zpet) of p1..subpath(rundy(p2,tim9),infinity) of p2..cycle;
infill subpath(rundy(p2,tim10),rundy(p2,tim11).zpet) of p2..cycle;
infill subpath(0,rundy(p1,tim12).zpet) of p1
       ..subpath(rundy(p0,tim13),rundy(p0,tim14).zpet) of p0
       ..subpath(rundy(p0,tim15),infinity) of p0..cycle;
penlabels(1,2,3,3',4,5,6,7,8,9,10); labels(2',10',10'');
endchar;

iff known chars.sign_at:
bskchar "At sign";
beginchar(chars.sign_at, 16u#, asc_height#-.3desc_depth#, .6desc_depth#); uni "0x0040";
adjust_fit(0,0);
pickup tiny.nib;
numeric aend,H,W,shift; aend:=stem; H:=x_height; W=9u; oblu:=2oblu;
path p[]; numeric tim[];
shift=.5(w-W) if not monospace: + hair fi;
pos0(hair,180); pos0'(.9[stem,hair],90); pos1(stem,0); pos2(stem,0);
pos3(hair,90); pos4(aend,180); z4'=z4+.2aend*down+o*right; 
z4''=z4+.5(aend-currentbreadth)*dir135;
rt x1r=W-u- if monospace: .25\\fi stem +shift; x2=x1; y1=stem+hair; y2=H-like_curve;
x0l=W if not monospace: -.75u fi +shift; y0=2/3(x0r-x1r); y0'l=0; x0'=.5[x0r,x1r];
x3=.5[x1r,lft u+shift]; top y3r=H+o; 
y4''=.5[y2,y3l]; lft x4r=u if not monospace:+o fi +shift; 
z5l=z2l; z6l=z5l+like_hair*down; z7=(u+shift,y1);
pos6(hair,angle(z7-z6l)+90);
pos8(curve,30); lft x8l=if not monospace: u+ fi shift; y8r=y7-hair;
pos9(hair,120); x9r=x3; y9l=o;
pos10(hair,angle(z1-z9l)+90); z10l=z1;
pos11(hair,0); pos12(hair,90); pos13(hair,180); pos14(hair,270);
pos15(hair,0);
lft x13r=u; y13=bar_height; y15=if monospace: 0 else:.2bar_height fi; rt x15r=w-u;
top y12r=h+o; bot y14r=-d+o; x12=x14=.5w; 
z11r=(z12r{right}..{dir(angle(z0'l-z0r)+10)}z0l) intersectionpoint 
     ((.5w,y13)--(w,y13));
p0=z0l{dir(angle(z0'l-z0r)+10)}..z0'l{left}..z1l---z2l..{left}z3l..
   {down}z4l..z4'..{up}z4r..z4''..{right}z3r...z2r---z1r..
   {right}z0'r..{dir(angle(z0r-z0'l)+10)}z0r..{up}z11l..{left}z12l..z13l..
   {right}z14l..{dir(angle(z0r-z0'l)+10)}z15l..z15r{dir(angle(z0'l-z0r)+10)}
   ..z14r{left}..z13r..{right}z12r..{down}z11r;
p1=z10l{z9l-z1}..z9l..z8l..{z6l-z7-hair*up}z6l;
p2=z10r{z9l-z1}..z9r..z8r..{z6r-z7-hair*up}z6r;
(tim1,tim2)=p0 intersectiontimes p1;
(tim3-2,tim4)=subpath(2,infinity) of p1 intersectiontimes p0;
(tim5,tim6)=p2 intersectiontimes p0;
(tim7-2,tim8)=subpath(2,infinity) of p2 intersectiontimes p0;
filldraw subpath(0,rundy(p0,tim1).zpet) of p0..
         subpath(rundy(p1,tim2),rundy(p1,tim3).zpet) of p1..
	 subpath(rundy(p0,tim4),length p0) of p0..cycle;
if bold_face: oblu:=.5f_obl; fi
infill subpath(rundy(p2,tim5),rundy(p2,tim7).zpet) of p2..
       subpath(rundy(p0,tim8).zpet,rundy(p0,tim6)) of p0..cycle;
penlabels(0,0',1,2,3,4,5,6,8,9,10,11,12,13,14,15); labels(4',4'',7);
endchar;
