| 1 |
%% This file is public domain. |
| 2 |
%% Originally written 1990, Alan Hoenig. |
| 3 |
%% Notice added by Clea F. Rees 2010/12/13 following correspondence between Alan Hoenig and Karl Berry. |
| 4 |
|
| 5 |
% Program files for formal Computer Duerer fonts. |
| 6 |
% Modified 24-July-1990 DAH: Split lines longer than 80 columns |
| 7 |
%% |
| 8 |
def checkthin= |
| 9 |
if thin-currentbreadth<eps: thin:=currentbreadth+eps; fi; |
| 10 |
if thin-currentbreadth<eps: thin:=currentbreadth+eps; fi enddef; |
| 11 |
|
| 12 |
numeric P_width#; P_width#=cap_jut#+3thick#+1/4side#-thin#; |
| 13 |
define_pixels(P_width); |
| 14 |
|
| 15 |
pair xeps, yeps; xeps=(eps,0); yeps=(0,eps); |
| 16 |
numeric tail_corr; tail_corr=1/8; |
| 17 |
numeric cap_jut_factor; cap_jut_factor=8/7; |
| 18 |
|
| 19 |
cmchar "The letter A"; |
| 20 |
beginchar("A", 2u#+2cap_jut#+.8side#, cap_height#, 0); |
| 21 |
adjust_fit(cap_serif_fit#, cap_serif_fit#); |
| 22 |
top y3=top y2=h if not monospace: + apex_o fi; |
| 23 |
numeric alpha[]; alpha1=((h+cap_jut)++(w/2))/(h+cap_jut); |
| 24 |
penpos1(alpha1*thin,0); penpos2(alpha1*thin,0); |
| 25 |
penpos3(alpha1*thick,0); penpos4(alpha1*thick,0); |
| 26 |
lft x1l=cap_jut_factor*cap_jut+.5u; rt x4r=w-x1l; |
| 27 |
bot y1=bot y4=0 if monospace: +1/2 crisp fi; |
| 28 |
x3r=x2l+apex_corr; hround(w/2)=.5[x2,x3]; |
| 29 |
z0=whatever[z1r,z2r]=whatever[z3l,z4l]; |
| 30 |
fill z0--diag_end(0,4l,1,1,4r,3r)--z3r..z2l--diag_end(2l,1l,1,1,1r,0) |
| 31 |
--z0..cycle; % diagonals |
| 32 |
top y5r=top y6r=hround(h/2); top y5r-bot y5l=top y6r-bot y6l=thin; |
| 33 |
penpos5(whatever, angle(z2-z1)); penpos6(whatever, angle(z3-z4)); |
| 34 |
z5=whatever[z1,z2]; z6=whatever[z3,z4]; |
| 35 |
penstroke z5e--z6e; % bar line |
| 36 |
pickup tiny.nib; |
| 37 |
numeric top_bar; top_bar=top y5r-bot y6l; |
| 38 |
if monospace: pickup pencircle scaled 0pt; |
| 39 |
pos11(top_bar,90); pos12(top_bar,90); |
| 40 |
top y11r=top y12r=h; w/2=.5[x11,x12]; x12-x11=apex_corr+2cap_jut; |
| 41 |
fill z11l--z12l{right}..tension atleast.95..{left}z12r--z11r{left}.. |
| 42 |
tension atleast.95..{right}cycle; |
| 43 |
penlabels(11,12); fi |
| 44 |
if serifs: bracket:=10/7 bracket; cap_jut:=cap_jut_factor*cap_jut; |
| 45 |
pickup tiny.nib; numeric jut_factor; |
| 46 |
if monospace: jut_factor:=1; else: jut_factor:=3/4; fi |
| 47 |
% Durer called for a |jut_factor| of |1/2|, but this gives a too-puny |
| 48 |
% inner serif. |
| 49 |
serif(1,2,a,.8serif_darkness,-cap_jut);serif(4,3,d,.8serif_darkness, cap_jut); |
| 50 |
bracket:=jut_factor*bracket; if monospace: jut_factor:=.6; fi |
| 51 |
serif(1,2,b,7/8 serif_darkness,jut_factor*cap_jut); |
| 52 |
serif(4,3,c,7/8 serif_darkness,-jut_factor*cap_jut); |
| 53 |
fi |
| 54 |
penlabels(0,1,2,3,4,5,6); endchar; |
| 55 |
|
| 56 |
cmchar "The letter B"; |
| 57 |
beginchar("B",u#+cap_jut#+4thick#+1/4 side#-thin#, cap_height#, 0); |
| 58 |
adjust_fit(cap_serif_fit#,0); pickup tiny.nib; |
| 59 |
pos1(thick,0); pos2(thick,0); lft x1l=lft x2l=.5u+cap_jut; |
| 60 |
bot y2=0; top y1=h; filldraw stroke z1e--z2e; % vertical stem |
| 61 |
pos3(thin,-90); pos5(thick,0); pos7(thin,90); |
| 62 |
z3r=z2; y4l=y3l; x4l=x3l+thick; y4r=y3r; x4r=x4l+thick-1/2thin; z4=.5[z4l,z4r]; |
| 63 |
y7l=h/2; x7l=x1; y6l=y7l; x6l=x4l; top y6r-bot y6l=thin; x6r=x4r; |
| 64 |
z6=.5[z6r,z6l]; |
| 65 |
rt x5r=hround(w-.5u); y5=.5[y4r,y6r]; |
| 66 |
filldraw stroke z3e--z4e..pulled_arc.e(4,5)&pulled_arc.e(5,6)..z6e--z7e; |
| 67 |
% bottom lobe |
| 68 |
pos7'(thin,-90); pos8(thick,0); pos10(thin,90); |
| 69 |
z7'=z7; z6'=z6; x6'r=x4r; x6'l=x4l; y6'r=y7'r; y6'l=y7'l; |
| 70 |
z10r=z1; x9r=x6'r; x9l=x6'l; y9r=y10r; top y9r-bot y9l=thin; z9=.5[z9r,z9l]; |
| 71 |
rt x8r=lft x5l; y8=.5[y6r,y9r]; |
| 72 |
filldraw stroke z7'e--z6'e..pulled_arc.e(6',8)&pulled_arc.e(8,9) |
| 73 |
..z9e--z10e; % upper lobe |
| 74 |
if serifs: serif(1,2,a, serif_darkness,-cap_jut); |
| 75 |
serif(2,1,b,serif_darkness,-cap_jut); |
| 76 |
numeric tempa_, tempb_; tempa_=slab; tempb_=bracket; |
| 77 |
slab:=thin; bracket:=2/3cap_jut; serif(2,1,c,serif_darkness,2/3cap_jut); |
| 78 |
slab:=tempa_; bracket:=tempb_; fi |
| 79 |
penlabels(1,2,3,4,5,6,7,8,9,10,11,12); |
| 80 |
penlabels(6',7'); endchar; |
| 81 |
|
| 82 |
cmchar "The letter C"; |
| 83 |
beginchar("C",2u#+.9side#, cap_height#, 0); |
| 84 |
adjust_fit(0, 0); if monospace: pickup fine.nib; else: pickup tiny.nib;fi |
| 85 |
numeric alpha; alpha=w-u-thick; |
| 86 |
pos2(thin, 90); x2=.5[x3r,x0r]; top y2r=h+o;% topmost pen position |
| 87 |
pos3(thick,180); lft z3r=(u,h/2); |
| 88 |
pos4(thin, 270); x4=x2; bot y4r=-o; |
| 89 |
pos0(thick,0); lft z0l=(w+thick-u,h/2); |
| 90 |
path p, p', line.u, line.b; line.u=(alpha,1.5h)--(alpha,h/2); |
| 91 |
line.b=(.5[alpha,x0],0)--(.5[alpha,x0],h/2); |
| 92 |
p=pulled_arc.r(0,2)&pulled_arc.r(2,3)&pulled_arc.r(3,4) |
| 93 |
&pulled_arc.r(4,0)&cycle; |
| 94 |
p'=pulled_arc.l(0,2)&pulled_arc.l(2,3)&pulled_arc.l(3,4) |
| 95 |
&pulled_arc.l(4,0)&cycle; |
| 96 |
z'1l=line.u intersectionpoint p'; z'1r=line.u intersectionpoint p; |
| 97 |
bot rt z1l=z'1l; top rt z1r=z'1r; z1=.5[z1l,z1r]; |
| 98 |
z'5l=line.b intersectionpoint p'; z'5r=line.b intersectionpoint p; |
| 99 |
top rt z5l=z'5l; bot rt z5r=z'5r; z5=.5[z5r, z5l]; |
| 100 |
if not monospace: x1l:=x1l+.6thin; y1l:=y1r-1.75thick-2tiny; |
| 101 |
y5r:=y5r-o; y5l:=2thick+y5r-2tiny; fi |
| 102 |
if monospace: x1:=x1l:=x1r:=x5; y1:=y1-thin; y1l:=y1l-thin; y1r:=y1r-.6thin; fi |
| 103 |
% readjust to have a better opening in CDTT |
| 104 |
numeric slope_factor; if monospace:slope_factor=4/3; else:slope_factor=3/4; fi |
| 105 |
filldraw |
| 106 |
z1r{-1,slope_factor}...{left}z2r..pulled_arc.r(2,3)& |
| 107 |
pulled_arc.r(3,4)..{right}z4r..tension 0.9..z5r-- |
| 108 |
reverse |
| 109 |
(z1l..tension 0.9..{left}z2l..pulled_arc.l(2,3)&pulled_arc.l(3,4)..{right}z4l |
| 110 |
..tension 0.9..z5l) |
| 111 |
..(z1l+(eps,0))--(z1r+(eps,0))..cycle; |
| 112 |
penlabels(0,1,2,3,4,5); endchar; |
| 113 |
|
| 114 |
cmchar "The letter D"; |
| 115 |
beginchar("D", cap_jut#+.9side#+u#, cap_height#, 0); |
| 116 |
adjust_fit(cap_serif_fit#,0); |
| 117 |
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); |
| 118 |
lft x1l=.5u+cap_jut; x2=x1; bot y2=0; top y1=h; |
| 119 |
filldraw stroke z1e--z2e; % stem |
| 120 |
pos3(thin, 90); pos5(thick, 0); pos7(thin, -90); |
| 121 |
x3=x7=x1; top y3r=h; bot y7r=0; |
| 122 |
y5=good.y h/2; rt x5r=good.x (w-.5u); |
| 123 |
if not monospace: x4r=x6r=hround(w/2); top y4r=h; bot y6r=0; |
| 124 |
bot y4l=vround(h-thin); top y6l=vround thin; |
| 125 |
x4l=x6l; 2(lft x5l-x4l)=y4l-y6l; |
| 126 |
z4=.5[z4l, z4r]; z6=.5[z6l, z6r]; |
| 127 |
else: pos4(thin,90); pos6(thin,-90); x4=x6=hround w/2; top y4r=h; bot y6r=0; |
| 128 |
fi |
| 129 |
filldraw stroke z3e{right}...pulled_super_arc.e(4,5,eta)& |
| 130 |
pulled_super_arc.e(5,6,eta)...{left}z7e; % lobe |
| 131 |
if serifs: serif(1, 2, a, serif_darkness, -cap_jut); |
| 132 |
serif(2, 1, b, serif_darkness, -cap_jut); |
| 133 |
if not monospace: numeric temp_; temp_=slab; slab:=thin; |
| 134 |
serif(2, 1, c, serif_darkness, cap_jut); slab:=temp_; fi fi |
| 135 |
penlabels(1,2,3,4,5,6,7); endchar; |
| 136 |
|
| 137 |
cmchar "The letter E"; |
| 138 |
numeric topbar_; if monospace: topbar_=11/15; |
| 139 |
else: topbar_=17/30; fi % Duerer's wierd value |
| 140 |
beginchar("E", hstretch*(topbar_+1/6)*side#+u#, cap_height#,0); |
| 141 |
adjust_fit(cap_serif_fit#,0); |
| 142 |
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); |
| 143 |
lft x1l=lft x2l=.5u+cap_jut; top y1=h; bot y2=0; |
| 144 |
filldraw stroke z1e--z2e; % stem |
| 145 |
pickup crisp.nib; % prepare for arms and serifs |
| 146 |
pos3(thin,90); pos4(dslab,0); |
| 147 |
x1=x3; top y3r=h; rt x4l=topbar_*side; |
| 148 |
bot y4=vround(h-if monospace: 2 fi vstretch*thick); |
| 149 |
arm(3,4,d,serif_darkness,0); % top arm and beak |
| 150 |
pos5(thin,-90); pos0(thin,90); pos6(dslab,0); pos7(dslab,0); |
| 151 |
x5=x0=x1; y5=y0=hround(h/2); rt x6r=rt x7r=max(x4l-hstretch*thick,rt |
| 152 |
x1r+1/5side); |
| 153 |
top y6-bot y7=2vstretch*jut; y5=.5[y6,y7]; |
| 154 |
arm(5,6,e,eta,0); arm(0,7,f,eta,0); % middle arms and beaks |
| 155 |
pos8(thin,-90); pos9(dslab,0); x8=x2; bot y8r=0; rt x9r=hround(w-.5u); |
| 156 |
y9=y8r+thin+vstretch*1/6side; |
| 157 |
foot(8,9,g,serif_darkness,x9-x4-thick); % lower arm |
| 158 |
if serifs: serif(1,2,a,serif_darkness,-cap_jut); |
| 159 |
serif(2,1,b,serif_darkness,-cap_jut); |
| 160 |
if not monospace: temp_:=slab; slab:=thin; |
| 161 |
serif(2,1,c,serif_darkness,cap_jut); |
| 162 |
slab:=temp_; fi fi |
| 163 |
penlabels(0,1,2,3,4,5,6,7,8,9); endchar; % end of "E" |
| 164 |
|
| 165 |
cmchar "The letter F"; |
| 166 |
numeric topbar_; if monospace: topbar_=11/15; |
| 167 |
else: topbar_=17/30; fi % Duerer's wierd value |
| 168 |
beginchar("F", hstretch*(topbar_+1/6)*side#-u#, cap_height#,0); |
| 169 |
adjust_fit(cap_serif_fit#,0); |
| 170 |
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); |
| 171 |
lft x1l=lft x2l=.5u+cap_jut; top y1=h; bot y2=0; |
| 172 |
filldraw stroke z1e--z2e; % stem |
| 173 |
pickup crisp.nib; % prepare for arms and serifs |
| 174 |
pos3(thin,90); pos4(dslab,0); |
| 175 |
x1=x3; top y3r=h; rt x4l=topbar_*side; |
| 176 |
bot y4=vround(h-if monospace: 2 fi vstretch*thick); |
| 177 |
arm(3,4,d,serif_darkness,0); % top arm and beak |
| 178 |
pos5(thin,-90); pos0(thin,90); pos6(dslab,0); pos7(dslab,0); |
| 179 |
x5=x0=x1; y5=y0=hround(h/2); rt x6r=rt x7r=max(x4l-hstretch*thick,rt |
| 180 |
x1r+1/5side); |
| 181 |
top y6-bot y7=2vstretch*jut; y5=.5[y6,y7]; |
| 182 |
arm(5,6,e,eta,0); arm(0,7,f,eta,0); % middle arms and beaks |
| 183 |
if serifs: serif(1,2,a,serif_darkness,-cap_jut); |
| 184 |
serif(2,1,b,serif_darkness,-cap_jut); serif(2,1,c,serif_darkness, cap_jut); |
| 185 |
fi |
| 186 |
penlabels(0,1,2,3,4,5,6,7); endchar; % end of "F" |
| 187 |
|
| 188 |
cmchar "The letter G"; |
| 189 |
beginchar("G",2u#+.9side#, cap_height#, 0); |
| 190 |
adjust_fit(0, cap_serif_fit#); |
| 191 |
if monospace: pickup fine.nib; else: pickup tiny.nib;fi |
| 192 |
% This code is identical to that for the letter C. |
| 193 |
numeric alpha; alpha=w-u-thick; |
| 194 |
pos2(thin, 90); x2=.5[x3r,x0r]; top y2r=h+o;% topmost pen position |
| 195 |
pos3(thick,180); lft z3r=(u,h/2); |
| 196 |
pos4(thin, 270); x4=x2; bot y4r=-o; |
| 197 |
pos0(thick,0); lft z0l=(w+thick-u,h/2); |
| 198 |
path p, p', line.u, line.b; line.u=(alpha,1.5h)--(alpha,h/2); |
| 199 |
line.b=(.5[alpha,x0],0)--(.5[alpha,x0],h/2); |
| 200 |
p=pulled_arc.r(0,2)&pulled_arc.r(2,3)&pulled_arc.r(3,4) |
| 201 |
&pulled_arc.r(4,0)&cycle; |
| 202 |
p'=pulled_arc.l(0,2)&pulled_arc.l(2,3)&pulled_arc.l(3,4) |
| 203 |
&pulled_arc.l(4,0)&cycle; |
| 204 |
z'1l=line.u intersectionpoint p'; z'1r=line.u intersectionpoint p; |
| 205 |
bot rt z1l=z'1l; top rt z1r=z'1r; z1=.5[z1l,z1r]; |
| 206 |
z'5l=line.b intersectionpoint p'; z'5r=line.b intersectionpoint p; |
| 207 |
top rt z5l=z'5l; bot rt z5r=z'5r; z5=.5[z5r, z5l]; |
| 208 |
if not monospace: x1l:=x1l+.6thin; y1l:=y1r-1.75thick-2tiny; |
| 209 |
y5r:=y5r-o; y5l:=2thick+y5r-2tiny; fi |
| 210 |
if monospace: x1:=x1l:=x1r:=x5; y1:=y1-thin; y1l:=y1l-thin; y1r:=y1r-.6thin; fi |
| 211 |
% readjust to have a better opening in CDTT |
| 212 |
numeric slope_factor; if monospace:slope_factor=4/3; else:slope_factor=3/4; fi |
| 213 |
% Addtional G work (preceding program is the same as that for letter C)! |
| 214 |
path p,p',line.o, line.i; |
| 215 |
p=z1r{-1,slope_factor}..{left}pulled_arc.r(2,3)& |
| 216 |
pulled_arc.r(3,4){right}..tension 0.9..z5r; |
| 217 |
p'= reverse |
| 218 |
(z1l..tension 0.9..{left}pulled_arc.l(2,3)&pulled_arc.l(3,4){right} |
| 219 |
..tension 0.9..z5l); |
| 220 |
pos7(thick,0); |
| 221 |
top rt z7r=(w-0u-cap_jut,.9h/2); |
| 222 |
numeric counter; counter=0; |
| 223 |
forever: |
| 224 |
counter:=counter+1; |
| 225 |
line.o:=z7r--(x7r,-2o); line.i:=(z7r-(thick,0))--(x7r-thick,-2o); |
| 226 |
numeric t[],tt[]; |
| 227 |
(t1,tt1)=p intersectiontimes line.o; (t2,tt2)=p' intersectiontimes line.i; |
| 228 |
exitif t1*t2>0; forsuffixes $$=l, r: x7$$:=x7$$-.1u; endfor |
| 229 |
x7:=x7-.1u; endfor |
| 230 |
x6r=x7r; x6l=x7l; bot y6r=ypart point t1 of p; bot y6l=ypart point t2 of p'; |
| 231 |
z6=.5[z6r,z6l]; |
| 232 |
p:= subpath(0,t1) of p..(z6r-xeps+yeps)--(z6l+xeps+yeps).. |
| 233 |
subpath(t2,infinity) of p'..(z1l+xeps)--cycle; |
| 234 |
filldraw p; |
| 235 |
filldraw z6l--z7l--z7r--z6r--cycle; |
| 236 |
if serifs: serif(7,6,a,serif_darkness,-cap_jut); |
| 237 |
serif(7,6,b,serif_darkness, cap_jut); fi |
| 238 |
penlabels(0,1,2,3,4,5,6,7); endchar; |
| 239 |
|
| 240 |
cmchar "The letter H"; |
| 241 |
beginchar("H", u#+2cap_jut#+.8side#, cap_height#,0); |
| 242 |
adjust_fit(cap_serif_fit#, cap_serif_fit#); pickup tiny.nib; |
| 243 |
forsuffixes t=1,2,3,4: pos.t(thick,0); endfor |
| 244 |
lft x1l=lft x2l=.5u+cap_jut; bot y2=0; top y1=h; |
| 245 |
filldraw stroke z1e--z2e; % left vertical stem |
| 246 |
x3=x4=w-x1; y3=y1; y4=y2; |
| 247 |
filldraw stroke z3e--z4e; % right vertical stem |
| 248 |
pos5(thin, 90); pos6(thin,90); |
| 249 |
x5=.5[x1r,x1l]; x6=w-x5; top y5r=top y6r=h/2; |
| 250 |
filldraw stroke z5e--z6e; % horizontal crossbar |
| 251 |
if serifs: |
| 252 |
serif(1,2,a,serif_darkness,-cap_jut); serif(1,2,b,serif_darkness,cap_jut); |
| 253 |
serif(2,1,c,serif_darkness,-cap_jut); serif(2,1,d,serif_darkness,cap_jut); |
| 254 |
serif(3,4,e,serif_darkness,-cap_jut); serif(3,4,f,serif_darkness,cap_jut); |
| 255 |
serif(4,3,g,serif_darkness,-cap_jut); serif(4,3,h,serif_darkness,cap_jut); fi |
| 256 |
labels(1,2,3,4,5,6); endchar; |
| 257 |
|
| 258 |
cmchar "The letter I"; |
| 259 |
beginchar("I", .5u#+2cap_jut#+cap_stem#+.5u#, cap_height#,0); |
| 260 |
adjust_fit(cap_serif_fit#, cap_serif_fit#); |
| 261 |
pickup tiny.nib; checkthin; pos1(cap_stem,0); pos2(cap_stem,0); |
| 262 |
x1=x2=hround(w/2); top y1=h; bot y2=0; |
| 263 |
filldraw stroke z1e--z2e; % vertical stem |
| 264 |
if serifs: |
| 265 |
serif(1, 2, a, serif_darkness, -cap_jut); |
| 266 |
serif(1, 2, b, serif_darkness, cap_jut); % top lft,rt |
| 267 |
serif(2, 1, c, serif_darkness, -cap_jut); |
| 268 |
serif(2, 1, d, serif_darkness, cap_jut); % bot lft,rt |
| 269 |
fi |
| 270 |
penlabels(1, 2); endchar; |
| 271 |
|
| 272 |
cmchar "The letter J"; |
| 273 |
beginchar("J",u#+3thick#+cap_jut#,cap_height#, 1/4 cap_height#); |
| 274 |
adjust_fit(0, cap_serif_fit#); pickup tiny.nib; |
| 275 |
pos1(thick,0); pos2(thick,0); pos3(thin, -90); |
| 276 |
top y1=h; rt x1r=w-.5u-cap_jut; x2=x1; bot y2=0; lft x3=.5u; bot y3r=-d; |
| 277 |
filldraw stroke z1e--z2e{down}..{left}z3e; |
| 278 |
if serifs: serif(1,2,a,serif_darkness,-cap_jut); |
| 279 |
serif(1,2,b,serif_darkness,cap_jut); fi |
| 280 |
penlabels(1,2,3); endchar; |
| 281 |
|
| 282 |
cmchar "The letter K"; |
| 283 |
beginchar("K", 3/2u#+cap_jut#+.9side#, cap_height#,0); |
| 284 |
adjust_fit(cap_serif_fit#,0); pickup tiny.nib; |
| 285 |
pair durer[]; % represent D\"urer's corner points |
| 286 |
durer1=(.5u,h); durer2=(w-u,h); durer3=(xpart durer1,0); |
| 287 |
durer4=(xpart durer2,0); |
| 288 |
numeric diag_angle[]; diag_angle1=angle(durer2-durer3); |
| 289 |
diag_angle2=angle(durer1-durer4); |
| 290 |
numeric alpha; alpha=((xpart durer2 - xpart durer1)++h)/h; |
| 291 |
pos1(thick,0); pos2(thick,0); lft x1l=lft x2l=.5u+cap_jut; |
| 292 |
top y1=h; bot y2=0; filldraw stroke z1e--z2e; % left stem |
| 293 |
pos3(alpha*thin,0); pos4(alpha*thin,0); rt x4r=rt x1r; y4=h/2; |
| 294 |
top y3=h; z3r-z4r=whatever*(durer2-durer3); |
| 295 |
z0=whatever[z1r,z2r]=whatever[z3l,z4l]; |
| 296 |
filldraw z0--z3l--z3r--z4r--cycle; % upper diagonal stroke |
| 297 |
pos5(thick,diag_angle1); z5=whatever[z3,z4]; |
| 298 |
z0-z5l=whatever*(durer1-durer4); |
| 299 |
numeric nibs; nibs=.5thin; |
| 300 |
if monospace or not serifs: nibs:=thin; fi |
| 301 |
pos6(nibs,90); bot rt z6l=durer4; |
| 302 |
z5l-z7l=whatever*(durer1-durer4); z.g=(xpart durer2-thin,h/2); |
| 303 |
z.g-z7l=whatever*(durer2-durer3); |
| 304 |
z.h=(xpart durer2, h/4); |
| 305 |
if monospace or not serifs: z.g else: z.h fi-z7r=whatever*(durer2-durer3); |
| 306 |
z5r-z7r=whatever*(durer1-durer4); |
| 307 |
if serifs or not monospace: % reset x7 if necessary |
| 308 |
if (x7r-x1l)/(x6-x1l)>.82: numeric temp; temp=x7r; x7r:=.82*(x6-x1l)+x1l; |
| 309 |
temp:=temp-x7r; x7l:=x7l-temp; fi fi %!!!Bug--Missing fi on this line. |
| 310 |
filldraw z5r--z5l--z7l{z7l-z5l}..{right}z6l--z6r{left}..{durer1-durer4}z7r |
| 311 |
--cycle; |
| 312 |
if serifs: |
| 313 |
numeric old_jut, old_brack; old_jut=cap_jut; old_brack=bracket; |
| 314 |
serif(1,2,a,serif_darkness,-cap_jut); serif(1,2,b,serif_darkness,cap_jut); |
| 315 |
serif(2,1,c,serif_darkness,-cap_jut); serif(2,1,d,serif_darkness,cap_jut); |
| 316 |
bracket:=.5old_brack;cap_jut:=.5old_jut; |
| 317 |
if not monospace: serif(3,4,e,serif_darkness,-cap_jut); fi |
| 318 |
bracket:=2old_brack; cap_jut:=2old_jut; |
| 319 |
serif(3,4,f,.6serif_darkness,if monospace:.7 fi cap_jut); |
| 320 |
cap_jut:=old_jut; bracket:=old_brack; |
| 321 |
fi |
| 322 |
penlabels(0,1,2,3,4,5,6,7); endchar; |
| 323 |
|
| 324 |
cmchar "The letter L"; |
| 325 |
numeric topbar_; if monospace: topbar_=11/15; |
| 326 |
else: topbar_=17/30; fi % Duerer's wierd value |
| 327 |
beginchar("L", hstretch*(topbar_+1/6)*side#+u#, cap_height#,0); |
| 328 |
adjust_fit(cap_serif_fit#,0); |
| 329 |
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); |
| 330 |
lft x1l=lft x2l=.5u+cap_jut; top y1=h; bot y2=0; |
| 331 |
filldraw stroke z1e--z2e; % stem |
| 332 |
pickup crisp.nib; % prepare for arms and serifs |
| 333 |
pos3(thin,90); pos4(dslab,0); |
| 334 |
rt x4l=topbar_*side; bot y4=vround(h-vstretch*thick); |
| 335 |
pos8(thin,-90); pos9(dslab,0); x8=x2; bot y8r=0; rt x9r=hround(w-.5u); |
| 336 |
y9=y8r+thin+vstretch*1/6side; foot(8,9,g,serif_darkness,x9-x4-thick); |
| 337 |
% lower arm |
| 338 |
if serifs: serif(1,2,a,serif_darkness,-cap_jut); |
| 339 |
serif(2,1,b,serif_darkness,-cap_jut); serif(1,2,d,serif_darkness,cap_jut); |
| 340 |
if not monospace: temp_:=slab; slab:=thin; |
| 341 |
serif(2,1,c,serif_darkness,cap_jut); |
| 342 |
slab:=temp_; fi fi |
| 343 |
penlabels(0,1,2,3,4,5,6,7,8,9); endchar; % end of "L" |
| 344 |
|
| 345 |
cmchar"The letter M"; |
| 346 |
beginchar("M", u#+2cap_jut#+.8side#, cap_height#, 0); |
| 347 |
adjust_fit(cap_serif_fit#, cap_serif_fit#); pickup tiny.nib; |
| 348 |
pos1(thin,0); pos2(thin,0); lft x1l=lft x2l=.5u+cap_jut; top y1=h; bot y2=0; |
| 349 |
pos3(thick,0); pos4(thick,0); x3r=x4r=w-x1l; top y3=h; bot y4=0; |
| 350 |
filldraw stroke z1e--z2e; % left vertical stem |
| 351 |
filldraw stroke z3e--z4e; % right vertical stem |
| 352 |
numeric long, short, hypot, alpha; long=h-bracket; short=w/2-thin-cap_jut; |
| 353 |
hypot=long++short; alpha=hypot/long; |
| 354 |
pos5(alpha*thick,0); pos6(alpha*thick,0); |
| 355 |
z5l=z1l; bot lft z6l=(w/2-.5currentbreadth,if not monospace:0 else:h/3 fi); |
| 356 |
pos7(alpha*thin,0); pos8(alpha*thin,0); |
| 357 |
z6l=z7r; z8l=z3l; z0=whatever[z5r,z6r]=whatever[z7l,z8l]; |
| 358 |
filldraw z5r--z0--z8l--z8r--z6l--z5l--cycle; |
| 359 |
if serifs: |
| 360 |
serif(2,1,a,serif_darkness,-cap_jut); serif(1,2,b,serif_darkness,-cap_jut); |
| 361 |
% left serifs |
| 362 |
serif(3,4,c,serif_darkness, cap_jut); serif(4,3,d,serif_darkness, cap_jut); |
| 363 |
% right serifs |
| 364 |
serif(2,1,e,serif_darkness,cap_jut); serif(4,3,f,serif_darkness,-cap_jut); |
| 365 |
% lower, inner serifs |
| 366 |
fi |
| 367 |
penlabels(0,1,2,3,4,5,6,7,8); endchar; |
| 368 |
|
| 369 |
cmchar "The letter N"; |
| 370 |
beginchar("N", u#+2cap_jut#+.8side#, cap_height#,0); |
| 371 |
adjust_fit(cap_serif_fit#, cap_serif_fit#); pickup tiny.nib; |
| 372 |
numeric long, short, hypot, alpha; long=h; short=side-2cap_jut; |
| 373 |
hypot=long++short; alpha=hypot/long; |
| 374 |
pos1(thin,0); pos2(thin,0); lft x1l=lft x2l=.5u+cap_jut; top y1=h; bot y2=0; |
| 375 |
pos3(thin,0); pos4(thin,0); x3=x4; x3r=w-x1l; y3=y1; y4=y2-o; |
| 376 |
pos 5(alpha*thick,0); pos6(alpha*thick,0); |
| 377 |
z5r=z1r; z6l=z4r; z0=whatever[z1r,z2r]=whatever[z5l,z6l]; % under notch point |
| 378 |
z0'=whatever[z5r,z6r]=whatever[z3l,z4l]; |
| 379 |
filldraw z1r--z1l--z2l--z2r--z0--z6l--z3r--z3l--z0'--cycle; |
| 380 |
if serifs: |
| 381 |
serif(2,1,b,serif_darkness,-cap_jut); serif(2,1,c,serif_darkness,cap_jut); |
| 382 |
% bottom, left serifs |
| 383 |
serif(3,4,d,serif_darkness,-cap_jut);serif(3,4,e,serif_darkness,cap_jut); |
| 384 |
% top right serifs |
| 385 |
z.a=(x1l-1.5cap_jut,y1); pickup tiny.nib; filldraw |
| 386 |
z0{z0-z4r}..{left}(z.a-(0,eps))..z.a--z1r--cycle; |
| 387 |
fi |
| 388 |
penlabels(0,0',1,2,3,4,5,6); endchar; |
| 389 |
|
| 390 |
cmchar "The letter O"; |
| 391 |
beginchar("O", 2u#+side#, cap_height#, 0); |
| 392 |
adjust_fit(0,0); pair durer[]; |
| 393 |
x2r=u; x4r=w-u; y1r=h+o; y3r=-o; z0=(w/2,h/2); |
| 394 |
z0=.5[z5,z6]; numeric axis_angle; |
| 395 |
durer1=(x2r,y1r-o); durer2=(x4r, ypart durer1); |
| 396 |
durer3=(xpart durer1, y3r+o); durer4=(xpart durer2, ypart durer3); |
| 397 |
axis_angle=angle(durer2-durer3); |
| 398 |
z5-z6=(thick,0)rotated axis_angle; |
| 399 |
y2r=y6; y4r=y5; x1r=x5; x3r=x6; |
| 400 |
forsuffixes $=1,2,3,4: z$=.5[z$l,z$r]; endfor |
| 401 |
x1l=x3r; y1l-y6=y6-y3r; x5-x2l=x4r-x5; y2l=y4r; |
| 402 |
x3l=x1r; y1r-y5=y5-y3l; x4l-x6=x6-x2r; y4l=y2r; |
| 403 |
path p,p'; |
| 404 |
p=pulled_arc.r(1,2)&reverse pulled_arc.r(3,2)& |
| 405 |
pulled_arc.r(3,4)&reverse pulled_arc.r(1,4)&cycle; |
| 406 |
path anti_diag; anti_diag=z0--durer1; |
| 407 |
z21r=p intersectionpoint anti_diag; penpos21(thin, axis_angle+90); |
| 408 |
x43r=w-x21r; y43r=h-y21r; penpos43(thin, axis_angle+270); |
| 409 |
path diag; diag=z0--durer2; |
| 410 |
z41r=diag intersectionpoint p; penpos41(thick, axis_angle); |
| 411 |
x32r=w-x41r; y32r=h-y41r; penpos32(thick, axis_angle+180); |
| 412 |
if not monospace: p'= |
| 413 |
z1l{left}..z21l..z2l{down}..z32l.. |
| 414 |
z3l{right}..z43l.. |
| 415 |
z4l{up}..z41l..{left}cycle; |
| 416 |
else:p'=z1l..z21l..z32l..z3l..z43l..z41l..cycle; fi |
| 417 |
fill p; unfill p'; |
| 418 |
penlabels(0,1,2,3,4,5,6,21,32,43,41); endchar; |
| 419 |
|
| 420 |
cmchar "The letter P"; |
| 421 |
beginchar("P", 1.5u#+P_width#, cap_height#, 0); |
| 422 |
adjust_fit(cap_serif_fit#, 0); |
| 423 |
pickup tiny.nib; pos1(thick,0); pos2(thick,0); |
| 424 |
top lft z1l=(.5u+cap_jut,h); bot lft z2l=(.5u+cap_jut,0); |
| 425 |
filldraw stroke z1e--z2e; % vertical stem |
| 426 |
pos3(thin,90); pos4(thin,90); pos5(thick,0); |
| 427 |
pos6(if not monospace and serifs: .5thin else:thin fi,-90); |
| 428 |
top y3r=top y4r=h; x3=x1; x4=x1r+thick; filldraw stroke z3e--z4e; |
| 429 |
x6=x4; y6=hround h/2; rt x5r=hround(w-u); y5=.5[y4,y6]; |
| 430 |
y7=y6; if serifs: x7=.75[rt x1r, x6]; else: x7=x3; fi |
| 431 |
pos7(if not monospace and serifs:.5thin else:thin fi,-90); |
| 432 |
filldraw stroke pulled_super_arc.e(4,5,eta)&pulled_super_arc.e(5,6,eta) |
| 433 |
..z7e; % lobe |
| 434 |
if serifs: serif(1,2,a,serif_darkness,-cap_jut); |
| 435 |
serif(2,1,b,serif_darkness,-cap_jut); |
| 436 |
serif(2,1,c,serif_darkness,cap_jut); fi |
| 437 |
penlabels(1,2,3,4,5,6,7); endchar; |
| 438 |
|
| 439 |
cmchar "The letter Q"; |
| 440 |
beginchar("Q", 2u#+side#, cap_height#, 0); |
| 441 |
adjust_fit(0,0); pair durer[]; |
| 442 |
x2r=u; x4r=w-u; y1r=h+o; y3r=-o; z0=(w/2,h/2); |
| 443 |
z0=.5[z5,z6]; numeric axis_angle; |
| 444 |
durer1=(x2r,y1r-o); durer2=(x4r, ypart durer1); |
| 445 |
durer3=(xpart durer1, y3r+o); durer4=(xpart durer2, ypart durer3); |
| 446 |
axis_angle=angle(durer2-durer3); |
| 447 |
z5-z6=(thick,0)rotated axis_angle; |
| 448 |
y2r=y6; y4r=y5; x1r=x5; x3r=x6; |
| 449 |
forsuffixes $=1,2,3,4: z$=.5[z$l,z$r]; endfor |
| 450 |
x1l=x3r; y1l-y6=y6-y3r; x5-x2l=x4r-x5; y2l=y4r; |
| 451 |
x3l=x1r; y1r-y5=y5-y3l; x4l-x6=x6-x2r; y4l=y2r; |
| 452 |
path p,p'; |
| 453 |
p=pulled_arc.r(1,2)&reverse pulled_arc.r(3,2)& |
| 454 |
pulled_arc.r(3,4)&reverse pulled_arc.r(1,4)&cycle; |
| 455 |
path anti_diag; anti_diag=z0--durer1; |
| 456 |
z21r=p intersectionpoint anti_diag; penpos21(thin, axis_angle+90); |
| 457 |
x43r=w-x21r; y43r=h-y21r; penpos43(thin, axis_angle+270); |
| 458 |
path diag; diag=z0--durer2; |
| 459 |
z41r=diag intersectionpoint p; penpos41(thick, axis_angle); |
| 460 |
x32r=w-x41r; y32r=h-y41r; penpos32(thick, axis_angle+180); |
| 461 |
if not monospace: p'= |
| 462 |
z1l{left}..z21l..z2l{down}..z32l.. |
| 463 |
z3l{right}..z43l.. |
| 464 |
z4l{up}..z41l..{left}cycle; |
| 465 |
else:p'=z1l..z21l..z32l..z3l..z43l..z41l..cycle; fi |
| 466 |
fill p; unfill p'; |
| 467 |
% now for the tail! |
| 468 |
numeric thick',thick''; thick'=(1-tail_corr)*thick; thick''=(1+tail_corr)*thick; |
| 469 |
numeric tail_slope; tail_slope=-20/36; % measured from D\"urer's figure |
| 470 |
z10r=p intersectionpoint (z0--(x4r,0)); |
| 471 |
z10l=p intersectionpoint (quartercircle rotated 180 scaled 2thick' |
| 472 |
shifted z10r); |
| 473 |
y12r-y10r=tail_slope*(x12r-x10r); x12r=4/3x4r; |
| 474 |
numeric tail_angle; tail_angle=angle(z10r-z12r)-90; |
| 475 |
penpos12(thick',tail_angle); |
| 476 |
penpos11(thick'', tail_angle); z11=(x4r,0); |
| 477 |
if not monospace: |
| 478 |
x14=19/8 x4r; y14=-3/8h; penpos14(max(2,eps),90); |
| 479 |
numeric tail_length; tail_length=x14-x10r; |
| 480 |
penpos13(max(2,tail_corr*thick),90); |
| 481 |
x13=x14-1/9tail_length; y13=(1+.25tail_corr)*y14; |
| 482 |
fi |
| 483 |
fill stroke z10.e..z11.e..z12.e if not monospace:..z13.e{right}..z14.e fi; |
| 484 |
penlabels(0,1,2,3,4,5,6,10,11,12,13,14,15); endchar; |
| 485 |
|
| 486 |
cmchar "The letter R"; |
| 487 |
beginchar("R", .5u#+max(cap_jut#+.9side#,1.5P_width#), cap_height#,0); |
| 488 |
adjust_fit(cap_serif_fit#,0); |
| 489 |
pickup tiny.nib; pos1(thick,0); pos2(thick,0); |
| 490 |
top lft z1l=(.5u+cap_jut,h); bot lft z2l=(.5u+cap_jut,0); |
| 491 |
filldraw stroke z1e--z2e; % vertical stem |
| 492 |
pos3(thin,90); pos4(thin,90); pos5(thick,0); |
| 493 |
pos6(thin, -90); |
| 494 |
top y3r=top y4r=h; x3=x1; x4=x1r+thick; |
| 495 |
x6=x4; y6=hround h/2; rt x5r=hround(.5u+P_width if not monospace: |
| 496 |
+1/2thin fi); y5=.5[y4,y6]; |
| 497 |
y7=y6; x7=x3; pos7(thin, -90); |
| 498 |
filldraw stroke z3e--pulled_super_arc.e(4,5,eta)& |
| 499 |
pulled_super_arc.e(5,6,eta)..z7e; % lobe |
| 500 |
numeric half_letter_width; 2half_letter_width+1/2u=w; |
| 501 |
if serifs: half_letter_width:=half_letter_width+1/2u; |
| 502 |
else: half_letter_width:=half_letter_width-1.6thin; fi |
| 503 |
path p; p=pulled_super_arc.r(5,6,eta)..z7r; |
| 504 |
z0r=p intersectionpoint ((half_letter_width,0)--(half_letter_width,h)); |
| 505 |
path circ_; circ_= (((halfcircle scaled 2thick) rotated 180) shifted z0r); |
| 506 |
z0l= p intersectionpoint circ_; |
| 507 |
if not monospace: z0'=(.45[half_letter_width,w],0); |
| 508 |
else: z0'=(.42[half_letter_width,w],0); fi |
| 509 |
numeric tail_angle; tail_angle=angle(z0l-z0'); |
| 510 |
penpos8(thick, tail_angle-90); z8l=whatever[z0', z0l]; |
| 511 |
x8=1/5[half_letter_width,w]; |
| 512 |
penpos9(2/3thick,tail_angle-90); z9r=whatever[z0r, z8r]; |
| 513 |
x9r=.5[half_letter_width, w]; |
| 514 |
%penpos10(if monospace:1/2 fi dslab,90); z10l=(w,0); |
| 515 |
penpos10(if monospace:1/2 dslab else: .5thin fi,90); z10l=(w,0); |
| 516 |
fill z0l--z8l...{right}z10l--z10r{-w,1/4h}..z9r--z0r--cycle; % tail |
| 517 |
if serifs: serif(1,2,a,serif_darkness,-cap_jut); |
| 518 |
serif(2,1,b,serif_darkness,-cap_jut); |
| 519 |
serif(2,1,c,serif_darkness,cap_jut); fi |
| 520 |
penlabels(0,1,2,3,4,5,6,7,8,9,10); labels(0'); endchar; |
| 521 |
|
| 522 |
cmchar "The Knuthian S"; |
| 523 |
beginchar("S", 2u#+1/2 side# if not monospace:+thick# fi, cap_height#, 0); |
| 524 |
adjust_fit(0,0); pickup tiny.nib; |
| 525 |
pair durer[]; % points to contain corner coords of Durer square |
| 526 |
ypart durer3=ypart durer4=0; xpart durer4-xpart durer1=side; |
| 527 |
xpart durer1=u-1.5thick; |
| 528 |
durer1=(xpart durer3, h); durer2=(xpart durer 4, ypart durer1); |
| 529 |
numeric slope, diag_angle; diag_angle=angle(durer2-durer3); |
| 530 |
slope=-if not monospace: 3/4 else: 1/2 fi h/(xpart durer4-xpart durer3); |
| 531 |
pos0(thick,diag_angle); x0=.52[xpart durer1, xpart durer2]; |
| 532 |
y0=h/2; |
| 533 |
lft x3l=u if not monospace:+2/3thick fi; rt x3r=lft x3l+5/6thick; |
| 534 |
pos2(thin,-diag_angle); top y2l=h+o; |
| 535 |
if x0-x3r>thick: x2l=x0 if monospace:+.4thin fi; else: |
| 536 |
x2l=x0r; slope:=-1/2; fi |
| 537 |
%if not monospace: |
| 538 |
% if x2-rt x3r<thick: x2:=lft x3r+thick; x2l:=x2r:=x2; fi fi |
| 539 |
ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r); |
| 540 |
pos7(thin,-diag_angle); x7r=x0; bot y7r=-o; rt x6r=w-if monospace:.75 fi u; |
| 541 |
lft x6l=rt x6r-thick; |
| 542 |
ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r); |
| 543 |
pos1(max(currentbreadth+eps,5/6 thick),-90); |
| 544 |
top y1l=h+o-thin; rt x1=x0+2thick+o; |
| 545 |
pos8(1.5thick,-80);lft x8r=u; bot y8r=thin-o; |
| 546 |
if not monospace: |
| 547 |
filldraw z1l..z2l{left}..{down}z3l..z4l--z5l..{down}z6l..{left}z7l..z8l |
| 548 |
--z8r..{right}z7r..{up}z6r..z5r--z4r..{up}z3r..{right}z2r..z1r--cycle; |
| 549 |
else: draw z1l..z2l{left}..{down}z3l..z4l--z5l..{down}z6l..{left}z7l..z8l; |
| 550 |
draw z8r..{right}z7r..{up}z6r..z5r--z4r..{up}z3r..{right}z2r..z1r; |
| 551 |
fi |
| 552 |
penlabels(0,1,2,3,4,5,6,7,8); endchar; |
| 553 |
|
| 554 |
cmchar "The letter T"; |
| 555 |
beginchar("T",2u#+.9side#, cap_height#,0); |
| 556 |
adjust_fit(0,0); pickup tiny.nib; |
| 557 |
pos1(thick,0); pos2(thick,0); .5[x1r,x1l]=w/2; .5[x2r,x2l]=w/2; |
| 558 |
top y1=h; bot y2=0; filldraw stroke z1e--z2e; % central stem |
| 559 |
numeric alpha, stroke_angle; stroke_angle=55; |
| 560 |
if monospace: alpha=1; else: alpha=sqrt2; fi |
| 561 |
if not serifs: stroke_angle:=90; alpha:=1; fi % sans-serif values |
| 562 |
pos3(alpha*thin,stroke_angle); pos4(alpha*thin,stroke_angle); |
| 563 |
lft x3l=u; top y3r=h; x4r=w-x3l; y4=y3; |
| 564 |
filldraw stroke z3e--z4e; % top horizontal |
| 565 |
if serifs: |
| 566 |
serif(2,1,a,serif_darkness,-cap_jut);serif(2,1,b,serif_darkness,cap_jut); |
| 567 |
T_flourish(3,4,c,.75serif_darkness,.5serif_darkness); |
| 568 |
T_flourish(4,3,d,.5serif_darkness,.75serif_darkness); |
| 569 |
fi |
| 570 |
penlabels(1,2,3,4); endchar; |
| 571 |
|
| 572 |
cmchar "The letter U"; |
| 573 |
beginchar("U", u#+2cap_jut#+.8side#, cap_height#,0); |
| 574 |
adjust_fit(cap_serif_fit#, cap_serif_fit#); |
| 575 |
pickup tiny.nib; pos1(thick,0); pos2(thick,0); pos2'(thick,180); |
| 576 |
pos3(thin,-90); pos4(thin,0); pos5(thin,0); |
| 577 |
x1=x2; x3=.5[x1,x5]; x4=x5; x1l=w-x5r; |
| 578 |
top y1=top y5=h; y2=y4=1/3h; bot y3r=-o; z2'=z2; |
| 579 |
lft x1l=hround .5u+cap_jut; |
| 580 |
filldraw stroke z1e--z2e; % left stem |
| 581 |
filldraw stroke pulled_super_arc.e(2',3,eta) |
| 582 |
& pulled_super_arc.e(3,4,eta)&z4e--z5e; |
| 583 |
if serifs: serif(1,2,a,serif_darkness,-cap_jut); |
| 584 |
serif(1,2,b,serif_darkness,cap_jut); |
| 585 |
serif(5,4,c,serif_darkness,-cap_jut); serif(5,4,d,serif_darkness,cap_jut); fi |
| 586 |
penlabels(1,2,3,4,5); endchar; |
| 587 |
|
| 588 |
cmchar "The letter V"; |
| 589 |
beginchar("V",2cap_jut_factor*cap_jut#+.8side#, cap_height#, 0); |
| 590 |
adjust_fit(cap_serif_fit#, cap_serif_fit#); pickup tiny.nib; |
| 591 |
numeric alpha; alpha=((h+cap_jut)++(w/2))/(h+cap_jut); |
| 592 |
pos1(alpha*thick,0); pos2(alpha*thick,0); |
| 593 |
pos3(alpha*thin,0); pos4(alpha*thin,0); |
| 594 |
top y1=top y4=h; lft x1l=cap_jut_factor*cap_jut; x4r=w-x1l; |
| 595 |
lft x2l=hround w/2; x3r=x2l; bot y2=bot y3=-apex_o; |
| 596 |
z0=whatever[z1r,z2r]=whatever[z3l,z4l]; % notch point |
| 597 |
filldraw z0--diag_end(0,4l,1,1,4r,3r)--z2l |
| 598 |
--diag_end(2l,1l,1,1,1r,0)--cycle; |
| 599 |
if serifs: bracket:=cap_jut_factor*bracket; cap_jut:=cap_jut_factor*cap_jut; |
| 600 |
pickup tiny.nib; numeric jut_factor; |
| 601 |
if monospace: jut_factor=1; else: jut_factor=3/4; fi |
| 602 |
serif(1,2,a,.8serif_darkness,-cap_jut); serif(4,3,d,.8serif_darkness,cap_jut); |
| 603 |
bracket:=jut_factor*bracket; |
| 604 |
serif(1,2,b,7/8 serif_darkness, jut_factor*cap_jut); |
| 605 |
serif(4,3,c,7/8 serif_darkness,-jut_factor*cap_jut); fi |
| 606 |
penlabels(0,1,2,3,4); endchar; |
| 607 |
|
| 608 |
cmchar "The letter W"; |
| 609 |
numeric alpha; |
| 610 |
alpha=((cap_height#+cap_jut#)++(.4side#+cap_jut_factor*cap_jut#))/ |
| 611 |
(cap_height#+cap_jut#); |
| 612 |
beginchar("W", 2cap_jut_factor*cap_jut#+1.6side#-alpha*thick#, cap_height#, 0); |
| 613 |
adjust_fit(.5cap_serif_fit#, cap_serif_fit#); pickup tiny.nib; |
| 614 |
mid_corr=if monospace: -apex_corr else: 1/3jut fi; |
| 615 |
pos1(alpha*thick,0); pos2(alpha*thick,0); |
| 616 |
pos3(alpha*thin,0); pos4(alpha*thin,0); |
| 617 |
pos5(alpha*thick,0); pos6(alpha*thick,0); |
| 618 |
pos7(alpha*thin,0); pos8(alpha*thin,0); |
| 619 |
numeric V_width; V_width=2cap_jut_factor*cap_jut+4/5side; |
| 620 |
if not monospace: |
| 621 |
top y1=top y4=h; lft x1l=cap_jut_factor*cap_jut; x4r=V_width-x1l; |
| 622 |
lft x2l=hround V_width/2; x3r=x2l; bot y2=bot y3=-apex_o; |
| 623 |
pair shift_amt; ypart shift_amt=0; |
| 624 |
xpart shift_amt=V_width-2cap_jut_factor*cap_jut-alpha*(thick); |
| 625 |
z0=whatever[z1r,z2r]=whatever[z3l,z4l]; % notch point |
| 626 |
path p; p=z0--diag_end(0,4l,1,1,4r,3r)--z2l |
| 627 |
--diag_end(2l,1l,1,1,1r,0)--cycle; |
| 628 |
filldraw p; filldraw (p shifted shift_amt); % the 2 V's |
| 629 |
forsuffixes t=1,2,3,4: z[t+4]=z.t shifted shift_amt; endfor |
| 630 |
else: top y1=h; lft x1l=cap_jut_factor*cap_jut; bot y2=bot y3=-apex_o; |
| 631 |
x2l+apex_corr=x3l; |
| 632 |
x8=w-x1; y8=y1; x2-x1=x4-x3=x6-x5=x8-x7; |
| 633 |
x6l+apex_corr=x7l; y6=y7=y2; |
| 634 |
y4:=vround .6h; y5=y4; |
| 635 |
x5=x4; |
| 636 |
y4l:=y4r:=y4; % ?? |
| 637 |
z0 =whatever[z1r,z2r]; |
| 638 |
z0'=whatever[z7l,z8l]; y0=y0'=h/9; |
| 639 |
z45=whatever[z3r,z4r]=whatever[z5l,z6l]; |
| 640 |
filldraw z0--diag_end(0,4l,1,1,4r,3r)--z2l--diag_end(2l,1l,1,1,1r,0)--cycle; |
| 641 |
filldraw z0'--diag_end(0',8l,1,1,8r,7r)--z7l--diag_end(7l,5l,1,1,5r,0') |
| 642 |
--cycle; fi |
| 643 |
if serifs: bracket:=cap_jut_factor*bracket; cap_jut:=cap_jut_factor*cap_jut; |
| 644 |
pickup tiny.nib; numeric jut_factor; |
| 645 |
if monospace: jut_factor=1.8; else: jut_factor=3/4; fi |
| 646 |
serif(1,2,a,.8serif_darkness,-cap_jut); |
| 647 |
serif(8,7,f,.8serif_darkness,cap_jut); |
| 648 |
if not monospace: serif(5,6,d,.8serif_darkness,cap_jut); |
| 649 |
serif(5,6,c,.8serif_darkness,-cap_jut); fi |
| 650 |
bracket:=jut_factor*bracket; |
| 651 |
serif(1,2,b,7/8 serif_darkness, jut_factor*cap_jut); |
| 652 |
serif(8,7,e,7/8 serif_darkness,-jut_factor*cap_jut); |
| 653 |
fi |
| 654 |
penlabels(0,0',1,2,3,4,5,6,7,8,45); endchar; |
| 655 |
|
| 656 |
cmchar "The letter X"; |
| 657 |
beginchar("X", 2cap_jut_factor*cap_jut#+.8side#, cap_height#, 0); |
| 658 |
adjust_fit(cap_serif_fit#, cap_serif_fit#); |
| 659 |
numeric alpha; alpha=(h++(w-2cap_jut_factor*cap_jut))/h; |
| 660 |
lft x1l=cap_jut_factor*cap_jut; top y1=h if monospace:-1/2 crisp fi; |
| 661 |
penpos1(alpha*thick, 0); |
| 662 |
x4r=w-x1l; bot y4=0 if monospace:+1/2 crisp fi; penpos4(alpha*thick,0); |
| 663 |
rt x2r=w-cap_jut_factor*cap_jut; y2=y1; penpos2(alpha*thin,0); |
| 664 |
x3l=w-x2r; y3=y4; penpos3(alpha*thin,0); |
| 665 |
fill diag_end(4r,1r,.5,1,1l,4l)--diag_end(1l,4l,.5,1,4r,1r)--cycle; %lft diag |
| 666 |
fill diag_end(2l,3l,.5,1,3r,2r)--diag_end(3r,2r,.5,1,2l,3l)--cycle; % rt diag |
| 667 |
if serifs: bracket:=cap_jut_factor*bracket; cap_jut:=cap_jut_factor*cap_jut; |
| 668 |
pickup tiny.nib; numeric jut_factor; |
| 669 |
if monospace: cap_jut:=.5cap_jut; jut_factor=1; else: jut_factor=3/4; fi |
| 670 |
serif(1,4,a,.8serif_darkness,-cap_jut);serif(4,1,d,.8serif_darkness,cap_jut); |
| 671 |
serif(2,3,f,.8serif_darkness,cap_jut);serif(3,2,g,.8serif_darkness,-cap_jut); |
| 672 |
bracket:=jut_factor*bracket; |
| 673 |
serif(1,4,b,7/8 serif_darkness,.75cap_jut); |
| 674 |
serif(4,1,c,7/8 serif_darkness,-.75cap_jut); |
| 675 |
serif(2,3,e,7/8 serif_darkness,-.75cap_jut); |
| 676 |
serif(3,2,h,7/8 serif_darkness,.75cap_jut); fi |
| 677 |
penlabels(1,2,3,4); endchar; |
| 678 |
|
| 679 |
cmchar "The letter Y"; |
| 680 |
beginchar("Y", 2cap_jut_factor*cap_jut#+.8side#, cap_height#, 0); |
| 681 |
adjust_fit(cap_serif_fit#, cap_serif_fit#); pickup pencircle scaled 0pt; |
| 682 |
numeric alpha, long, short, hypot; long=h/2; |
| 683 |
short=.5(w-thick)-cap_jut_factor*cap_jut; |
| 684 |
hypot=long++short; alpha=hypot/long; |
| 685 |
penpos1(thick,0); lft x1l=cap_jut_factor*cap_jut if monospace:+.5tiny fi; |
| 686 |
top y1=h if monospace:-.5tiny fi; |
| 687 |
penpos4(thin,0); x4r=w-x1l; y4=y1; |
| 688 |
penpos2(thick,0); penpos3(thin,0); |
| 689 |
penpos5(thick,0); penpos6(thick,0); |
| 690 |
x5=x6=w/2; bot y6=0 if monospace:+.5tiny fi; |
| 691 |
y5=if not monospace: h/2 else:3h/8 fi; |
| 692 |
x2l=x5l; x3r=x5r; y2=y3=if not monospace:h/2 else: 3h/8 fi; |
| 693 |
z0=whatever[z1r, z2r]=whatever[z3l,z4l]; % notch point |
| 694 |
fill z1l--z5l--z6l--z6r--z5r--z4r--z4l--z0--z1r--cycle; |
| 695 |
if serifs: numeric jut_factor; |
| 696 |
serif(6,5,e,serif_darkness,-.7cap_jut); serif(6,5,f,serif_darkness,.7cap_jut); |
| 697 |
% bottom serifs |
| 698 |
bracket:=cap_jut_factor*bracket; cap_jut:=cap_jut_factor*cap_jut; |
| 699 |
if monospace: cap_jut:=.5cap_jut; jut_factor=1; else: jut_factor=3/4; fi |
| 700 |
serif(1,2,a,serif_darkness,-.7cap_jut);serif(4,3,d,serif_darkness,.7cap_jut); |
| 701 |
% top, outer serifs |
| 702 |
bracket:=jut_factor*bracket; |
| 703 |
if monospace: cap_jut:=1.5cap_jut; fi |
| 704 |
serif(1,2,b,7/8 serif_darkness,.6cap_jut); |
| 705 |
serif(4,3,c,7/8 serif_darkness,-.6cap_jut); % top, inner serifs |
| 706 |
fi |
| 707 |
penlabels(0,1,2,3,4,5,6); endchar; % End of "Y" |
| 708 |
|
| 709 |
cmchar "The letter Z"; |
| 710 |
beginchar("Z", 2u#+.8side#, cap_height#,0); |
| 711 |
adjust_fit(0, 0); pickup tiny.nib; |
| 712 |
numeric alpha, long, short, hypot; |
| 713 |
long=h; short=w-2u-thick; hypot=long++short; |
| 714 |
alpha=hypot/long; |
| 715 |
pos1(thin,90); pos2(thin,90); pos3(alpha*thick, 0); |
| 716 |
pos4(alpha*thick, 0); pos5(thin,-90); pos6(thin,-90); |
| 717 |
rt x3r=w-u; top y3=h; x4l=w-x3r; bot y4=0; |
| 718 |
top y1r=h; lft x1=u; y2=y1; rt x2=x3; |
| 719 |
bot y5r=bot y6r=0; lft x5=x4; rt x6=w-u; |
| 720 |
filldraw stroke z1e--z2e; % top bar |
| 721 |
filldraw stroke z3e--z4e; % diagonal |
| 722 |
filldraw stroke z5e--z6e; % bottom bar |
| 723 |
if serifs: pickup crisp.nib; % prepare for arms and serifs |
| 724 |
pos7(thin, 90); pos8(dslab,180); z7=z2; lft x8r=u; |
| 725 |
bot y8=h-if monospace:2 fi vstretch*thick; |
| 726 |
arm(7,8,a,serif_darkness,0); % upper dropped serif |
| 727 |
pos9(thin,-90); z9=z5; pos10(dslab,0); rt x10r=w-u; |
| 728 |
top y10=if monospace: 2.5 fi vstretch*thick; |
| 729 |
arm(9,10,b,serif_darkness,0); fi |
| 730 |
penlabels(1,2,3,4,5,6,7,8,9,10); endchar; |
| 731 |
|
| 732 |
|