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