]> git.donarmstrong.com Git - lib.git/blob - texmf/metafont/kelly/grktxt.mf
added texmf
[lib.git] / texmf / metafont / kelly / grktxt.mf
1 % Attempt to generate a Greek alphabet for setting Greek texts
2 % Adapted by B Hamilton Kelly (29 Sept 1987) from
3 % The Computer Modern Math Italic family (by D. E. Knuth, 1979--1985)
4
5 % Computer Modern Greek caps, analogous to the uppercase Roman letters.
6 % Modified by BHK @RMCS 870902 --- see TUGboat 87#2 Errata & Changes supplement
7
8 % Computer Modern Roman upper case:
9 % These letters were originally coded by D. E. Knuth in November, 1979,
10 % inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
11 % Sans serif designs by Richard Southall were added in April, 1982.
12 % The programs were revised for the new \MF\ conventions in 1985.
13
14 % Computer Modern Roman lower case:
15 % These letters were originally coded by D. E. Knuth in November, 1979,
16 % inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
17 % Sans serif designs by Richard Southall were added in April, 1982.
18 % The programs were revised for the new \MF\ conventions in 1985.
19
20 % This lowercase Greek alphabet was prepared by D. E. Knuth in December, 1979,
21 % inspired by the Monotype faces used in {\sl The Art of Computer Programming}.
22 % (It has been designed for math formulas, not Greek texts.)
23 % The programs were revised for the new \MF\ conventions in 1985.
24
25 font_coding_scheme:="TeX Greek Alphabet";
26 mode_setup; font_setup;
27
28 font_slant slant; font_x_height x_height#;
29 if monospace: font_normal_space 9u#; % no stretching or shrinking
30  font_quad 18u#;
31  font_extra_space 9u#;
32 else: font_normal_space 6u#+2letter_fit#;
33  font_normal_stretch 3u#; font_normal_shrink 2u#;
34  font_quad 18u#+4letter_fit#;
35  font_extra_space 2u#; fi
36
37 % Greek Upper-case --- these programs taken from romanu and greeku.
38
39 cmchar "The letter Alpha";
40 beginchar("A",13u#,cap_height#,0);
41 adjust_fit(cap_serif_fit#,cap_serif_fit#);
42 numeric left_stem,right_stem,outer_jut,alpha;
43 right_stem=cap_stem-stem_corr;
44 left_stem=min(cap_hair if hefty: -3stem_corr fi,right_stem);
45 outer_jut=.8cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.5u; y1=y4=0;
46 x2-x1=x4-x3; x3r=x2r+apex_corr; y2=y3=h+apex_o+apex_oo;
47 alpha=diag_ratio(2,left_stem,y2-y1,x4r-x1l-apex_corr);
48 penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
49 penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
50 z0=whatever[z1r,z2r]=whatever[z3l,z4l];
51 if y0<h-cap_notch_cut: y0:=h-cap_notch_cut;
52  fill z0+.5right{down}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
53   --diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
54   ...{up}z0+.5left--cycle; % left and right diagonals
55 else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
56   --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
57 penpos5(whatever,angle(z2-z1)); z5=whatever[z1,z2];
58 penpos6(whatever,angle(z3-z4)); z6=whatever[z3,z4]; y6=y5;
59 if hefty: y5r else: y5 fi =5/12y0;
60 y5r-y5l=y6r-y6l=cap_band; penstroke z5e--z6e; % bar line
61 if serifs: numeric inner_jut; pickup tiny.nib;
62  prime_points_inside(1,2); prime_points_inside(4,3);
63  if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
64  else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
65  dish_serif(1',2,a,1/2,outer_jut,b,.6,inner_jut)(dark);  % left serif
66  dish_serif(4',3,c,1/2,inner_jut,d,1/3,outer_jut); fi  % right serif
67 penlabels(0,1,2,3,4,5,6); endchar;
68
69 cmchar "The letter Beta";
70 beginchar("B",12.5u#,cap_height#,0);
71 italcorr .75cap_height#*slant-.5u#;
72 adjust_fit(cap_serif_fit#,0);
73 numeric left_stem,right_curve,middle_weight;
74 left_stem=cap_stem-hround 2stem_corr; middle_weight=.6vair+.5;
75 pickup tiny.nib; pos1(left_stem,0); pos2(left_stem,0);
76 lft x1l=lft x2l=hround max(2u,3u-.5left_stem); top y1=h; bot y2=0;
77 filldraw stroke z1e--z2e; % stem
78 penpos3(cap_band,90); penpos4(cap_band,90);
79 penpos6(middle_weight,-90); penpos7(middle_weight,-90);
80 penpos8(middle_weight,90); penpos9(middle_weight,90);
81 penpos5(right_curve-stem_corr,0); penpos10(right_curve,0);
82 penpos11(cap_band,-90); penpos12(cap_band,-90);
83 z3r=top z1; y4=y3; y5=.5[y4,y6]; y6=y7; y7l-y8l=vair;
84 z12r=bot z2; y11=y12; y10=.5[y11,y9]; y8=y9; .5[y7l,y8l]=.52h;
85 x4=x6; x9=x11=x4+.5u; x7=x8=x1; x9l:=x4+.25u;
86 x5r=hround(w-1.5u); x10r=hround(w-u);
87 if serifs: right_curve=cap_curve-stem_corr; x4=.5[x1,w-1.5u];
88 else: right_curve=cap_curve-3stem_corr; x4=.5[x1,w-2.5u];
89  x4l:=x4l-.5u; x9l:=x9l-.5u; fi
90 x6l:=x6l-.5u; x11l:=x11l-.5u;
91 fill stroke z3e..super_arc.e(4,5) & super_arc.e(5,6)..z7e;  % upper lobe
92 fill stroke z8e..super_arc.e(9,10) & super_arc.e(10,11)..z12e;  % lower lobe
93 if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
94  nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi  % lower serif
95 math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9,10,11,12); endchar;
96
97 cmchar "Uppercase Greek Gamma";
98 beginchar("G",11u#-width_adj#,cap_height#,0);
99 italcorr cap_height#*slant-beak_jut#-.25u#;
100 adjust_fit(cap_serif_fit#,0);
101 h:=vround(h-stem_corr);
102 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
103 lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
104 filldraw stroke z1e--z2e; % stem
105 pickup crisp.nib; pos3(slab,90); pos4(hair,0);
106 top y3r=h; x3=x1; rt x4r=hround(w-.75u); y4=good.y(y3l-beak)-eps;
107 arm(3,4,e,beak_darkness,beak_jut);  % arm and beak
108 if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
109  dish_serif(2,1,c,1/3,cap_jut,d,1/3,1.25cap_jut); fi  % lower serif
110 math_fit(0,ic#-2.5u#); penlabels(1,2,3,4); endchar;
111
112 cmchar "Uppercase Greek Delta";
113 beginchar("D",15u#,cap_height#,0);
114 adjust_fit(0,0);
115 numeric left_stem,alpha;
116 left_stem=cap_hair if hefty: -3stem_corr fi;
117 x1l=w-x4r=.75u; y1=y4=0;
118 x2-x1=x4-x3; x3r=x2r+apex_corr; y2=y3=h+apex_o+apex_oo;
119 alpha=diag_ratio(2,left_stem,y2-y1,x4r-x1l-apex_corr);
120 penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
121 penpos3(alpha*cap_stem,0); penpos4(alpha*cap_stem,0);
122 fill diag_end(2l,1l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)--cycle;  % triangle
123 z0=whatever[z1r,z2r]=whatever[z3l,z4l];
124 y5=y6=cap_vstem; z5=whatever[z1r,z2r]; z6=whatever[z3l,z4l];
125 if y0<h-cap_notch_cut: y0:=h-cap_notch_cut;
126  unfill z0+.5right{down}...{z4-z3}z6--z5{z2-z1}
127   ...{up}z0+.5left--cycle; % counter
128 else: unfill z0--z5--z6--cycle; fi  % counter
129 penlabels(0,1,2,3,4,5,6); endchar;
130
131 cmchar "The letter Epsilon";
132 beginchar("E",12u#-width_adj#,cap_height#,0);
133 italcorr cap_height#*slant-beak_jut#-.5u#;
134 adjust_fit(cap_serif_fit#,0);
135 h:=vround(h-stem_corr);
136 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
137 lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
138 filldraw stroke z1e--z2e; % stem
139 pickup crisp.nib; pos3(slab,90); pos4(hair,0);
140 top y3r=h; x3=x1; rt x4r=hround(w-u); y4=good.y(y3l-beak)-eps;
141 arm(3,4,e,beak_darkness,beak_jut);  % upper arm and beak
142 pos5(cap_bar,-90); pos6(hair,0);
143 top y5l=vround(.52[y2,y1]+.5cap_bar); x5=x1;
144 pos0(cap_bar,90); pos7(hair,0);
145 z0=z5; x6=x7; y6-y5l=y0l-y7;
146 if serifs: rt x6r=hround(w-4.4u+.5hair); y6=good.y(y5l+.6beak)+eps;
147  rt x9r=hround(w-.5u);
148 else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
149 arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0);  % middle arm and serif
150 pos8(slab if not serifs:+2stem_corr fi,-90); pos9(hair,0);
151 bot y8r=0; x8=x2; y9=good.y(y8l+7/6beak)+eps;
152 arm(8,9,h,beak_darkness,1.5beak_jut);  % lower arm and beak
153 if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
154  nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi  % lower serif
155 math_fit(0,.5ic#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
156
157 cmchar "The letter Zeta";
158 beginchar("Z",11u#,cap_height#,0);
159 italcorr cap_height#*slant-.5u#;
160 adjust_fit(0,0);
161 numeric arm_thickness[],z_stem;
162 if hefty: arm_thickness1=Vround(slab-vair_corr); arm_thickness2=slab;
163  z_stem=.8[vair,cap_stem];
164 else: arm_thickness1=slab; arm_thickness2=vround(slab+vair_corr);
165  z_stem=.9[vair,cap_stem]; fi
166 pickup tiny.nib; x3l=x4l=w-x1r=w-x2r; lft x3l=hround u;
167 top y1=h; y2=min(y1,h-2/3arm_thickness1);
168 bot y4=0; y3=max(y4,2/3arm_thickness2);
169 numeric alpha; alpha=diag_ratio(1,z_stem-tiny,y2-y3,x2r-x3l);
170 penpos1(alpha*(z_stem-tiny),0); penpos2(alpha*(z_stem-tiny),0);
171 penpos3(alpha*(z_stem-tiny),0); penpos4(alpha*(z_stem-tiny),0);
172 pair delta; delta=penoffset z3-z2 of currentpen;
173 fill top lft z1l--z2l+delta---z3l+delta..lft z3l---lft z4l..bot z4l
174  ---bot rt z4r--z3r-delta---z2r-delta..rt z2r---rt z1r..top z1r
175  ---cycle;  % diagonal
176 pickup crisp.nib; pos5(arm_thickness1,90); pos6(hair,180);
177 top y5r=h; x5=x1; lft x6r=hround 1.25u; y6=good.y(y5l-beak)-eps;
178 arm(5,6,a,beak_darkness**.8,-.4beak_jut);  % upper arm and beak
179 pos7(arm_thickness2,-90); pos8(hair,0);
180 bot y7r=0; x7=x4; rt x8r=hround(w-.9u); y8=good.y(y7l+1.2beak)+eps;
181 arm(7,8,b,beak_darkness**.9,.6beak_jut);  % lower arm and beak
182 math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8); endchar;
183
184 cmchar "The letter H (Eta)";
185 beginchar("Y",13u#+width_adj#,cap_height#,0);
186 italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
187 adjust_fit(cap_serif_fit#,cap_serif_fit#);
188 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
189 pos3(cap_stem,0); pos4(cap_stem,0);
190 lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
191 top y1=top y3=h; bot y2=bot y4=0;
192 filldraw stroke z1e--z2e; % left stem
193 filldraw stroke z3e--z4e; % right stem
194 penpos5(cap_bar,90); penpos6(cap_bar,90);
195 x5=x1; x6=x3; y5=y6=.52h;
196 fill stroke z5e--z6e;  % bar
197 if serifs: numeric inner_jut;
198  if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
199  else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
200  dish_serif(1,2,a,1/3,cap_jut,b,1/3,inner_jut);  % upper left serif
201  dish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
202  dish_serif(3,4,e,1/3,inner_jut,f,1/3,cap_jut);  % upper left serif
203  dish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut); fi  % lower left serif
204 math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
205
206 cmchar "Uppercase Greek Theta";
207 beginchar(oct"012",14u#,cap_height#,0);
208 italcorr .7cap_height#*slant-.5u#;
209 adjust_fit(0,0);
210 numeric light_curve; light_curve=hround(cap_curve-2stem_corr);
211 penpos1(vair,90); penpos3(vround(vair+.5vair_corr),-90);
212 penpos2(light_curve,180); penpos4(light_curve,0);
213 if monospace: x2r=hround 1.5u;
214  interim superness:=sqrt superness;  % make |"O"|, not |"0"|
215 else: x2r=hround u; fi
216 x4r=w-x2r; x1=x3=.5w; y1r=h+o; y2=y4=.5h-vair_corr; y3r=-o;
217 penstroke pulled_super_arc.e(1,2)(.5superpull)
218  & pulled_super_arc.e(2,3)(.5superpull)
219  & pulled_super_arc.e(3,4)(.5superpull)
220  & pulled_super_arc.e(4,1)(.5superpull) & cycle;  % bowl
221 pickup crisp.nib; pos5(cap_vstem,90); pos6(cap_vstem,90);
222 lft x5=w-rt x6=hround(x2l+u)+1; y5=y6=.5[y1l,y3l];
223 filldraw stroke z5e--z6e;  % bar
224 if serifs: pos7(hair,0); pos8(hair,0); pos9(hair,0); pos10(hair,0);
225  x7l=x8l=x5; x9r=x10r=x6;
226  y7-y5r=y9-y6r=y5l-y8=y6l-y10=vround .05h;
227  filldraw stroke z7e--z8e;  % left serif
228  filldraw stroke z9e--z10e; fi  % right serif
229 math_fit(-.3cap_height#*slant-.5u#,ic#-.5u#);
230 penlabels(1,2,3,4,5,6,7,8,9,10); endchar;
231
232 cmchar "The letter Iota";
233 beginchar("I",max(6u#,4u#+cap_stem#),cap_height#,0);
234 italcorr cap_height#*slant-.25u#;
235 adjust_fit(cap_serif_fit#,cap_serif_fit#);
236 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
237 lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0;
238 filldraw stroke z1e--z2e; % stem
239 if serifs: dish_serif(1,2,a,1/3,1.05cap_jut,b,1/3,1.05cap_jut);  % upper serif
240  dish_serif(2,1,c,1/3,1.05cap_jut,d,1/3,1.05cap_jut);  fi % lower serif
241 math_fit(0,.5ic#); penlabels(1,2); endchar;
242
243 cmchar "The letter Kappa";
244 beginchar("K",13.5u#,cap_height#,0);
245 italcorr cap_height#*slant-.5u#;
246 adjust_fit(cap_serif_fit#,cap_serif_fit#);
247 numeric right_jut,stem[],alpha[];
248 if serifs: right_jut=.6cap_jut;
249 else: right_jut=.4tiny; fi
250 pickup tiny.nib; pos1(fudged.cap_stem,0); pos2(fudged.cap_stem,0);
251 lft x1l=lft x2l=hround max(2u,3u-.5fudged.cap_stem); top y1=h; bot y2=0;
252 filldraw stroke z1e--z2e; % stem
253 stem2=max(tiny.breadth,fudged.cap_stem-3stem_corr);
254 stem1=max(tiny.breadth,fudged.hair if hefty:-3stem_corr fi);
255 top y3=h; rt x3r=hround(r-letter_fit-u-right_jut);
256 bot y6=0; rt x6r=hround(r-letter_fit-.75u-right_jut);
257 x4=x1; y4=1/3h;
258 alpha1=diag_ratio(1,.5(stem1-tiny),y3-y4,x3r-x4);
259 penpos3(alpha1*(stem1-tiny),0); penpos4(whatever,-90);
260 alpha2=diag_ratio(1,.5(stem2-tiny),y1-y6,x6r-x1);
261 penpos6(alpha2*(stem2-tiny),0);
262 forsuffixes $=l,r: y3'$=h; y6'$=0; z4$=z3'$+whatever*(z3-z4);
263  z5$=z6'$+whatever*(z1-z6)=whatever[z3,z4]; endfor
264 z5=.5[z5l,z5r];
265 z3'r=z3r+penoffset z3-z4 of currentpen+whatever*(z3-z4);
266 % we have also |z3'l=z3l+penoffset z4-z3 of currentpen+whatever*(z3-z4)|;\]
267 z6'r=z6r+penoffset z1-z6 of currentpen+whatever*(z1-z6);
268 z6'l=z6l+penoffset z6-z1 of currentpen+whatever*(z1-z6);
269 fill z4r--diag_end(4r,3'r,1,.5,3'l,4l)--z4l--cycle;  % upper diagonal
270 fill z5l--diag_end(5l,6'l,.5,1,6'r,5r)--z5r--cycle;  % lower diagonal
271 if serifs: numeric inner_jut;
272  if rt x2r+cap_jut+.5u+1<=lft x6l-cap_jut: inner_jut=cap_jut;
273  else: rt x2r+cap_jut+.5u+1=lft x6l-inner_jut; fi
274  dish_serif(1,2,a,1/3,cap_jut,b,1/3,cap_jut); % upper stem serif
275  dish_serif(2,1,c,1/3,cap_jut,d,1/3,cap_jut);  % lower stem serif
276  dish_serif(3,4,e,2/3,1.2cap_jut,f,1/2,right_jut)(dark); % upper diagonal serif
277  dish_serif(6,5,g,1/2,inner_jut,h,1/3,right_jut)(dark);fi % lower diagonal serif
278 math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
279
280 cmchar "Uppercase Greek Lambda";
281 beginchar("L",12u#,cap_height#,0);
282 adjust_fit(cap_serif_fit#,cap_serif_fit#);
283 numeric left_stem,outer_jut,alpha;
284 left_stem=cap_hair if hefty: -3stem_corr fi;
285 outer_jut=.7cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.5u; y1=y4=0;
286 x2-x1=x4-x3; x3r=x2r+apex_corr; y2=y3=h+apex_o+apex_oo;
287 alpha=diag_ratio(2,left_stem,y2-y1,x4r-x1l-apex_corr);
288 penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
289 penpos3(alpha*cap_stem,0); penpos4(alpha*cap_stem,0);
290 z0=whatever[z1r,z2r]=whatever[z3l,z4l];
291 if y0<h-cap_notch_cut: y0:=h-cap_notch_cut;
292   fill z0+.5right{down}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
293     --diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
294     ...{up}z0+.5left--cycle; % left and right diagonals
295 else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
296     --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
297 if serifs: numeric inner_jut; pickup tiny.nib;
298  prime_points_inside(1,2); prime_points_inside(4,3);
299  if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
300  else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
301  dish_serif(1',2,a,1/2,outer_jut,b,.6,inner_jut)(dark);  % left serif
302  dish_serif(4',3,c,1/2,inner_jut,d,1/3,outer_jut); fi  % right serif
303 penlabels(0,1,2,3,4,5,6); endchar;
304
305 cmchar "The letter Mu";
306 beginchar("M",16u#+width_adj#,cap_height#,0);
307 italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
308 adjust_fit(cap_serif_fit#,cap_serif_fit#);
309 numeric stem[]; % thicknesses of the four strokes
310 stem1=hround(fudged.hair+stem_corr);
311 stem2=hround(fudged.cap_stem-4stem_corr);
312 stem3=hround(fudged.hair-stem_corr);
313 stem4=hround(fudged.cap_stem-3stem_corr);
314 if stem4<stem1: stem4:=stem1; fi
315 pickup tiny.nib; pos1(stem1,0); pos2(stem1,0);
316 pos3(stem4,0); pos4(stem4,0);
317 x1=x2; x3=x4; x1l=w-x3r; rt x3r=hround min(w-2u,w-3u+.5stem4);
318 top y1=top y3=h; bot y2=bot y4=0;
319 filldraw stroke z1e--z2e; % left stem
320 filldraw stroke z3e--z4e; % right stem
321 penpos5(stem2,0); penpos6(stem2,0); penpos7(stem3,0); penpos8(stem3,0);
322 x5l=x1; x6l=x7l; x8=lft x3l; x6-x5=x8-x7; y5=y8=h; y6=y7;
323 if hefty: y6=if monospace: vround 1/3h else: o fi;
324  numeric upper_notch,lower_notch;
325  upper_notch=h-cap_notch_cut; lower_notch=y6+cap_notch_cut;
326  x1'=rt x1r; z1'=whatever[z5l,z6l]; x3'=lft x3l; z3'=whatever[z7r,z8r];
327  z0=whatever[z5r,z6r]=whatever[z7l,z8l];
328  fill z5l..
329   if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
330   {z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
331   if y3'<upper_notch: ...{up}(x3'-1,upper_notch){right} fi
332   ..z8r--diag_out(8r,1,8l,7l){z7-z8}
333   if y0<=lower_notch: ..{z7-z8}z0{z5-z6}..
334   else: ...{down}(x0+.5,lower_notch)--(x0-.5,lower_notch){up}... fi
335   {z5-z6}diag_in(6r,5r,1,5l)--cycle;  % diagonals
336 else: y6=0; z0=whatever[z5r,z6r]=whatever[z7l,z8l];
337  fill z5l..{z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
338   ..z8r--diag_out(8r,1,8l,7l){z7-z8}..{z7-z8}z0{z5-z6}
339   ..{z5-z6}diag_in(6r,5r,1,5l)--cycle; fi  % diagonals
340 if serifs: serif(1,2,a,1/3,-cap_jut);  % upper left serif
341  dish_serif(2,1,b,1/2,cap_jut,c,1/2,cap_jut)(dark); % lower left serif
342  serif(3,4,d,1/3,cap_jut); %  upper right serif
343  dish_serif(4,3,e,1/3,cap_jut,f,1/3,cap_jut); fi  % lower right serif
344 math_fit(0,max(.5ic#-.5u#,0));
345 penlabels(0,1,1',2,3,3',4,5,6,7,8); endchar;
346
347 cmchar "The letter Nu";
348 beginchar("N",13u#+width_adj#,cap_height#,0);
349 italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
350 adjust_fit(cap_serif_fit#,cap_serif_fit#);
351 numeric thin_stem; thin_stem=hround(fudged.hair+stem_corr);
352 pickup tiny.nib; pos1(thin_stem,0); pos2(thin_stem,0);
353 pos3(thin_stem,0); pos4(thin_stem,0);
354 pickup tiny.nib; top y1=top y3=h; bot y2=bot y4=0;
355 x1=x2; x3=x4; x1l=w-x3r;
356 rt x3r=hround min(w-2u,w-3u+.5fudged.cap_stem);
357 filldraw stroke z1e--z2e; % left stem
358 filldraw stroke z3e--z4e; % right stem
359 if hefty: penpos5(fudged.cap_stem,0); penpos6(fudged.cap_stem,0);
360  x5l=x1; x6r=x4; y5=h; y6=0;
361  numeric upper_notch,lower_notch;
362  upper_notch=h-cap_notch_cut; lower_notch=cap_notch_cut;
363  x1'=rt x1r; z1'=whatever[z5l,z6l]; x4'=lft x4l; z4'=whatever[z5r,z6r];
364  fill z5l..
365   if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
366   {z6-z5}diag_in(5l,6l,1,6r)--z6r..
367   if y4'>lower_notch: {left}(x4'-1,lower_notch){up}... fi
368   {z5-z6}diag_in(6r,5r,1,5l)--cycle;  % diagonal
369 else: penpos5(whatever,0); penpos6(whatever,90);
370  z5l=z1l; z6l=z4l;
371  z7=z6l+(max(eps,cap_stem-3stem_corr-tiny),0) rotated (angle(z5l-z6l)-90);
372  z5r=z7+whatever*(z5l-z6l); z6r=z7+whatever*(z5l-z6l);
373  filldraw stroke z5e..z6e; fi  % diagonal
374 if serifs: if hefty: serif(1,2,a,1/3,-cap_jut); % upper left serif
375  else: serif(5,6,a,1/3,-cap_jut); fi  % upper left serif
376  dish_serif(2,1,b,1/2,cap_jut,c,1/2,cap_jut)(dark); % lower left serif
377  dish_serif(3,4,e,1/2,cap_jut,f,1/2,cap_jut)(dark); fi  % upper right serif
378 math_fit(0,max(.5ic#-.5u#,0)); penlabels(1,1',2,3,4,4',5,6,7); endchar;
379
380 cmchar "Uppercase Greek Xi";
381 beginchar("X",12u#,cap_height#,0);
382 italcorr cap_height#*slant-.35u#;
383 adjust_fit(0,0);
384 h:=vround(h-2stem_corr);
385 numeric shaved_stem; shaved_stem=hround .9[vair,.85cap_stem];
386 % Next line added by BHK 870902 --- see TUGboat 87#2 Errata & Changes supplement
387 if shaved_stem<crisp.breadth: shaved_stem:=crisp.breadth; fi
388 pickup crisp.nib; pos1(shaved_stem,90); pos2(hair,0);
389 top y1r=h; x1=.5w; rt x2r=hround(w-.85u); y2=good.y(y1l-4/9beak)-eps;
390 arm(1,2,a,.4beak_darkness,.3beak_jut);  % upper right arm and beak
391 pos3(hair,180); x3=w-x2; y3=y2;
392 arm(1,3,b,.4beak_darkness,-.3beak_jut);  % upper left arm and beak
393 pos4(shaved_stem,-90); pos5(hair,0);
394 bot y4r=0; x4=.5w; rt x5r=hround(w-.75u); y5=good.y(y4l+.5beak)+eps;
395 arm(4,5,c,.4beak_darkness,.3beak_jut);  % lower right arm and beak
396 pos6(hair,180); x6=w-x5; y6=y5;
397 arm(4,6,d,.4beak_darkness,-.3beak_jut);  % lower left arm and beak
398 pos7(shaved_stem,90); pos8(shaved_stem,90);
399 lft x7=w-rt x8=hround if serifs: 2.5 else: 2 fi\\ u;
400 top y7r=top y8r=vround(.52h+.5shaved_stem);
401 filldraw stroke z7e--z8e;  % middle bar
402 if serifs: numeric xjut;
403  if bot y2>top y7r+.75cap_jut: xjut=.5cap_jut;
404  else: bot y2=top y7r+1.5xjut; fi
405  pos11(hair,0); pos12(hair,0); y11=y12;
406  pos13(hair,0); pos14(hair,0); y13=y14;
407  lft x11l=lft x13l=w-rt x12r=w-rt x14r=hround 2.5u;
408  top y11-bot y13=shaved_stem+2xjut; .5[y11,y13]=y7;
409  filldraw stroke z11e--z13e; filldraw stroke z12e--z14e; fi  % middle serifs
410 math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,11,12,13,14); endchar;
411
412 cmchar "The letter Omicron";
413 beginchar("O",14u#-width_adj#,cap_height#,0);
414 italcorr .7cap_height#*slant-.5u#;
415 adjust_fit(0,0);
416 penpos1(vair',90); penpos3(vround(vair+1.5vair_corr),-90);
417 penpos2(cap_curve,180); penpos4(cap_curve,0);
418 if monospace: x2r=hround 1.5u;
419  interim superness:=sqrt superness;  % make |"O"|, not |"0"|
420 else: x2r=hround u; fi
421 x4r=w-x2r; x1=x3=.5w; y1r=h+o; y3r=-o;
422 y2=y4=.5h-vair_corr; y2l:=y4l:=.52h;
423 penstroke pulled_super_arc.e(1,2)(.5superpull)
424  & pulled_super_arc.e(2,3)(.5superpull)
425  & pulled_super_arc.e(3,4)(.5superpull)
426  & pulled_super_arc.e(4,1)(.5superpull) & cycle;  % bowl
427 math_fit(-.3cap_height#*slant-.5u#,ic#-.5u#); penlabels(1,2,3,4); endchar;
428
429 cmchar "Uppercase Greek Pi";
430 beginchar("P",13u#+width_adj#,cap_height#,0);
431 italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
432 adjust_fit(cap_serif_fit#,cap_serif_fit#); pickup tiny.nib;
433 h:=vround(h-stem_corr);
434 pos1(cap_stem,0); pos2(cap_stem,0); pos3(cap_stem,0); pos4(cap_stem,0);
435 lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); x3=x4=w-x1;
436 top y1=top y3=h; bot y2=bot y4=0;
437 filldraw stroke z1e--z2e; % left stem
438 filldraw stroke z3e--z4e; % right stem
439 penpos5(cap_bar,90); penpos6(cap_bar,90);
440 x5=x1; x6=x3; y5r=y6r=h;
441 fill stroke z5e--z6e;  % bar
442 if serifs: numeric inner_jut;
443  if rt x1r+cap_jut+.5u+1<=lft x3l-cap_jut: inner_jut=cap_jut;
444  else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
445  nodish_serif(1,2,a,1/3,cap_jut,b,1/3,eps);  % upper left serif
446  dish_serif(2,1,c,1/3,cap_jut,d,1/3,inner_jut); % lower left serif
447  nodish_serif(3,4,e,1/3,eps,f,1/3,cap_jut);  % upper right serif
448  dish_serif(4,3,g,1/3,inner_jut,h,1/3,cap_jut); fi  % lower right serif
449 math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
450
451 cmchar "The letter P (Rho)";
452 beginchar("R",12u#,cap_height#,0);
453 italcorr .75cap_height#*slant-.5u#;
454 adjust_fit(cap_serif_fit#,0);
455 pickup tiny.nib; penpos1(cap_stem'-tiny,0); penpos2(cap_stem-tiny,0);
456 pos0(cap_stem',0); pos0'(cap_stem,0);
457 lft x1l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
458 x1l=x2l=x0l=x0'l; y0=y0'=y7;
459 penpos3(cap_band,90); penpos4(cap_band,90);
460 penpos5(cap_curve if hefty:-3stem_corr fi,0);
461 penpos6(.5[vair,cap_band],-90); penpos7(.5[vair,cap_band],-90);
462 z3r=top z1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
463 x7=x2; y7l=vround .5h; x4=x6=.5w+.75u; x5r=hround(w-u);
464 x4l:=x6l:=x4-.25cap_curve;
465 filldraw stroke z1e--z0e--z0'e--z2e; % stem
466 fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e;  % lobe
467 if serifs: nodish_serif(1,0,a,1/3,cap_jut,b,1/3,.5cap_jut);  % upper serif
468  dish_serif(2,0',c,1/3,cap_jut,d,1/3,cap_jut); fi  % lower serif
469 math_fit(0,ic#-2.5u#); penlabels(0,1,2,3,4,5,6,7); endchar;
470
471 cmchar "Uppercase Greek Sigma";
472 beginchar("S",13u#,cap_height#,0);
473 italcorr cap_height#*slant-beak_jut#-.5u#;
474 adjust_fit(0,0);
475 numeric bot_arm_thickness;
476 bot_arm_thickness=Vround .25[slab,cap_vstem];
477 pickup tiny.nib; lft x1l=hround u; x1l=x2l=x4l;
478 top y1=h; bot y2=h-slab-eps; bot y4=0; x3l-x1l=4/11(w-2u); y3=.5h;
479 numeric alpha[]; alpha1=((x3l-x1l)++(y2-y3))/(y2-y3);
480 penpos1(alpha1*(cap_stem-tiny),0); penpos2(alpha1*(cap_stem-tiny),0);
481 penpos3(alpha1*(cap_stem-tiny),0);
482 alpha2=diag_ratio(1,cap_hair-tiny,y3-y4,x3r-x4l);
483 penpos4(alpha2*(cap_hair-tiny),0);
484 z0=whatever[z2l,z3l]=z4l+whatever*(z3r-z4r);
485 filldraw z1l--z2l--z0--z4l--z4r--z3r--z2r--z1r--cycle;  % diagonals
486 pickup crisp.nib; pos5(slab,90); pos6(hair,0);
487 top y5r=h; x5=x1; rt x6r=hround(w-u); y6=good.y(y5l-beak)-eps;
488 arm(5,6,a,beak_darkness,beak_jut);  % upper arm and beak
489 pos7(bot_arm_thickness,-90); pos8(hair,0);
490 bot y7r=0; z7l=whatever[z4,z3]; x7r:=x4; x8=x6; y8=good.y(y7l+beak)+eps;
491 arm(7,8,b,beak_darkness,beak_jut);  % lower arm and beak
492 math_fit(0,.5ic#); penlabels(0,1,2,3,4,5,6,7,8); endchar;
493
494 cmchar "The letter Tau";
495 beginchar("T",13u#-width_adj#,cap_height#,0);
496 italcorr cap_height#*slant-beak_jut#-.25u#;
497 adjust_fit(0,0);
498 h:=vround(h-2stem_corr);
499 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
500 lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0;
501 filldraw stroke z1e--z2e; % stem
502 pickup crisp.nib; pos3(slab,90); pos4(hair,0);
503 top y3r=h; x3=x1; rt x4r=hround(w-.65u); y4=good.y(y3l-beak)-eps;
504 arm(3,4,e,beak_darkness,.7beak_jut);  % right arm and beak
505 pos5(hair,180); x5=w-x4; y5=y4;
506 arm(3,5,f,beak_darkness,-.7beak_jut);  % left arm and beak
507 if serifs: dish_serif(2,1,c,1/3,1.414cap_jut,d,1/3,1.414cap_jut);  % lower serif
508  nodish_serif(1,2,a,1/3,.5cap_jut,b,1/3,.5cap_jut); fi  % upper bracketing
509 math_fit(-.75cap_height#*slant,ic#-2.5u#); penlabels(1,2,3,4,5,6); endchar;
510
511 cmchar "Uppercase Greek Upsilon";
512 beginchar("U",14u#,cap_height#,0);
513 italcorr .8cap_height#*slant-.5u#;
514 adjust_fit(0,0);
515 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
516 lft x1l=lft x2l=hround(.5w-.5cap_stem); y1=.5h; bot y2=0;
517 filldraw stroke z1e--z2e; % stem
518 penpos3(.6cap_stem,0); penpos4(.75cap_curve,90); penpos5(cap_hair,180);
519 z3l=lft z1l; x5r=hround u; y5=bot .8h; x4=.61803[x3l,x5l]; y4r=h+o;
520 penpos5'(cap_hair,180); x5'=x5; y5'=h;
521 fill z3r{up}...z4r{left}...{down}diag_end(5'r,5r,1,1,5l,5'l){up}
522  ...{right}z4l...{down}z3l--cycle;  % left arc
523 penpos6(.6cap_stem,0); penpos7(.75cap_curve,-90); penpos8(cap_hair,-180);
524 z6r=rt z1r; x8=w-x5; y8=y5; x7=w-x4; y7=y4;
525 penpos8'(cap_hair,-180); x8'=x8; y8'=h;
526 fill z6r{up}...z7r{right}...{down}diag_end(8'r,8r,1,1,8l,8'l){up}
527  ...{left}z7l...{down}z6l--cycle;  % right arc
528 if serifs: dish_serif(2,1,a,1/3,1.25cap_jut,b,1/3,1.25cap_jut); fi  % serif
529 math_fit(-.8cap_height#*slant-.5u#,ic#-2.5u#);
530 penlabels(1,2,3,4,5,6,7,8); endchar;
531
532 cmchar "Uppercase Greek Phi";
533 beginchar(oct"010",13u#,cap_height#,0);
534 italcorr .5cap_height#*slant-.5u#;
535 adjust_fit(0,0);
536 numeric shaved_stem,light_curve;
537 shaved_stem=cap_stem-hround 2stem_corr;
538 light_curve=cap_curve-hround stem_corr;
539 pickup tiny.nib; pos1(shaved_stem,0); pos2(shaved_stem,0);
540 lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0;
541 filldraw stroke z1e--z2e; % stem
542 penpos3(vair,90); penpos5(vair,-90);
543 penpos4(light_curve,180); penpos6(light_curve,0);
544 x4r=hround u; x6r=w-x4r; x3=x5=.5w;
545 y3r=vround(.85h if serifs:-slab fi); y4=y6=.5[y3,y5];
546 y5r=vround(.15h if serifs:+slab fi);
547 penstroke pulled_arc.e(3,4) & pulled_arc.e(4,5)
548  & pulled_arc.e(5,6) & pulled_arc.e(6,3) & cycle;  % bowl
549 if serifs: dish_serif(1,2,a,1/3,1.25cap_jut,b,1/3,1.25cap_jut);  % upper serif
550  dish_serif(2,1,c,1/3,1.25cap_jut,d,1/3,1.25cap_jut); fi  % lower serif
551 math_fit(-.5cap_height#*slant-.5u#,ic#); penlabels(1,2,3,4,5,6); endchar;
552
553 cmchar "The letter X (Chi)";
554 beginchar("H",13u#,cap_height#,0);
555 italcorr cap_height#*slant-.25u#;
556 adjust_fit(cap_serif_fit#,cap_serif_fit#);
557 numeric stem[],outer_jut,xjut,alpha[];
558 stem1=cap_stem-2stem_corr; stem2=min(cap_hair,stem1);
559 outer_jut=.75cap_jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi;
560 x1l=l+letter_fit+.5u+outer_jut; x2r=r-letter_fit-u-outer_jut-xjut;
561 x3l=l+letter_fit+.25u+outer_jut+xjut; x4r=r-letter_fit-.25u-outer_jut;
562 y1=y2=h; y3=y4=0;
563 alpha1=diag_ratio(1,stem1,h,x4r-x1l);
564 alpha2=diag_ratio(1,stem2,h,x2r-x3l);
565 penpos1(alpha1*stem1,0); penpos2(alpha2*stem2,0);
566 penpos3(alpha2*stem2,0); penpos4(alpha1*stem1,0);
567 if hefty: z0=whatever[z1,z4]=whatever[z2,z3];
568  x12=x34=x0; y13=y24=y0;
569  z12=whatever[z2l,z3l]; z13=whatever[z2l,z3l];
570  z24=whatever[z2r,z3r]; z34=whatever[z2r,z3r];
571  forsuffixes $=13,24,34: z$'=.1[z$,z0]; endfor
572  fill diag_end(12,1r,.5,1,1l,13')--z13'--diag_end(13',3l,1,.5,3r,34')--z34'
573   --diag_end(34',4l,.5,1,4r,24')--z24'
574   --diag_end(24',2r,1,.5,2l,12)--z12--cycle; % diagonals
575 else: fill diag_end(4r,1r,.5,1,1l,4l)
576   --diag_end(1l,4l,.5,1,4r,1r)--cycle; % left diagonal
577  fill diag_end(2l,3l,.5,1,3r,2r)
578   --diag_end(3r,2r,.5,1,2l,3l)--cycle; fi  % right diagonal
579 if serifs: numeric inner_jut[]; pickup tiny.nib;
580  prime_points_inside(1,4); prime_points_inside(2,3);
581  prime_points_inside(3,2); prime_points_inside(4,1);
582  if rt x1'r+cap_jut+.5u+1<=lft x2'l-cap_jut-xjut: inner_jut1=cap_jut;
583  else: rt x1'r+inner_jut1+.5u+1=lft x2'l-inner_jut1-xjut; fi
584  if rt x3'r+cap_jut+.5u+1<=lft x4'l-cap_jut-xjut: inner_jut2=cap_jut;
585  else: rt x3'r+inner_jut2+.5u+1=lft x4'l-inner_jut2-xjut; fi
586  dish_serif(1',4,a,1/3,outer_jut,b,2/3,inner_jut1);  % upper left serif
587  dish_serif(4',1,c,2/3,inner_jut2,d,1/3,outer_jut);  % lower right serif
588  dish_serif(2',3,e,2/3,inner_jut1+xjut,
589   f,1/2,outer_jut+xjut)(dark);  % upper right serif
590  dish_serif(3',2,g,1/2,outer_jut+xjut,
591   h,2/3,inner_jut2+xjut)(dark); fi  % lower left serif
592 math_fit(0,.5ic#); penlabels(0,1,2,3,4,12,13,24,34); endchar;
593
594 cmchar "Uppercase Greek Psi";
595 beginchar(oct"011",14u#,cap_height#,0);
596 italcorr .8cap_height#*slant-.5u#;
597 adjust_fit(0,0);
598 numeric shaved_stem;
599 shaved_stem=cap_stem-hround 2stem_corr;
600 pickup tiny.nib; pos1(shaved_stem,0); pos2(shaved_stem,0);
601 lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0;
602 filldraw stroke z1e--z2e; % stem
603 pos3(shaved_stem,-180); pos4(shaved_stem,-180);
604 pos5(vair,-90); x5=x1; bot y5r=vround(.15h if serifs:+slab fi);
605 pos6(shaved_stem,0); pos7(shaved_stem,0);
606 lft x3r=hround u; x7=w-x3; lft x4r=hround(3u-.5shaved_stem); x6=w-x4;
607 pos3'(vair,90); pos7'(vair,90); z3'r=z3r; z7'r=z7r;
608 y3=y7; y4=y6=.6h; y3=good.y(y3+.84h if serifs:-slab fi-y3');
609 interim superness:=more_super;
610 filldraw z3'l{right}...z4r{down} & super_arc.r(4,5)
611  & super_arc.r(5,6) & z6r{up}...z7'l{right}
612  --z7r---z7l...z6l{down} & super_arc.l(6,5)
613  & super_arc.l(5,4) & z4l{up}...z3l---z3r--cycle;  % stroke
614 if serifs: dish_serif(1,2,a,1/3,1.25cap_jut,b,1/3,1.25cap_jut);  % upper serif
615  dish_serif(2,1,c,1/3,1.25cap_jut,d,1/3,1.25cap_jut); fi  % lower serif
616 math_fit(-.8cap_height#*slant-.5u#,.4cap_height#*slant-1.25u#);
617 penlabels(1,2,3,4,5,6,7); endchar;
618
619 cmchar "Uppercase Greek Omega";
620 beginchar("W",13u#,cap_height#,0);
621 italcorr .75cap_height#*slant-.5u#;
622 adjust_fit(0,0);
623 pickup tiny.nib; pos1(vair,90); pos2(cap_curve,180);
624 pos3(vair,180); pos4(cap_curve,0); pos5(vair,0);
625 x1=.5w; top y1r=h+o; lft x2r=hround u; y2=y4=2/3h; x4=w-x2;
626 rt x3l=hround(1/3(w+.5u)+.5hair); bot y3=bot y5=0; x5=w-x3;
627 filldraw stroke z3e{up}...{up}z2e
628  & pulled_super_arc.e(2,1)(.5superpull)
629  & pulled_super_arc.e(1,4)(.5superpull)
630  & z4e{down}...{down}z5e;  % bowl
631 numeric arm_thickness; path p; p=z3{up}...{up}z2;
632 arm_thickness=Vround(if hefty:slab+2stem_corr else:.75[slab,cap_vstem] fi);
633 pickup crisp.nib; pos6(arm_thickness,-90); pos7(fudged.hair,-180);
634 bot y6r=0; x6=x3; lft x7r=hround .8u; y7=good.y(y6l+.5beak)+eps;
635 (x,y)=p intersectionpoint((0,y6l)--(w,y6l)); x6l:=x;
636 arm(6,7,a,.5beak_darkness,-1.2beak_jut);  % left arm and beak
637 pos8(arm_thickness,-90); pos9(fudged.hair,0);
638 y8=y6; y9=y7; x8+x6=x9+x7=w; x8l:=w-x6l;
639 arm(8,9,b,.5beak_darkness,1.2beak_jut);  % right arm and beak
640 math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9); endchar;
641
642 % Greek lower-case --- the majority of these programs take from greekl
643
644 % Revised BHK 880923 to occupy only 9u of the 11u width: original at end
645 cmchar "Lowercase Greek alpha";
646 beginchar("a",11u#,x_height#,0);
647 italcorr max(1/3x_height#*slant+.5hair#-.5u#,x_height#*slant-.5u#);
648 adjust_fit(0,0); pickup fine.nib;
649 pos0(hair,0); pos1(vair,-90); pos2(curve,-180); pos3(vair,-270);
650 z4=(w-3.9u,9/16h); z5=(w-3.4u,.5[vair,y4]);
651 numeric theta; theta=angle(z4-z5)-90;
652 pos4(stem,theta); pos5(stem,theta);
653 pos6(vair,90); pos7(hair,180);
654 rt x0r=hround(w-2u); x1=x3=.5w-u; lft x2r=hround(1.5u-.5curve);
655 x6=w-2u; x7+.5hair=hround(w-u+.5hair-epsilon);
656 top y0=vround .8[bar_height,h]; bot y1r=bot y6l=-oo;
657 y2=.5[y1,y3]; top y3r=h+oo; y7=1/4bar_height;
658 filldraw stroke z0e{down}...pulled_arc.e(1,2) & pulled_arc.e(2,3)
659  ...z4e---z5e...z6e{right}...{up}z7e; % diagonal, bowl, and hook
660 math_fit(-.3x_height#*slant+.5curve#-u#,1/3x_height#*slant+.5hair#+.5u#);
661 penlabels(0,1,2,3,4,5,6,7); endchar;
662
663 cmchar "Lowercase Greek beta";
664 beginchar("b",9.5u#,asc_height#,desc_depth#);
665 italcorr .5[x_height#,asc_height#]*slant-u#;
666 adjust_fit(0,0); pickup fine.nib;
667 pos0(hair,180); pos1(hair,180); pos2(vair,90);
668 pos3(stem,0); pos4(vair,-90); pos5(hair,-180);
669 pos6(vair,-270); pos7(curve,-360); pos8(vair,-450); pos9(hair,-540);
670 x0=x1=x9; lft x0l=hround(1.5u-.5hair); x2=x4=x6=x8=.5w+.25u;
671 rt x3r=hround(w-1.5u); rt x7r=hround(w-1.5u+.5curve); rt x5l=hround(x4-u);
672 bot y0=-d; y1=top y6r=x_height; top y2r=h+oo; y3=.5[y2,y4];
673 y5=.5[y4,y6]; top y6r-bot y4r=vstem+eps; bot y8=-oo; y7=y9=.5[y6,y8];
674 if y6l<y4l: y6l:=y4l:=y5; fi
675 filldraw stroke z0e---z1e...pulled_arc.e(2,3)
676  & pulled_arc.e(3,4)...{up}z5e;  % stem and upper bowl
677 filldraw stroke z5e{up}...pulled_arc.e(6,7)
678  & pulled_arc.e(7,8)...{up}z9e;  % lower bowl
679 math_fit(desc_depth#*slant+.5hair#-u#,.7x_height#*slant+.5curve#-1.5u#);
680 penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
681
682 cmchar "Lowercase Greek gamma";
683 beginchar("g",10u#,x_height#,desc_depth#);
684 italcorr x_height#*slant-.5u#;
685 adjust_fit(0,0); pickup fine.nib;
686 pos1(hair,180); pos2(vstem+dw,90);
687 pos4(hair,0); pos5(vair,-90); pos6(hair,-180); pos7(hair,-180);
688 bot y1=.5772156649h; top y2r=h+oo; y4=y6=-.5d;
689 bot y5r=-d-o; top y7=h;
690 lft x1r=hround(.5u-.5hair); x2=3u; rt x4r=hround(w-2u); x5=.5[x4,x6];
691 rt x4r-lft x6r=hround 1/3[hair,stem]+eps; rt x7l=hround(w-u);
692 if x4l<x6l: x4l:=x6l:=x5; fi
693 pos3(hair,angle(z4-z2)+90); x3=superness[x2,x4]; y3=superness[y4,y2];
694 filldraw stroke z1e{up}...z2e{right}...z3e{z4-z2}
695  ...z4e{down}...{left}z5e; % arc
696 filldraw stroke z5e{left}...z6e{up}..{2(x7-x6),y7-y6}z7e;  % stem
697 math_fit(-.5772156649x_height#*slant,ic#-u#);
698 penlabels(1,2,3,4,5,6,7); endchar;
699
700 cmchar "Lowercase Greek delta";
701 beginchar("d",8u#,asc_height#,0);
702 italcorr .9asc_height#*slant+.5hair#-1.5u#;
703 adjust_fit(0,0); pickup fine.nib;
704 pos1(hair,-180); pos2(vair,-90);
705 numeric theta; theta=angle(18u,-h);
706 pos3(stem,theta+90); pos4(stem,theta+90); pos5(1/4[hair,stem],20);
707 pos6(vair,-90); pos7(curve,-180); pos8(vair,-270);
708 rt x1l=hround(w-2u+.5hair); x2=.5w; x3r=3u; rt x5r=hround(w-u);
709 x4=x6=x8=.5w+.5u; lft x7r=hround(1.5u-.5curve);
710 top y2l=h+oo; y1=min(.9h,y2r-eps); top y8r=x_height+oo; y4=y8;
711 z4-z3=whatever*(18u,-h); y5=y7=.5[y6,y8]; bot y6=-oo;
712 filldraw stroke z1e{x2-x1,3(y2-y1)}...z2e{left}...z3e---z4e
713  ....z5e{down}...pulled_arc.e(6,7) & pulled_arc.e(7,8);  % hook and bowl
714 math_fit(-.3x_height#*slant+.5curve#-u#,.7x_height#*slant-.5u#);
715 penlabels(1,2,3,4,5,6,7,8); endchar;
716
717 cmchar "Lowercase Greek epsilon";       % Variant preferred to this
718 beginchar(oct"017",8u#,x_height#,0);
719 italcorr x_height#*slant+.5hair#-2u#;
720 adjust_fit(0,0); pickup fine.nib;
721 pos0(bar,90); pos1(bar,90); pos2(curve,180);
722 pos3(vair,270); pos4(hair,300); pos6(bar,90); pos7(bar,90);
723 x1=.5w+.5u; x0=x1+u; lft x2r=hround(1.5u-.5curve); x3=.5[x0,x1];
724 x4r=good.x(w-u); x5=w+.5u; x6=x0; z7=z2l;
725 top y0r=top y1r=h; y2=y5=y6=bar_height; bot y3r=-oo;
726 path p; p=z3r{right}...{up}z5;
727 numeric t; t=ypart(((x4r,y3r)--(x4r,y5))intersectiontimes p);
728 y4r=ypart point t of p;
729 filldraw circ_stroke z0e..pulled_arc.e(1,2) & pulled_arc.e(2,3)
730  ...z4e{direction t of p};  % arc
731 filldraw circ_stroke z6e--z7e;  % bar
732 math_fit(-.3x_height#*slant+.5curve#-u#,ic#);
733 penlabels(0,1,2,3,4,5,6,7); endchar;
734
735 cmchar "Lowercase Greek zeta";
736 beginchar("z",9u#,asc_height#,desc_depth#);
737 italcorr .75[x_height#,asc_height#]*slant-1.5u#;
738 adjust_fit(0,0); pickup fine.nib;
739 pos0(hair,-360); pos1(vair,-270); pos2(hair,-180); pos3(vair,-90);
740 numeric theta; theta=90-angle(25u,x_height); slope:=-x_height/25u;
741 pos6(stem,theta); pos7(vair,-90); pos8(vair,-135);
742 lft x0l=hround 3.5u; x1=x3=.5[x0,x2]; rt x2l=hround max(rt x0r,w-2u)+eps;
743 top y0=h; top y3l=bot y1l+vstem+eps=vround(y0-.25(h-x_height)); y2=.5[y1,y3];
744 if y1r>y3r: y1r:=y3r:=y2; fi
745 lft x4l=hround u; x4r-x4l=(hround .6[vair,stem])-fine;
746 x6+.5u=x7=w-2u; x8=.5w+.75u;
747 y6=-.1d; y8=-3/4d-oo; bot y7r=-d-oo;
748 ellipse_set(3l,4l,5l,6l); ellipse_set(3r,4r,5r,6r);
749 y4l:=.9[y6,y4l]; y4=y4r:=.9[y6,y4r];
750 filldraw circ_stroke z0e{down}...z1e{right}...{up}z2e;  % opening hook
751 filldraw circ_stroke z8e{x7-x8,2(y7-y8)}...z7e{right}
752  ...z6e---z5e....{up}z4e
753  ..tension 1 and atleast1.5..{right}z3e...{down}z2e;  % main stroke
754 math_fit(-.2asc_height#*slant-.5u#,0);
755 penlabels(0,1,2,3,4,5,6,7,8); endchar;
756
757 cmchar "Lowercase Greek eta";
758 beginchar("y",9u#,x_height#,desc_depth#);
759 italcorr .8x_height#*slant+.5stem#-u#;
760 adjust_fit(0,0); pickup fine.nib;
761 x0=0; x1=x2; pos2(stem,0); lft x2l=hround(2.5u-.5stem); y2-.5stem=-oo;
762 hook_in(0,a,1);  % opening hook
763 filldraw circ_stroke z2e--z1e;  % left stem
764 x4+.5stem=hround(w-1.5u+.5stem); ital_arch(2,3,4);  % arch
765 pos5(stem,0); x5=x4; y5-.5stem=-d-o;
766 filldraw circ_stroke z5e--z4e;  % right stem
767 math_fit(-2/3x_height#*slant+.5hair#+.5u#,ic#-1/3x_height#*slant);
768 penlabels(0,a,1,2,3,4,5); endchar;
769
770 cmchar "Lowercase Greek theta";            % The variant is preferred
771 beginchar(oct"003",8.25u#,asc_height#,0);
772 italcorr .7asc_height#*slant+.5curve#-u#;
773 adjust_fit(0,0); pickup fine.nib;
774 pos1(vair,90); pos2(curve,180); pos3(vair,270); pos4(curve,360);
775 x1=x3=.5w; lft x2r=hround(1.5u-.5curve); x4=w-x2;
776 top y1r=h+oo; y2=y4=.5[y1,y3]; bot y3r=-oo;
777 filldraw stroke pulled_arc.e(1,2) & pulled_arc.e(2,3)
778  & pulled_arc.e(3,4) & pulled_arc.e(4,1);  % bowl
779 pos2'(bar,90); pos4'(bar,90); z2'=z2l; z4'=z4l;
780 filldraw stroke z2'e--z4'e;  % bar
781 math_fit(-.3asc_height#*slant-u#+.5curve#,ic#-.5u#);
782 penlabels(1,2,3,4); endchar;
783
784 % Modified BHK 880926 to make enclosing box one u wider
785 cmchar "Lowercase Greek iota";
786 beginchar("i",6u#,x_height#,0);
787 italcorr 1/3x_height#*slant+.5hair#-.5u#;
788 adjust_fit(if monospace: u#,u# else: 0,0 fi); pickup fine.nib;
789 pos1(stem,0); lft x1l=hround(1.5u-.5stem); y1+.5stem=h+oo;
790 x2=x1-.25u; x4=w-u; hook_out(2,3,4)(skewed);  % closing hook
791 filldraw circ_stroke z1e{down}...{-u,-x_height}z2e;  % stem
792 math_fit(0,ic#); penlabels(1,2,3,4); endchar;
793
794 % Designed BHK 880926 (based on \varkappa from msym10 [MF in SAIL])
795 cmchar "Lowercase Greek kappa (variant)";
796 beginchar("k",10u#,x_height#,0);
797 adjust_fit(0,0); pickup fine.nib;
798 italcorr 1/3x_height#*slant+.5hair#-.5u#;
799 % Following definitions made character too heavy compared with rest
800 %pos1(hair,-45); pos2(curve,-90); pos3(vair,180); pos4(stem,135);
801 %pos14(stem,135); pos13(vair,180); pos12(curve,-90); pos11(hair,45);
802 pos1(hair,-45); pos2(stem,-90); pos3(vair,180); pos4(stem,90);
803 pos14(stem,90); pos13(vair,180); pos12(stem,-90); pos11(hair,45);
804 x1l=u; x11=w-x1; y1=good.y(.4[bar_height,h]); y11=h-y1;
805 x2=.25[x1,w/2]=w-x12; y2l=h+oo; y12r=0;
806 x3-x2=x2-x1; x13=w-x3; y3=y13=h/2;
807 x4r=x1l; y4l=0; x14=w-x4; y14r=h+oo;
808 filldraw circ_stroke z1e{up}..z2e{right}..z3e{-.2,-1}..z4e{-1,-1}; % left
809 filldraw circ_stroke z11e{down}..z12e{left}..z13e{.2,1}..z14e{1,1}; % right
810 filldraw z4l--z14l--z14r--z4r--cycle; % diagonal
811 penlabels(1,2,3,4,11,12,13,14);
812 endchar;
813
814 cmchar "Lowercase Greek kappa (math type)";
815 beginchar(oct"004",9u#,x_height#,0);
816 italcorr 1/3x_height#*slant+.5hair#+.5u#;
817 adjust_fit(0,0); pickup fine.nib;
818 pos1(stem,0); pos2(stem,0); pos3(vair,90); pos4(vair,90); pos5(flare,90);
819 x1=x2=x3; lft x1l=hround(1.5u-.5stem); y1+.5stem=h+oo; y2-.5stem=-oo;
820 filldraw z1l---z2l..z2r---z1r..cycle;  % stem
821 y3=bar_height; top y4r=h; x4+.5flare=hround(w-1.5u); z5r=z4r;
822 path p,q; p=z3l{right}..{right}z4l; q=z5r{right}..z5l{left}...cycle;
823 numeric t; t=ypart(p intersectiontimes q);
824 filldraw stroke z3e{right}..{right}z4e;  % upper diagonal
825 filldraw subpath(0,t) of q--cycle;  % bulb
826 pos7(stem,0); pos8(vair,90); pos9(hair,180);
827 x9+.5hair=hround(w+.5hair-epsilon); y9=1/3x_height;
828 lft x7l=hround(w-2.75u-.5stem); y7=1/2y3; x8=w-1.2u; bot y8l=-oo;
829 filldraw stroke z3e{right}...z7e{down}
830  ...z8e{right}...{up}z9e;  % lower diagonal
831 math_fit(0,ic#); penlabels(1,2,3,4,5,7,8,9); endchar;
832
833 % Revised BHK 880923 to make narrower
834 cmchar "Lowercase Greek lambda";
835 beginchar("l",9.5u#,asc_height#,0);
836 adjust_fit(0,0); pickup fine.nib;
837 pos1(vair,90); lft x1=hround .1u; top y1r=h;
838 x2=x1+2u; y2=.7[x_height,h]; x3=w-2u; bot y4=-oo; y3=max(.07h,y4+eps);
839 z4-(.25u,0)=whatever[z2,z3]; numeric theta; theta=angle(z2-z3)-90;
840 pos2(stem,theta); pos3(stem,theta); pos4(stem,0);
841 filldraw circ_stroke z1e{right}...z2e---z3e
842  ...{2(x4e-x3e),y4e-y3e}z4e;  % long diagonal
843 y5=.5[bar_height,x_height]; z5=whatever[z2,z3];
844 x6=1.5u; y6-.5stem=-oo; pos5(hair,theta-90); pos6(stem,angle(z5-z6)-90);
845 filldraw circ_stroke z6e--z5e; % short diagonal
846 penlabels(1,2,3,4,5,6); endchar;
847
848 % Revised BHK 880923 to make one unit wider (avoiding running into next char)
849 cmchar "Lowercase Greek mu";
850 beginchar("m",10u#,x_height#,desc_depth#);
851 italcorr 1/3x_height#*slant+.5hair#-.5u#;
852 adjust_fit(0,0); pickup fine.nib; interim superness:=more_super;
853 pos1(stem,-180); pos2(stem,-180); x1=x2=x3; lft x1r=hround(1.5u-.5stem);
854 y1+.5stem=h+oo; y2-.5stem=-d-o;
855 filldraw z1r---z2r..z2l---z1l..cycle;  % left stem
856 pos3(stem,-180); pos4(vair,-90); pos5(hair,0); x4=.5[x3,x5];
857 pos6(stem,0); rt x6r=hround(w-3.5u+.5stem);
858 x5=x6=x7; x9=w-u; hook_out(7,8,9);  % closing hook
859 y3=.7[y4,y5]; bot y4r=-oo; y5=.57h; y6+.5stem=h;
860 filldraw stroke super_arc.e(3,4)...{up}z5e; % left stem and arc
861 filldraw circ_stroke z6e--z7e;  % right stem
862 math_fit(desc_depth#*slant+.5stem#-u#,ic#);
863 penlabels(1,2,3,4,5,6,7,8,9); endchar;
864
865 % Changed BHK 880923 to make left stem curved and reduce overhang on left
866 cmchar "Lowercase Greek nu";
867 beginchar("n",8.5u#,x_height#,0);
868 italcorr x_height#*slant+.5stem#-u#;
869 adjust_fit(0,0); pickup fine.nib;
870 pos3(vair,-90); pos4(stem,0); bot y3r=0; y4+.5stem=h+oo;
871 x3-.5stem=hround(1.5u-.5stem); x4+.5stem=hround(w-1.5u+.5stem);
872 filldraw circ_stroke z4e{down}...{-36u,-h}z3e;  % diagonal
873 pickup tiny.nib; 
874 pos1(stem,10); pos2(stem,10);
875 top y1=h+min(oo,serif_drop); bot y2=0; x2=x3;
876 z=((z4{down}...{-36u,-h}z3)intersectionpoint((x2r,0)--(x2r,h)));
877 x1-.5stem=hround(2.5u-.5stem);
878 x5-x1=.6u; y5=.5[y1,y2]; pos5(stem,0);
879 z1'=.2[z1,z5];
880 filldraw stroke z1e...z5e...z2e;
881 %filldraw z1l--z2l--z--z1r--cycle;  % stem
882 if serifs: sloped_serif.l(1,1',a,1/3,jut,serif_drop); fi % upper left serif
883 math_fit(0,ic#-1/3x_height#*slant-.5u#); penlabels(1,2,3,4); endchar;
884
885 cmchar "Lowercase Greek xi";
886 beginchar("x",9u#,asc_height#,desc_depth#);
887 italcorr .75[x_height#,asc_height#]*slant-2u#;
888 adjust_fit(0,0); pickup fine.nib;
889 pos10(hair,-720); pos11(vair,-630); pos12(hair,-540); pos13(vair,-450);
890 lft x10l=hround 1/3w; x11=x13=.5[x10,x12]; rt x12l=hround(w-2.5u);
891 top y10=h; top y13l=bot y11l+vstem+eps=vround(y10-.25(h-x_height));
892 y12=.5[y11,y13]; if y11r>y13r: y11r:=y13r:=y12; fi
893 pos0(curve,-360); pos1(vair,-270); pos2(hair,-180); pos3(vair,-90);
894 numeric theta; theta=90-angle(22u,x_height); slope:=-x_height/22u;
895 pos6(stem,theta); pos7(vair,-90); pos8(vair,-135);
896 lft x0l=hround u; x1=x3=x11; x2=x12;
897 y0=.5[y13,y1]; top y3l=vround .5h=bot y1l+vstem+eps; y2=.5[y1,y3];
898 if y1r>y3r: y1r:=y3r:=y2; fi
899 lft x4l=hround u; x4r-x4l=hround .5[vair,stem]-fine;
900 x6=x7=w-2u; x8=.5w+.5u; y6=-.3d; bot y7r=-d-oo; y8=max(-3/4d-oo,y7l);
901 ellipse_set(3l,4l,5l,6l); ellipse_set(3r,4r,5r,6r);
902 y4l:=.9[y6,y4l]; y4=y4r:=.9[y6,y4r];
903 filldraw circ_stroke z10e{down}...z11e{right}...{up}z12e;  % opening hook
904 filldraw stroke z12e{up}...z13e{left}...z0e{down}
905  ...z1e{right}...{up}z2e;  % upper arc
906 filldraw circ_stroke z8e{x7-x8,2(y7-y8)}...z7e{right}...z6e
907  ---z5e...{up}z4e...{right}z3e...{down}z2e;  % main stroke
908 math_fit(-.2asc_height#*slant-.5u#,0);
909 penlabels(0,1,2,3,4,5,6,7,8,10,11,12,13); endchar;
910
911 cmchar "The letter omicron";         % Taken from "o" in romanl
912 beginchar("o",9u#,x_height#,0);
913 italcorr .7x_height#*slant;
914 adjust_fit(if monospace: .5u#,.5u# else: 0,0 fi);
915 penpos1(vair,90); penpos3(vair',-90);
916 penpos2(curve,180); penpos4(curve,0);
917 x2r=hround max(.5u,1.25u-.5curve);
918 x4r=w-x2r; x1=x3=.5w; y1r=h+vround 1.5oo; y3r=-oo;
919 y2=y4=.5h-vair_corr; y2l:=y4l:=.52h;
920 penstroke pulled_arc.e(1,2) & pulled_arc.e(2,3)
921  & pulled_arc.e(3,4) & pulled_arc.e(4,1) & cycle;  % bowl
922 penlabels(1,2,3,4); endchar;
923
924 cmchar "Lowercase Greek pi";
925 beginchar("p",10u#,x_height#,0);
926 italcorr x_height#*slant+.5stem#-u#;
927 adjust_fit(0,0); pi_stroke; % hook and bar
928 pos4(hair,0); pos6(hair,0); x4=3.5u; x6=w-4u; y4=y6=y2;
929 x5=3u; x7=w-2.5u; y5=y7=.5stem-oo;
930 pair v[]; v1=(z4-z5) xscaled 3.14159; v2=(z6-z7) xscaled 3.14159;
931 pos5(stem,angle v1-90); pos7(stem,angle v2-90);
932 filldraw circ_stroke z5e{v1}...{up}z4e;  % left stem
933 filldraw circ_stroke z7e{v2}...{up}z6e;  % right stem
934 math_fit(-.7x_height#*slant+.5hair#+.5u#,ic#-1/3x_height#*slant);
935 penlabels(1,2,3,4,5,6,7); endchar;
936
937 cmchar "Variant lowercase Greek rho";         % We prefer this one
938 beginchar("r",8.25u#,x_height#,desc_depth#);
939 italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi;
940 adjust_fit(0,0); pickup fine.nib;
941 pos2(stem,180); pos3(vair,90); pos4(curve,0); pos5(vair,-90); pos6(stem,-180);
942 lft x2r=hround(1.5u-.5stem); x2=x6; x3=x5=.5[x2,x4];
943 rt x4r=hround(w-1.5u+.5curve);
944 y2=y4=y6=.5[y3,y5]; top y3r=h+oo; bot y5r=-oo;
945 filldraw circ_stroke pulled_arc.e(2,3) & pulled_arc.e(3,4)
946  & pulled_arc.e(4,5) & pulled_arc.e(5,6);  % bowl
947 pos2'(hair,-180); z2'r=z2r; pos1(vstem,-90); pos1'(vstem,90); z1'=z1;
948 pos0(hair,0); rt x0r=hround(w-u); bot y0=-d; bot y1r=vround-.9d; x1=x5;
949 interim superness:=sqrt superness;
950 filldraw stroke pulled_arc.e(0,1'); filldraw stroke pulled_arc.e(1,2'); % tail
951 math_fit(desc_depth#*slant+.5stem#-u#,ic#);
952 penlabels(0,1,2,3,4,5,6); endchar;
953
954 cmchar "Lowercase Greek sigma";
955 beginchar("s",10.25u#,x_height#,0);
956 italcorr x_height#*slant+.5stem#-u#;
957 adjust_fit(0,0); pickup fine.nib;
958 pos1(vstem,90); pos2(stem,0); pos3(vair,-90);
959 pos4(stem,-180); pos5(vstem,-270); pos6(vstem,-270);
960 x1=x3=x5=.5[x2,x4]; rt x2r=hround(w-2.5u);
961 lft x4r=hround(1.5u-.5curve);x6=w-1.5u;
962 top y1r=h; y2=y4=.5[y1,y3]; bot y3r=-oo; y5=y6=y1;
963 filldraw circ_stroke z6e..pulled_arc.e(5,4) & pulled_arc.e(4,3)
964  & pulled_arc.e(3,2) & pulled_arc.e(2,1);  % ear and bowl
965 math_fit(-.3x_height#*slant+.5curve#-u#,ic#-1/3x_height#*slant);
966 penlabels(1,2,3,4,5,6); endchar;
967
968 cmchar "Lowercase Greek tau";
969 beginchar("t",9u#,x_height#,0);
970 italcorr x_height#*slant+.5stem#-u#;
971 adjust_fit(0,0); pi_stroke; % hook and bar
972 pos4(hair,0); pos5(stem,0);
973 x4=x5; x5-.5stem=hround(.5w-.5u-.5stem); y4=y2; y5-.5stem=-oo;
974 filldraw circ_stroke z5e--z4e;  % stem
975 math_fit(-.7x_height#*slant+.5hair#+.5u#,-.5u#);
976 penlabels(1,2,3,4,5); endchar;
977
978 cmchar "Lowercase Greek upsilon";
979 beginchar("u",9u#,x_height#,0);
980 italcorr x_height#*slant;
981 adjust_fit(0,0); pickup fine.nib; interim superness:=more_super;
982 x0=0; x2=x3+.25u; pos3(stem,-180); lft x3r=hround(2.5u-.5stem);
983 hook_in(0,1,2)(skewed);  % opening hook
984 pos2'(stem,-180); z2'=z2; pos4(vair,-90); pos5(hair,0);
985 x4=.5w+u; rt x5r=hround(w-.5u); y3=.7[y4,y5]; bot y4r=-oo; y5=.57h;
986 filldraw stroke z2'e{-u,-x_height}...super_arc.e(3,4)
987  ..tension atleast 1.05..{up}z5e; % left stem and arc
988 v_bulb(5,6);  % closing bulb
989 math_fit(-2/3x_height#*slant+.5hair#+.5u#,2/3ic#);
990 penlabels(0,1,2,3,4,5,6); endchar;
991
992 cmchar "Lowercase Greek phi";          % The variant is preferred
993 beginchar(oct"016",11u#,asc_height#,desc_depth#);
994 italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi;
995 adjust_fit(0,0); pickup fine.nib;
996 numeric light_curve; light_curve=hround(.5[stem,curve]-2stem_corr);
997 pos1(vair,90); pos2(light_curve,180); pos3(vair,270); pos4(light_curve,360);
998 x1=x3=.5w; lft x2r=hround(1.5u-.5light_curve); x4=w-x2;
999 top y1=x_height+oo; y2=y4=.5[y1,y3]; bot y3=-oo;
1000 filldraw stroke pulled_arc.e(1,2) & pulled_arc.e(2,3)
1001  & pulled_arc.e(3,4) & pulled_arc.e(4,1); % bowl
1002 pos5(hair,0); pos6(hair,0); x5=x6=.5w; top y5=h; bot y6=-d-oo;
1003 filldraw stroke z5e--z6e;  % stem
1004 math_fit(-.3x_height#*slant+.5curve#-u#,ic#);
1005 penlabels(1,2,3,4,5,6); endchar;
1006
1007 cmchar "Lowercase Greek chi";
1008 beginchar("h",11u#,x_height#,desc_depth#);
1009 italcorr x_height#*slant+.5hair#-1.5u#;
1010 adjust_fit(0,0); pickup fine.nib;
1011 pos1(hair,180); pos2(vair,80); pos5(vair,80); pos6(hair,180);
1012 x1-.5hair=hround-.5hair; x6=w-x1; x2=w-x5=u;
1013 y1=y2l-h/8; top y2r=h+oo; bot y5l=-d-oo; y6=y5r+h/8;
1014 z0=.5[z2,z5]; z2'=z2l+(.5u,0); z5'=z5r-(.5u,0);
1015 numeric theta; theta=angle(z5'-z2')+90;
1016 pos3(stem,theta); pos4(stem,theta);
1017 y3r=y2r-h/8; y4l=y5l+h/8; z3l=whatever[z2',z0]; z4r=whatever[z0,z5'];
1018 filldraw stroke z1e{up}...z2e{right}...z3e{z4r-z3l}
1019  ..z4e{z4r-z3l}...{right}z5e...{up}z6e;  % major diagonal and hooks
1020 x8=w-x7=2u; y7+.5hair=h; y8-.5hair=-d;
1021 numeric theta; theta=angle(z7-z8)-90;
1022 pos7(hair,theta); pos8(hair,theta);
1023 filldraw z7l---z8l..z8r---z7r..cycle;  % minor diagonal
1024 math_fit((desc_depth#-x_height#)*slant+ic#,ic#);
1025 penlabels(0,1,2,2',3,4,5',5,6,7,8); endchar;
1026
1027 cmchar "Lowercase Greek psi";
1028 beginchar(oct"001",11u#,asc_height#,desc_depth#);
1029 italcorr x_height#*slant;
1030 adjust_fit(0,0); pickup fine.nib; interim superness:=more_super;
1031 x0=0; x2=x3+.25u; pos3(stem,-180); lft x3r=hround(2.5u-.5stem);
1032 hook_in(0,1,2)(skewed);  % opening hook
1033 pos2'(stem,-180); z2'=z2; pos4(vair,-90); pos5(hair,0);
1034 x4=.5w+u; rt x5r=hround(w-.5u);
1035 y3=.7[y4,y5]; bot y4r=-oo; y5=.57x_height;
1036 filldraw stroke z2'e{-u,-x_height}...super_arc.e(3,4)
1037  ..tension atleast 1.05..{up}z5e; % left stem and arc
1038 v_bulb(5,6);  % closing bulb
1039 pos7(hair,0); pos8(hair,0); x7=x8=.5w+.5u; top y7=h; bot y8=-d-oo;
1040 filldraw stroke z7e--z8e;  % stem
1041 math_fit(-2/3x_height#*slant+.5hair#+.5u#,2/3ic#);
1042 penlabels(0,1,2,3,4,5,6,7,8); endchar;
1043
1044 cmchar "Lowercase Greek omega";
1045 beginchar("w",11u#,x_height#,0);
1046 italcorr x_height#*slant;
1047 adjust_fit(0,0); pickup fine.nib;
1048 pos2(hair,-180); lft x2r=hround.5u; y2=y4=y6=y8=bar_height;
1049 y1+.5hair=h; x1=x2+.75u; pos1(hair,angle(2(x1-x2),y1-y2)+90);
1050 pos3(vstem+dw,-90); pos4(hair,0); pos5(vair,90);
1051 pos6(hair,180); pos7(vstem+dw,270); pos8(hair,360);
1052 bot y3r=bot y7r=-oo; top y5r=vround(.2[y4,h]+.5vair);
1053 x3=.5[x2,x4]; x7+.25u=.5[x6,x8]; rt x8r=hround(w-.5u);
1054 x5+.5stem=hround(.5w+.5stem)+eps;
1055 x5=.5[x4,x6]; rt x4r-lft x6r=min(stem,2hair)+2eps;
1056 if x4l<x6l: x4l:=x6l:=x5; fi
1057 filldraw circ_stroke z1e{2(x2-x1),y2-y1}...z2e{down}...z3e{right}
1058  ...{up}z4e...{left}z5e;  % left arc
1059 filldraw stroke z5e{left}...z6e{down}...z7e{right}...{up}z8e;  % right arc
1060 v_bulb(8,9);  % closing bulb
1061 math_fit(-bar_height#*slant,2/3ic#); penlabels(1,2,3,4,5,6,7,8,9); endchar;
1062
1063 cmchar "Variant lowercase Greek epsilon";     % This is the one we use
1064 beginchar("e",8u#,x_height#,0);
1065 italcorr x_height#*slant-.5u#;
1066 adjust_fit(0,0); pickup fine.nib;
1067 numeric light_vstem; light_vstem=Vround 2/3[vair,vstem];
1068 pos2(light_vstem,90); x2=x8=.5w+.5u; top y2r=h+o;
1069 x1+.5light_vstem=hround(w-u); y1=.2[y2,bar_height];
1070 pos1(light_vstem,angle(x1-x2,2(y1-y2))+90); pos3(hair,180); pos4(vair,270);
1071 pos5(hair,360); pos6(vair,450); pos7(hair,540); pos8(light_vstem,630);
1072 lft x3r=hround u; x4=x6=.5w; rt x5r=hround(w-2.5u); x7=x3;
1073 y3=.5[y2,y4]; y5=bar_height=.5[y4,y6]; y7=.5[y6,y8]; bot y8r=-o;
1074 top y6r-bot y4r=vstem+eps; if y6l<y4l: y6l:=y4l:=y5; fi
1075 x9+.5vair=hround(w-.5u); y9=1/3[y8,bar_height];
1076 pos9(vair,angle(x8-x9,2(y8-y9))+90);
1077 filldraw circ_stroke z1e{x2-x1,2(y2-y1)}...pulled_super_arc.e(2,3)(.5superpull)
1078  & super_arc.e(3,4)...{up}z5e;  % upper arc
1079 filldraw circ_stroke z9e{x8-x9,8(y8-y9)}...pulled_arc.e(8,7)
1080  & super_arc.e(7,6)...{down}z5e;  % lower arc
1081 math_fit(-.5bar_height#*slant-.5u#,ic#);
1082 penlabels(1,2,3,4,5,6,7,8,9); endchar;
1083
1084 cmchar "Variant lowercase Greek theta";     % This is the one we prefer
1085 beginchar(oct"002",9u#,asc_height#,0);
1086 italcorr .5[bar_height#,x_height#]*slant+.5vair#+.5u#;
1087 adjust_fit(0,0); pickup fine.nib;
1088 numeric light_curve; light_curve=hround .5[stem,curve];
1089 x0=0; x2-.5stem=hround(2.5u-.5stem); hook_in(0,1,2);  % opening hook
1090 pos2'(stem,-180); z2'=z2; pos3(stem,-180); pos4(vair,-90);
1091 pos5(light_curve,0); pos6(vair,90); pos7(hair,180); pos8(vair,270);
1092 x3=x2; x4=x6=.5[x3,x5]; rt x5r=hround(w-1.5u+.5light_curve);
1093 lft x7r=hround(3.25u-.5hair); x8+.5vair=hround(w+.5vair-epsilon);
1094 y3=.4x_height; bot y4r=-oo; y5=.5[y4,y6]; top y6r=h+oo;
1095 y7=.5[x_height,h]; y8=.5[bar_height,x_height];
1096 filldraw stroke z2'e..{{interim superness:=hein_super; super_arc.e(3,4)}}
1097  & pulled_arc.e(4,5) & pulled_arc.e(5,6)
1098  ...{down}z7e...{4(x8-x7),y8-y7}z8e;  % bowl and loop
1099 math_fit(-2/3x_height#*slant+.5hair#+.5u#,ic#);
1100 penlabels(0,a,1,2,3,4,5,6,7,8); endchar;
1101
1102 cmchar "Variant lowercase Greek pi";       % We don't use this one
1103 beginchar(oct"013",14.5u#,x_height#,0);
1104 italcorr x_height#*slant+.5stem#-u#;
1105 adjust_fit(0,0); pi_stroke; % hook and bar
1106 pos4(hair,-180); pos5(hair,-180); pos6(vstem,-90);
1107 pos7(hair,0); pos7'(hair,-180); z7'=z7;
1108 pos8(vstem,-90); pos9(hair,0); pos0(hair,0);
1109 x4=x5+1.5u; lft x5r=hround 2u; x6=x4+.5u; lft x7l=hround(.5w+.25u-.5hair);
1110 x8=w-4.5u; rt x9r=hround(w-1.5u); x0=x9-1.25u;
1111 top y4=top y0=h; y5+.1h=y7-.1h=y9=bar_height; bot y6r=bot y8r=-oo;
1112 filldraw stroke z4e{2(x5-x4),y5-y4}...z5e{down}
1113  ...z6e{right}...z7e{up};  % left bowl
1114 filldraw stroke z0e{2(x9-x0),y9-y0}...z9e{down}
1115  ...z8e{left}...z7'e{up};  % right bowl
1116 math_fit(-.7x_height#*slant+.5hair#+.5u#,ic#-.5u#);
1117 penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
1118
1119 cmchar "Lowercase Greek rho";     % We don't use this one
1120 beginchar(oct"014",8.25u#,x_height#,desc_depth#);
1121 italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi;
1122 adjust_fit(0,0); pickup fine.nib;
1123 pos1(stem,180); pos2(stem,180); pos3(vair,90);
1124 pos4(curve,0); pos5(vair,-90); pos6(hair,-180);
1125 lft x2r=hround(1.5u-.5stem); x1=x2=x6; x3=x5=.5[x2,x4];
1126 rt x4r=hround(w-1.5u+.5curve);
1127 y1-.5stem=-d-o; y2=y4=y6=.5[y3,y5]; top y3r=h+oo; bot y5r=-oo;
1128 filldraw circ_stroke z1e..pulled_arc.e(2,3) & pulled_arc.e(3,4)
1129  & pulled_arc.e(4,5) & pulled_arc.e(5,6);  % stem and bowl
1130 math_fit(desc_depth#*slant+.5stem#-u#,ic#);
1131 penlabels(1,2,3,4,5,6); endchar;
1132
1133 cmchar "Variant lowercase Greek sigma";     % Needed for terminal sigmas
1134 beginchar(oct"015",8u#,x_height#,.5min(desc_depth#,.5x_height#));
1135 italcorr x_height#*slant-.5u#;
1136 adjust_fit(0,0); pickup fine.nib;
1137 numeric heavy_vair; heavy_vair=.25[vair,vstem];
1138 pos1(heavy_vair,-110); pos2(vair,-90);
1139 x1+.5heavy_vair=hround(w-u); y1=.1[y2r,bar_height];
1140 x2=min(.5w+u,x1r-eps); top y2l=h+oo;
1141 filldraw circ_stroke z1e{x2-x1,2(y2-y1)}...{left}z2e;  % upper bulb
1142 numeric theta; theta=90-angle(16u,x_height); slope:=-x_height/16u;
1143 pos6(stem,theta); pos7(vair,-90); pos8(vair,-135);
1144 lft x4l=hround u; x4r-x4l=(hround .5[vair,stem])-fine;
1145 x6=x7=w-2u; x8=.5w+u; y6=.25[y8,y2]; y8=y7+1/8d; bot y7r=-d-oo;
1146 ellipse_set(2l,4l,5l,6l); ellipse_set(2r,4r,5r,6r); y4=y4r;
1147 filldraw circ_stroke z8e{x7-x8,2(y7-y8)}...z7e{right}...z6e
1148  ---z5e...{up}z4e...{right}z2e;  % main stroke
1149 math_fit(-.5x_height#*slant-.5u#,0); penlabels(1,2,4,5,6,7,8); endchar;
1150
1151 cmchar "Variant lowercase Greek phi";       % This is the one we prefer
1152 beginchar(oct"000",11u#,x_height#,desc_depth#);
1153 italcorr .7x_height#*slant;
1154 adjust_fit(0,0); pickup fine.nib;
1155 pos1(hair,-180); x1=x2+.75u; top y1=h;
1156 pos2(hair,-180); lft x2r=hround .5u; y2=bar_height;
1157 pos3(vstem,-90); x3=.5(w+u); bot y3r=-oo;
1158 pos4(hair,0); rt x4r=hround(w-.5u); y4=y2;
1159 pos5(vstem,90); x5=.52[x6,x4]; top y5r=h+oo;
1160 pos6(hair,180); x6=x7; y6=1/3h;
1161 pos7(stem,180); lft x7r=hround(.5w-.5u-.5stem); y7-.5stem=-d-o;
1162 filldraw circ_stroke z7e---z6e...{right}z5e...{down}z4e...{left}z3e
1163  ...{up}z2e...{3(x1-x2),y1-y2}z1e;  % bowl and stem
1164 math_fit(-.3x_height#*slant,ic#); penlabels(1,2,3,4,5,6,7); endchar;
1165
1166 input romand;  % numerals                       '060--'071
1167 input accent;   % '022--'030,'040,'136,'137,'175--'177
1168 input comlig;   % '042,'055,'134,'173,'174
1169 input punct;    % '041,'043,'045,'047--'054,'056,'057,'072,'073,'075
1170                 % '100,'133,'135,'140
1171 input romanp;   % '044,'046,'077
1172
1173
1174
1175 ligtable "p": "s" =: oct"001", "h" =: oct"000";
1176 ligtable "c": "h" =: "h";
1177 ligtable "C": "H" =: "H", "h" =: "H";
1178
1179 ligtable "P": "S" =: oct"011", "s" =: oct"011", %\Pi -> \Psi, \Phi
1180         "H" =: oct"010", "h" =: oct"010";
1181 ligtable "t": "h" =: oct"002"; %\tau
1182 ligtable "T": "H" =: oct"012", "h" =: oct"012";
1183 ligtable "k": "h" =: "h";
1184 ligtable "K": "H" =: "H", "h" =: "H";
1185 %ligtable "r": "h" =: "r";
1186 %ligtable "R": "H" =: "R", "h" =: "R"; % $\Rho:$
1187 bye.
1188
1189
1190 % Here follow various programs which have been revised above
1191
1192 cmchar "Lowercase Greek alpha";
1193 beginchar("a",11u#,x_height#,0);
1194 italcorr max(1/3x_height#*slant+.5hair#+.5u#,x_height#*slant-.5u#);
1195 adjust_fit(0,0); pickup fine.nib;
1196 pos0(hair,0); pos1(vair,-90); pos2(curve,-180); pos3(vair,-270);
1197 z4=(w-3.25u,9/16h); z5=(w-2.75u,.5[vair,y4]);
1198 numeric theta; theta=angle(z4-z5)-90;
1199 pos4(stem,theta); pos5(stem,theta);
1200 pos6(vair,90); pos7(hair,180);
1201 rt x0r=hround(w-u); x1=x3=.5w-u; lft x2r=hround(1.5u-.5curve);
1202 x6=w-u; x7+.5hair=hround(w+.5hair-epsilon);
1203 top y0=vround .8[bar_height,h]; bot y1r=bot y6l=-oo;
1204 y2=.5[y1,y3]; top y3r=h+oo; y7=1/4bar_height;
1205 filldraw stroke z0e{down}...pulled_arc.e(1,2) & pulled_arc.e(2,3)
1206  ...z4e---z5e...z6e{right}...{up}z7e; % diagonal, bowl, and hook
1207 math_fit(-.3x_height#*slant+.5curve#-u#,1/3x_height#*slant+.5hair#+.5u#);
1208 penlabels(0,1,2,3,4,5,6,7); endchar;
1209
1210 cmchar "Lowercase Greek iota";
1211 beginchar("i",5u#,x_height#,0);
1212 italcorr 1/3x_height#*slant+.5hair#+.5u#;
1213 adjust_fit(if monospace: u#,u# else: 0,0 fi); pickup fine.nib;
1214 pos1(stem,0); lft x1l=hround(1.5u-.5stem); y1+.5stem=h+oo;
1215 x2=x1-.25u; x4=w; hook_out(2,3,4)(skewed);  % closing hook
1216 filldraw circ_stroke z1e{down}...{-u,-x_height}z2e;  % stem
1217 math_fit(0,ic#); penlabels(1,2,3,4); endchar;
1218
1219 cmchar "Lowercase Greek lambda";
1220 beginchar("l",10.5u#,asc_height#,0);
1221 adjust_fit(0,0); pickup fine.nib;
1222 pos1(vair,90); lft x1=hround .1u; top y1r=h;
1223 x2=x1+2u; y2=.7[x_height,h]; x3=w-2u; bot y4=-oo; y3=max(.07h,y4+eps);
1224 z4-(.25u,0)=whatever[z2,z3]; numeric theta; theta=angle(z2-z3)-90;
1225 pos2(stem,theta); pos3(stem,theta); pos4(stem,0);
1226 filldraw circ_stroke z1e{right}...z2e---z3e
1227  ...{2(x4e-x3e),y4e-y3e}z4e;  % long diagonal
1228 y5=.5[bar_height,x_height]; z5=whatever[z2,z3];
1229 x6=1.5u; y6-.5stem=-oo; pos5(hair,theta-90); pos6(stem,angle(z5-z6)-90);
1230 filldraw circ_stroke z6e--z5e; % short diagonal
1231 penlabels(1,2,3,4,5,6); endchar;
1232
1233 cmchar "Lowercase Greek mu";
1234 beginchar("m",9u#,x_height#,desc_depth#);
1235 italcorr 1/3x_height#*slant+.5hair#+.5u#;
1236 adjust_fit(0,0); pickup fine.nib; interim superness:=more_super;
1237 pos1(stem,-180); pos2(stem,-180); x1=x2=x3; lft x1r=hround(1.5u-.5stem);
1238 y1+.5stem=h+oo; y2-.5stem=-d-o;
1239 filldraw z1r---z2r..z2l---z1l..cycle;  % left stem
1240 pos3(stem,-180); pos4(vair,-90); pos5(hair,0); x4=.5[x3,x5];
1241 pos6(stem,0); rt x6r=hround(w-2.5u+.5stem);
1242 x5=x6=x7; x9=w; hook_out(7,8,9);  % closing hook
1243 y3=.7[y4,y5]; bot y4r=-oo; y5=.57h; y6+.5stem=h;
1244 filldraw stroke super_arc.e(3,4)...{up}z5e; % left stem and arc
1245 filldraw circ_stroke z6e--z7e;  % right stem
1246 math_fit(desc_depth#*slant+.5stem#-u#,ic#);
1247 penlabels(1,2,3,4,5,6,7,8,9); endchar;
1248
1249 cmchar "Lowercase Greek nu";
1250 beginchar("n",8.5u#,x_height#,0);
1251 italcorr x_height#*slant+.5stem#-u#;
1252 adjust_fit(0,0); pickup fine.nib;
1253 pos3(vair,-90); pos4(stem,0); bot y3r=0; y4+.5stem=h+oo;
1254 x3-.5stem=hround(1.5u-.5stem); x4+.5stem=hround(w-1.5u+.5stem);
1255 filldraw circ_stroke z4e{down}...{-36u,-h}z3e;  % diagonal
1256 pickup tiny.nib; pos1(stem,0); pos2(stem,0);
1257 top y1=h+min(oo,serif_drop); bot y2=0; x1=x2=x3;
1258 z=((z4{down}...{-36u,-h}z3)intersectionpoint((x2r,0)--(x2r,h)));
1259 filldraw z1l--z2l--z--z1r--cycle;  % stem
1260 sloped_serif.l(1,2,a,1/3,jut,serif_drop); % upper left serif
1261 math_fit(0,ic#-1/3x_height#*slant-.5u#); penlabels(1,2,3,4); endchar;
1262
1263 cmchar "Lowercase Greek xi";
1264 beginchar("x",9u#,asc_height#,desc_depth#);
1265 italcorr .75[x_height#,asc_height#]*slant-2u#;
1266 adjust_fit(0,0); pickup fine.nib;
1267 pos10(hair,-720); pos11(vair,-630); pos12(hair,-540); pos13(vair,-450);
1268 lft x10l=hround 1/3w; x11=x13=.5[x10,x12]; rt x12l=hround(w-2.5u);
1269 top y10=h; top y13l=bot y11l+vstem+eps=vround(y10-.25(h-x_height));
1270 y12=.5[y11,y13]; if y11r>y13r: y11r:=y13r:=y12; fi
1271 pos0(curve,-360); pos1(vair,-270); pos2(hair,-180); pos3(vair,-90);
1272 numeric theta; theta=90-angle(22u,x_height); slope:=-x_height/22u;
1273 pos6(stem,theta); pos7(vair,-90); pos8(vair,-135);
1274 lft x0l=hround u; x1=x3=x11; x2=x12;
1275 y0=.5[y13,y1]; top y3l=vround .5h=bot y1l+vstem+eps; y2=.5[y1,y3];
1276 if y1r>y3r: y1r:=y3r:=y2; fi
1277 lft x4l=hround u; x4r-x4l=hround .5[vair,stem]-fine;
1278 x6=x7=w-2u; x8=.5w+.5u; y6=-.3d; bot y7r=-d-oo; y8=max(-3/4d-oo,y7l);
1279 ellipse_set(3l,4l,5l,6l); ellipse_set(3r,4r,5r,6r);
1280 y4l:=.9[y6,y4l]; y4=y4r:=.9[y6,y4r];
1281 filldraw circ_stroke z10e{down}...z11e{right}...{up}z12e;  % opening hook
1282 filldraw stroke z12e{up}...z13e{left}...z0e{down}
1283  ...z1e{right}...{up}z2e;  % upper arc
1284 filldraw circ_stroke z8e{x7-x8,2(y7-y8)}...z7e{right}...z6e
1285  ---z5e...{up}z4e...{right}z3e...{down}z2e;  % main stroke
1286 math_fit(-.2asc_height#*slant-.5u#,0);
1287 penlabels(0,1,2,3,4,5,6,7,8,10,11,12,13); endchar;
1288