Debian Codegraph @

texmf-dist/fonts/source/public/cmextra/cmman.mf

raw
1 % Variants of Computer Modern, specially for the TeX/METAFONT manuals
2
3 if unknown cmbase: input cmbase fi
4 mode_setup;
5
6 def generate suffix t= enddef;
7
8 inner cmchar;
9
10 font_size 10pt#;
11 font_identifier "CMMAN";
12 font_coding_scheme "PI";
13
14 input cmtt10; font_setup;
15
16 cmchar "Cross between 0 and O";
17 beginchar("0",9u#,fig_height#,0);
18 italcorr fig_height#*slant-.5u#;
19 adjust_fit(0,0);
20 penpos1(vair,90); penpos3(vair,-90); penpos2(curve,180); penpos4(curve,0);
21 superness:=.77;
22 x2r=round max(.7u,1.45u-.5curve); x4r=w-x2r; x1=x3=.5w;
23 y1r=h+o; y3r=-o; y2=y4=.5h-vair_corr; y2l:=y4l:=.52h;
24 penstroke pulled_arc.e(1,2) & pulled_arc.e(2,3)
25 & pulled_arc.e(3,4) & pulled_arc.e(4,1) & cycle; % bowl
26 penlabels(1,2,3,4); endchar;
27
28 input cmssq8; slant:=sind 12/cosd 12; font_setup;
29
30 cmchar "Lowercase Greek beta";
31 beginchar(oct"014",9.5u#,asc_height#,desc_depth#);
32 italcorr .5[x_height#,asc_height#]*slant-u#;
33 adjust_fit(0,0); pickup fine.nib;
34 pos0(hair,180); pos1(hair,180); pos2(vair,90);
35 pos3(stem,0); pos4(vair,-90); pos5(hair,-180);
36 pos6(vair,-270); pos7(curve,-360); pos8(vair,-450); pos9(hair,-540);
37 x0=x1=x9; lft x0l=hround(1.5u-.5hair); x2=x4=x6=x8=.5w+.25u;
38 rt x3r=hround(w-1.5u); rt x7r=hround(w-1.5u+.5curve); rt x5l=hround(x4-u);
39 bot y0=-d; y1=top y6r=x_height; top y2r=h+oo; y3=.5[y2,y4];
40 y5=.5[y4,y6]; top y6r-bot y4r=vstem+eps; bot y8=-oo; y7=y9=.5[y6,y8];
41 if y6l<y4l: y6l:=y4l:=y5; fi
42 filldraw stroke z0e---z1e...pulled_arc.e(2,3)
43 & pulled_arc.e(3,4)...{up}z5e; % stem and upper bowl
44 filldraw stroke z5e{up}...pulled_arc.e(6,7)
45 & pulled_arc.e(7,8)...{up}z9e; % lower bowl
46 math_fit(desc_depth#*slant+.5hair#-u#,.7x_height#*slant+.5curve#-1.5u#);
47 penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
48
49 cmchar "Lowercase thorn";
50 beginchar(oct"015",10u#+serif_fit#,asc_height#,desc_depth#);
51 italcorr .5x_height#*slant+min(.5curve#-.85u#,-.1u#);
52 adjust_fit(serif_fit#,0);
53 pickup tiny.nib; pos1(stem',0); pos2(stem,0);
54 pos0'(stem',0); pos0(stem,0); z0l=z0'l; x0'=x1; x0=x2;
55 lft x1l=hround(2.5u-.5stem'); top y1=h;
56 numeric edge; edge=rt x2r;
57 pickup fine.nib; pos3(if hefty:thin_join else: hair fi,180);
58 pos4(vair',90); pos5(curve,0); pos6(vair,-90);
59 rt x3l=1/3[rt x2,edge]; y3=1/8[bar_height,x_height];
60 x4l=w-.5(w-serif_fit)+.5u; top y4r=x_height+oo;
61 rt x5r=hround min(w-1.35u+.5curve,w-.6u); y5=.5x_height;
62 x6=x3; bot y6r=-oo;
63 (x,y4r)=whatever[z3l,z4l]; x4r:=min(x,.5[x5r,x4]);
64 filldraw stroke z3e{up}...{right}z4e&super_arc.e(4,5)
65 &z5e{down}...{5(x6-x5),y6-y5}z6e; % bowl
66 y0=ypart(((edge,h)--(edge,0))intersectionpoint(z3l{up}...{right}z4l));
67 pickup tiny.nib; bot y2=-d;
68 filldraw stroke z1e--z0'e--z0e--z2e; % stem
69 pickup crisp.nib; pos8(hair,0); pos7'(stem,0);
70 z7'=z2; x8l=x7'l; bot y8=0;
71 filldraw stroke z7'e--z8e; % point
72 if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop); % upper serif
73 dish_serif(2,0,b,1/3,jut,c,1/3,0); fi % lower serif
74 penlabels(0,1,2,3,4,5,6,8); endchar;
75
76 input cmr10; font_setup;
77
78 message "Parentheses";
79 code:=ASCII "0"; % the characters will be 123456789:
80 for c=0,1,2,4,infinity:
81 cmchar "Left paren with curl "&decimal c;
82 beginchar(incr code,7u#,body_height#,paren_depth#);
83 italcorr body_height#*slant-.5u#;
84 adjust_fit(0,0); pickup fine.nib;
85 pos1(vair,0); pos2(.75[hair,stem],0); pos3(vair,0);
86 rt x1r=rt x3r=round(w-u); lft x2l=round(x1-4u if monospace: +4/3u fi);
87 top y1=h; y2=.5[y1,y3]=math_axis;
88 filldraw stroke z1e{curl c}..z2e..{curl c}z3e; % arc
89 penlabels(1,2,3); endchar;
90
91 cmchar "Right paren with curl "&decimal c;
92 beginchar(incr code,7u#,body_height#,paren_depth#);
93 italcorr math_axis#*slant-.5u#;
94 adjust_fit(0,0); pickup fine.nib;
95 pos1(vair,0); pos2(.75[hair,stem],0); pos3(vair,0);
96 lft x1l=lft x3l=round u; rt x2r=round(x1+4u if monospace: -4/3u fi);
97 top y1=h; y2=.5[y1,y3]=math_axis;
98 filldraw stroke z1e{curl c}..z2e..{curl c}z3e; % arc
99 penlabels(1,2,3); endchar;
100 endfor
101
102 message "big G";
103 u#:=50/36pt#; % unit width
104 width_adj#:=0pt#; % width adjustment for certain characters
105 serif_fit#:=0pt#; % extra sidebar near lowercase serifs
106 cap_serif_fit#:=0/36pt#; % extra sidebar near uppercase serifs
107 letter_fit#:=0pt#; % extra space added to all sidebars
108
109 body_height#:=12pt#+250/36pt#; % height of tallest characters
110 asc_height#:=body_height#; % height of lowercase ascenders
111 cap_height#:=body_height#; % height of caps
112 fig_height#:=body_height#; % height of numerals
113 x_height#:=155/250asc_height#; % height of lowercase without ascenders
114 math_axis#:=90/250asc_height#; % axis of symmetry for math symbols
115 bar_height#:=87/250asc_height#; % height of crossbar in lowercase e
116 comma_depth#:=70/250asc_height#;% depth of comma below baseline
117 desc_depth#:=comma_depth#; % depth of lowercase descenders
118
119 crisp#:=0pt#; % diameter of serif corners
120 tiny#:=1.2/36pt#; % diameter of rounded corners
121 fine#:=1.1/36pt#; % diameter of sharply rounded corners
122 thin_join#:=1.1/36pt#; % width of extrafine details
123 hair#:=14/36pt#; % lowercase hairline breadth
124 stem#:=75/36pt#; % lowercase stem breadth
125 curve#:=90/36pt#; % lowercase curve breadth
126 ess#:=81/36pt#; % breadth in middle of lowercase s
127 flare#:=66/36pt#; % diameter of bulbs or breadth of terminals
128 dot_size#:=114/36pt#; % diameter of dots
129 cap_hair#:=17/36pt#; % uppercase hairline breadth
130 cap_stem#:=96/36pt#; % uppercase stem breadth
131 cap_curve#:=111/36pt#; % uppercase curve breadth
132 cap_ess#:=105/36pt#; % breadth in middle of uppercase s
133 rule_thickness#:=1pt#; % thickness of lines in math symbols
134
135 dish#:=2/36pt#; % amount erased at top or bottom of serifs
136 bracket#:=50/36pt#; % vertical distance from serif base to tangent
137 jut#:=70/36pt#; % protrusion of lowercase serifs
138 cap_jut#:=2.5pt#; % protrusion of uppercase serifs
139 beak_jut#:=25/36pt#; % horizontal protrusion of beak serifs
140 beak#:=comma_depth#; % vertical protrusion of beak serifs
141 vair#:=12/36pt#; % vertical diameter of hairlines
142 notch_cut#:=22pt#; % maximum breadth above or below notches
143 bar#:=17/36pt#; % lowercase bar thickness
144 slab#:=17/36pt#; % serif and arm thickness
145 cap_bar#:=17/36pt#; % uppercase bar thickness
146 cap_band#:=17/36pt#; % uppercase thickness above/below lobes
147 cap_notch_cut#:=22pt#; % max breadth above/below uppercase notches
148 serif_drop#:=10/36pt#; % vertical drop of sloped serifs
149 stem_corr#:=3/36pt#; % for small refinements of stem breadth
150 vair_corr#:=2/36pt#; % for small refinements of hairline height
151 apex_corr#:=0pt#; % extra width at diagonal junctions
152
153 o#:=12/36pt#; % amount of overshoot for curves
154 apex_o#:=12/36pt#; % amount of overshoot for diagonal junctions
155
156 slant:=0; % tilt ratio $(\Delta x/\Delta y)$
157 fudge:=1; % factor applied to weights of heavy characters
158 math_spread:=0; % extra openness of math symbols
159 superness:=1/sqrt2; % parameter for superellipses
160 superpull:=1/6; % extra openness inside bowls
161 beak_darkness:=11/30; % fraction of triangle inside beak serifs
162 ligs:=2; % level of ligatures to be included
163
164 square_dots:=false; % should dots be square?
165 hefty:=false; % should we try hard not to be overweight?
166 serifs:=true; % should serifs and bulbs be attached?
167 monospace:=false; % should all characters have the same width?
168 variant_g:=false; % should an italic-style g be used?
169 low_asterisk:=false; % should the asterisk be centered at the axis?
170 math_fitting:=false; % should math-mode spacing be used?
171
172 font_setup;
173
174 cmchar "The letter G";
175 if serifs: beginchar("G",14u#,cap_height#,0);
176 italcorr cap_height#*slant-1.5u#-.5cap_serif_fit#;
177 adjust_fit(0,.5cap_serif_fit#);
178 pickup tiny.nib; pos0(cap_stem,0); pos7(cap_stem,0);
179 rt x0r=hround(w-2u); y0=good.y(.1[bar_height,x_height]+1); x7=x0;
180 pickup fine.nib;
181 if hefty: bot y7=0; pos5(cap_stem,0); x5=x0; top y5=tiny.top y0;
182 else: pos5(cap_hair,0); pos8(cap_stem,0);
183 y7=.5bar_height; z5l=z8l; z8=z7; x9=x8r; bot y9=0;
184 filldraw z8l{down}..{4(x9-x8),y9-y8}z9--z8r--cycle; fi % spur
185 pos1(cap_hair,0); pos2(cap_band,90);
186 pos3(cap_curve,180); pos4(cap_band,270);
187 rt x1r=hround(w-2u); lft x3r=hround u; x2=x4=.55[x3,x1];
188 top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
189 bot y1=vround max(.6h,x_height-.5vair);
190 (x2l',y2l)=whatever[z2r,z1l]; x2l:=x2l';
191 (x4l',y4l)=whatever[z4r,z5l]; x4l:=x4l';
192 filldraw stroke z1e{x2-x1,10(y2-y1)}
193 ...pulled_arc.e(2,3) & pulled_arc.e(3,4)...z5e{up}; % arc
194 x6=x1r; top y6=h+o; x1r-x1'=2cap_curve-fine; y1'=y1;
195 path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..{left}z2;
196 numeric t; t=xpart(upper_arc intersectiontimes (z6--z1'));
197 filldraw subpath(0,t) of upper_arc--z6--z1r--z1--cycle; % barb
198 pickup tiny.nib; filldraw stroke z0e--z7e; % stem
199 dish_serif(0,7,a,1/3,max(cap_jut,2.25u),b,1/3,1.25u); % serif
200 math_fit(-.3cap_height#*slant-.5u#,ic#);
201 else: beginchar("G",12u#,cap_height#,0);
202 italcorr cap_height#*slant-.5u#;
203 adjust_fit(0,0);
204 pickup fine.nib; pos1(1.2flare,80); pos2(slab,90);
205 pos3(cap_curve,180); pos4(slab,270); pos5(flare,270);
206 rt x1r=hround(w-1.35u); x2=x4=.5w+u;
207 lft x3r=hround max(u,2u-.5cap_curve); rt x5l=hround(w-1.2u);
208 top y1r=vround .93h+o; top y2r=h+o; y3=.5h;
209 bot y4r=-o; bot y5r=vround .07h-o;
210 filldraw stroke rterm.e(2,1,right,.9,4)&super_arc.e(2,3)
211 & super_arc.e(3,4) & term.e(4,5,right,1,4); % arc and terminals
212 pos0(stem,0); pos7(stem,0);
213 z7r=z5r; x0=x7; top y0=1+vround .35[bar_height,x_height];
214 filldraw stroke z0e--z7e; % stem
215 pos8(cap_bar,90); pos9(cap_bar,90);
216 z0r=z9r; y8=y9; lft x8=hround x4;
217 filldraw stroke z8e--z9e; % bar
218 math_fit(-.3cap_height#*slant-.5u#,.5ic#); fi
219 penlabels(0,1,1',2,3,4,5,6,7,8,9); endchar;
220
221 message "The TeXbook title";
222 f:=20/3; % magnification factor (based mostly on cmssdc10)
223 u#:=f*19/36pt#; % unit width
224 width_adj#:=f*15/36pt#; % width adjustment for certain characters
225 serif_fit#:=-f*8/36pt#; % extra sidebar near lowercase serifs
226 cap_serif_fit#:=-f*9/36pt#; % extra sidebar near uppercase serifs
227 letter_fit#:=-.2u#; % extra space added to all sidebars
228
229 body_height#:=f*270/36pt#; % height of tallest characters
230 asc_height#:=f*265/36pt#; % height of lowercase ascenders
231 cap_height#:=f*265/36pt#; % height of caps
232 fig_height#:=f*265/36pt#; % height of numerals
233 x_height#:=f*170/36pt#; % height of lowercase without ascenders
234 math_axis#:=f*95/36pt#; % axis of symmetry for math symbols
235 bar_height#:=f*95/36pt#; % height of crossbar in lowercase e
236 comma_depth#:=f*40/36pt#; % depth of comma below baseline
237 desc_depth#:=f*60/36pt#; % depth of lowercase descenders
238
239 crisp#:=5*23/36pt#; % diameter of serif corners
240 tiny#:=5*23/36pt#; % diameter of rounded corners
241 fine#:=5*8/36pt#; % diameter of sharply rounded corners
242 thin_join#:=12*8/36pt#; % width of extrafine details
243 hair#:=5*40/36pt#; % lowercase hairline breadth
244 stem#:=5*40/36pt#; % lowercase stem breadth
245 curve#:=5*40/36pt#; % lowercase curve breadth
246 ess#:=5*37/36pt#; % breadth in middle of lowercase s
247 flare#:=5*31/36pt#; % diameter of bulbs or breadth of terminals
248 dot_size#:=5*38/36pt#; % diameter of dots
249 cap_hair#:=5*40/36pt#; % uppercase hairline breadth
250 cap_stem#:=5*44/36pt#; % uppercase stem breadth
251 cap_curve#:=5*44/36pt#; % uppercase curve breadth
252 cap_ess#:=5*42/36pt#; % breadth in middle of uppercase s
253 rule_thickness#:=5*25/36pt#; % thickness of lines in math symbols
254
255 dish#:=0pt#; % amount erased at top or bottom of serifs
256 bracket#:=0pt#; % vertical distance from serif base to tangent
257 jut#:=0pt#; % protrusion of lowercase serifs
258 cap_jut#:=0pt#; % protrusion of uppercase serifs
259 beak_jut#:=0pt#; % horizontal protrusion of beak serifs
260 beak#:=f*1.5/36pt#; % vertical protrusion of beak serifs
261 vair#:=6*23/36pt#; % vertical diameter of hairlines
262 notch_cut#:=6*40/36pt#; % maximum breadth above or below notches
263 bar#:=6*23/36pt#; % lowercase bar thickness
264 slab#:=6*31/36pt#; % serif and arm thickness
265 cap_bar#:=6*29/36pt#; % uppercase bar thickness
266 cap_band#:=6*27/36pt#; % uppercase thickness above/below lobes
267 cap_notch_cut#:=6*37/36pt#; % max breadth above/below uppercase notches
268 serif_drop#:=f*2/36pt#; % vertical drop of sloped serifs
269 stem_corr#:=5*1/36pt#; % for small refinements of stem breadth
270 vair_corr#:=5*2/36pt#; % for small refinements of hairline height
271 apex_corr#:=f*14/36pt#; % extra width at diagonal junctions
272
273 o#:=f*7/36pt#; % amount of overshoot for curves
274 apex_o#:=0pt#; % amount of overshoot for diagonal junctions
275
276 slant:=0; % tilt ratio $(\Delta x/\Delta y)$
277 fudge:=.91; % factor applied to weights of heavy characters
278 math_spread:=-.3; % extra openness of math symbols
279 superness:=.74; % parameter for superellipses
280 superpull:=1/18; % extra openness inside bowls
281 beak_darkness:=0; % fraction of triangle inside beak serifs
282 ligs:=2; % level of ligatures to be included
283
284 square_dots:=true; % should dots be square?
285 hefty:=true; % should we try hard not to be overweight?
286 serifs:=false; % should serifs and bulbs be attached?
287 monospace:=false; % should all characters have the same width?
288 variant_g:=true; % should an italic-style g be used?
289 low_asterisk:=false; % should the asterisk be centered at the axis?
290 math_fitting:=false; % should math-mode spacing be used?
291
292 font_setup;
293
294 cmchar "The letter T";
295 beginchar("T",13u#-width_adj#,cap_height#,0);
296 italcorr cap_height#*slant-beak_jut#-.25u#;
297 adjust_fit(0,0);
298 h:=vround(h-2stem_corr);
299 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
300 lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0;
301 filldraw stroke z1e--z2e; % stem
302 pickup crisp.nib; pos3(slab,90); pos4(hair,0);
303 top y3r=h; x3=x1; rt x4r=hround(w-.65u); y4=good.y(y3l-beak);
304 arm(3,4,e,beak_darkness,.7beak_jut); % right arm and beak
305 pos5(hair,180); x5=w-x4; y5=y4;
306 arm(3,5,f,beak_darkness,-.7beak_jut); % left arm and beak
307 if serifs: dish_serif(1,2,a,1/3,.5cap_jut,b,1/3,.5cap_jut); % upper bracketing
308 dish_serif(2,1,c,1/3,1.414cap_jut,d,1/3,1.414cap_jut); fi % lower serif
309 math_fit(-.75cap_height#*slant,ic#-2.5u#); penlabels(1,2,3,4,5,6); endchar;
310
311 cmchar "The letter h";
312 beginchar("h",10u#,asc_height#,0);
313 italcorr .5[bar_height#,x_height#]*slant-serif_fit#+.5stem#-2u#;
314 adjust_fit(serif_fit#+stem_shift#,serif_fit#-stem_shift#);
315 pickup tiny.nib; pos1(stem,0); pos2(stem,0);
316 pos1'(stem',0); pos2'(stem',0); pos3(stem,0);
317 lft x1l=hround(2.5u-.5stem); x1l=x1'l=x2l=x2'l; x3=w-x1;
318 top y1=h; bot y2=0; y1=y1'; y2=y2';
319 filldraw stroke z1'e--z2'e; % left stem
320 h_stroke(2,a,3,4); % arch and right stem
321 if serifs: sloped_serif.l(1',2',b,1/3,jut,serif_drop); % upper left serif
322 numeric inner_jut; pickup tiny.nib;
323 if rt x2r+jut+.5u+1<=lft x4l-jut: inner_jut=jut;
324 else: rt x2r+jut+.5u+1=lft x4l-inner_jut; fi
325 dish_serif(2,1,c,1/3,jut,d,1/3,jut); % lower left serif
326 dish_serif(4,3,e,1/3,inner_jut,f,1/3,jut); fi % lower right serif
327 penlabels(1,2,3,4); endchar;
328
329 cmchar "The letter e";
330 beginchar("e",7.25u#+max(.75u#,.5curve#),x_height#,0);
331 italcorr .5[bar_height#,x_height#]*slant+.5min(curve#-1.5u#,0);
332 adjust_fit(if monospace: .25u#,.5u# else: 0,0 fi);
333 numeric left_curve,right_curve;
334 left_curve=right_curve+6stem_corr=curve if not serifs: -3stem_corr fi;
335 if right_curve<tiny.breadth: right_curve:=tiny.breadth; fi
336 if left_curve<tiny.breadth: left_curve:=tiny.breadth; fi
337 pickup tiny.nib; pos1(right_curve,0);
338 pos2(vair,90); pos3(left_curve,180);
339 y1=good.y bar_height; top y2r=h+vround 1.5oo; y0l=bot y1;
340 rt x1r=hround min(w-.5u,w-u+.5right_curve);
341 lft x3r=hround max(.5u,1.25u-.5left_curve); x2=.5w+.25u;
342 {{interim superness:=more_super;
343 filldraw stroke super_arc.e(1,2)}}; % right bowl
344 y3=.5[y2,y4]; bot y4r=-oo; x4=x2+.25u;
345 if serifs: pos4(vair',270); pos5(hair,360);
346 y5=max(good.y(.5bar_height-.9),y4l+vair); x5r=x1r;
347 (x,y4l)=whatever[z4r,z5]; x4l:=x;
348 filldraw stroke pulled_arc.e(2,3) & pulled_arc.e(3,4)
349 ...{x5-x4,5(y5-y4)}z5e; % left bowl, arc, and terminal
350 else: pos4(vair,270);
351 filldraw stroke super_arc.e(2,3) & super_arc.e(3,4); % left bowl and arc
352 pickup fine.nib; pos4'(vair,270); z4=z4';
353 pos5(.5[vair,flare],275); rt x5r=hround(w-.6u);
354 y5r=good.y(y5r+1/3bar_height-y5); y5l:=good.y y5l; x5l:=good.x x5l;
355 filldraw stroke term.e(4',5,right,1,4); fi % terminal
356 path testpath; testpath=super_arc.r(2,3) & super_arc.r(3,4);
357 y1'r=y0r=y0l+.6[thin_join,vair]; y1'l=y0l; x1'l=x1'r=x1;
358 forsuffixes $=l,r:
359 x0$=xpart(((0,y0$)--(x1,y0$)) intersectionpoint testpath); endfor
360 fill stroke z0e--z1'e; % crossbar
361 penlabels(0,1,2,3,4,5); endchar;
362
363 cmchar "The letter E";
364 beginchar("E",12u#-width_adj#,cap_height#,0);
365 italcorr cap_height#*slant-beak_jut#-.5u#;
366 adjust_fit(cap_serif_fit#,0);
367 h:=vround(h-stem_corr);
368 pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
369 lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
370 filldraw stroke z1e--z2e; % stem
371 pickup crisp.nib; pos3(slab,90); pos4(hair,0);
372 top y3r=h; x3=x1; rt x4r=hround(w-u); y4=good.y(y3l-beak);
373 arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak
374 pos5(cap_bar,-90); pos6(hair,0);
375 top y5l=vround(.52[y2,y1]+.5cap_bar); x5=x1;
376 pos0(cap_bar,90); pos7(hair,0);
377 z0=z5; x6=x7; y6-y5l=y0l-y7;
378 if serifs: rt x6r=hround(w-4.4u+.5hair); y6=good.y(y5l+.6beak);
379 rt x9r=hround(w-.5u);
380 else: rt x6r=hround(w-1.5u); y6=y5l; rt x9r=hround(w-.75u); fi
381 arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0); % middle arm and serif
382 pos8(slab if not serifs:+2stem_corr fi,-90); pos9(hair,0);
383 bot y8r=0; x8=x2; y9=y8l+7/6beak;
384 arm(8,9,h,beak_darkness,1.5beak_jut); % lower arm and beak
385 if serifs: dish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif
386 dish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi % lower serif
387 math_fit(0,.5ic#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
388
389 cmchar "The letter X";
390 beginchar("X",13u#,cap_height#,0);
391 italcorr cap_height#*slant-.25u#;
392 adjust_fit(cap_serif_fit#,cap_serif_fit#);
393 numeric stem[],outer_jut,xjut,alpha[];
394 stem1=cap_stem-2stem_corr; stem2=min(cap_hair,stem1);
395 outer_jut=.75cap_jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi;
396 x1l=l+letter_fit+.5u+outer_jut; x2r=r-letter_fit-u-outer_jut-xjut;
397 x3l=l+letter_fit+.25u+outer_jut+xjut; x4r=r-letter_fit-.25u-outer_jut;
398 y1=y2=h; y3=y4=0;
399 alpha1=diag_ratio(1,stem1,h,x4r-x1l);
400 alpha2=diag_ratio(1,stem2,h,x2r-x3l);
401 penpos1(alpha1*stem1,0); penpos2(alpha2*stem2,0);
402 penpos3(alpha2*stem2,0); penpos4(alpha1*stem1,0);
403 if hefty: z0=whatever[z1,z4]=whatever[z2,z3];
404 x12=x34=x0; y13=y24=y0;
405 z12=whatever[z2l,z3l]; z13=whatever[z2l,z3l];
406 z24=whatever[z2r,z3r]; z34=whatever[z2r,z3r];
407 forsuffixes $=13,24,34: z$'=.1[z$,z0]; endfor
408 fill diag_end(12,1r,.5,1,1l,13')--z13'--diag_end(13',3l,1,.5,3r,34')--z34'
409 --diag_end(34',4l,.5,1,4r,24')--z24'
410 --diag_end(24',2r,1,.5,2l,12)--z12--cycle; % diagonals
411 else: fill diag_end(4r,1r,.5,1,1l,4l)
412 --diag_end(1l,4l,.5,1,4r,1r)--cycle; % left diagonal
413 fill diag_end(2l,3l,.5,1,3r,2r)
414 --diag_end(3r,2r,.5,1,2l,3l)--cycle; fi % right diagonal
415 if serifs: numeric inner_jut[]; pickup tiny.nib;
416 prime_points_inside(1,4); prime_points_inside(2,3);
417 prime_points_inside(3,2); prime_points_inside(4,1);
418 if rt x1'r+cap_jut+.5u+1<=lft x2'l-cap_jut-xjut: inner_jut1=cap_jut;
419 else: rt x1'r+inner_jut1+.5u+1=lft x2'l-inner_jut1-xjut; fi
420 if rt x3'r+cap_jut+.5u+1<=lft x4'l-cap_jut-xjut: inner_jut2=cap_jut;
421 else: rt x3'r+inner_jut2+.5u+1=lft x4'l-inner_jut2-xjut; fi
422 dish_serif(1',4,a,1/3,outer_jut,b,2/3,inner_jut1); % upper left serif
423 dish_serif(4',1,c,2/3,inner_jut2,d,1/3,outer_jut); % lower right serif
424 dish_serif(2',3,e,2/3,inner_jut1+xjut,
425 f,1/2,outer_jut+xjut)(dark); % upper right serif
426 dish_serif(3',2,g,1/2,outer_jut+xjut,
427 h,2/3,inner_jut2+xjut)(dark); fi % lower left serif
428 math_fit(0,.5ic#); penlabels(0,1,2,3,4,12,13,24,34); endchar;
429
430 cmchar "The letter b";
431 beginchar("b",10u#+serif_fit#,asc_height#,0);
432 italcorr .5x_height#*slant+min(.5curve#-u#,-.25u#);
433 adjust_fit(serif_fit#,0);
434 pickup tiny.nib; pos1(stem',0); pos2(stem,0);
435 pos0'(stem',0); pos0(stem,0); z0l=z0'l; x0'=x1; x0=x2;
436 lft x1l=hround(2.5u-.5stem'); top y1=h;
437 numeric edge; edge=rt x2r;
438 pickup fine.nib; pos3(if hefty:thin_join else: hair fi,180);
439 pos4(vair,90); pos5(curve,0);
440 pos6(vair,-90); penpos7(x3l-x3r,-180);
441 rt x3l=1/3[rt x2,edge]; y3=1/8[bar_height,x_height];
442 x4l=w-.5(w-serif_fit)+.5u; top y4r=x_height+oo;
443 rt x5r=hround min(w-1.35u+.5curve,w-.6u); y5=.5x_height;
444 x6l=x4l-.2u; bot y6r=-oo;
445 x7=x3; y7=min(y3,y6+y4-y3+.6vair);
446 (x,y4r)=whatever[z3l,z4l]; x4r:=min(x,.5[x4,x5r]);
447 (x',y6r)=whatever[z7l,z6l]; x6r:=min(x',.5[x6,x5r]);
448 filldraw stroke z3e{up}...pulled_arc.e(4,5)&pulled_arc.e(5,6)...{up}z7e; % bowl
449 y0=ypart(((edge,h)--(edge,0))intersectionpoint(z3l{up}...{right}z4l));
450 y2=ypart(((edge,h)--(edge,0))intersectionpoint(z6l{left}...{up}z7l));
451 pickup tiny.nib; filldraw stroke z1e--z0'e--z0e--z2e; % stem
452 pickup crisp.nib; pos8(hair,0); pos7'(stem,0);
453 z7'=z2; x8l=x7'l; bot y8=0;
454 filldraw stroke z7'e--z8e; % point
455 if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop); fi % upper serif
456 penlabels(0,1,2,3,4,5,6,7,8); endchar;
457
458 cmchar "The letter o";
459 beginchar("o",9u#,x_height#,0);
460 italcorr .7x_height#*slant;
461 adjust_fit(if monospace: .5u#,.5u# else: 0,0 fi);
462 penpos1(vair,90); penpos3(vair',-90);
463 penpos2(curve,180); penpos4(curve,0);
464 x2r=hround max(.5u,1.25u-.5curve);
465 x4r=w-x2r; x1=x3=.5w; y1r=h+vround 1.5oo; y3r=-oo;
466 y2=y4=.5h-vair_corr; y2l:=y4l:=.52h;
467 penstroke pulled_arc.e(1,2) & pulled_arc.e(2,3)
468 & pulled_arc.e(3,4) & pulled_arc.e(4,1) & cycle; % bowl
469 penlabels(1,2,3,4); endchar;
470
471 cmchar "The letter k";
472 beginchar("k",9.5u#,asc_height#,0);
473 italcorr x_height#*slant-.2u#;
474 adjust_fit(serif_fit#,serif_fit#); pickup tiny.nib;
475 numeric right_jut,stem[],alpha[];
476 stem1=max(tiny.breadth,hround(fudged.stem-stem_corr));
477 stem2=max(tiny.breadth,hround(fudged.stem-2stem_corr));
478 stem3=max(tiny.breadth,hround(fudged.hair-4stem_corr));
479 stem4=max(tiny.breadth,hround(fudged.stem-3stem_corr));
480 if serifs: right_jut=.6jut; else: right_jut=.4tiny; fi
481 pos1(stem1,0); pos2(stem2,0); top y1=h; bot y2=0;
482 lft x1l=lft x2l=hround(2.5u-.5stem1);
483 top y3=x_height; rt x3r=hround(r-letter_fit-.7u-right_jut);
484 bot y6=0; rt x6r=hround(r-letter_fit-.3u-right_jut);
485 x4=x11=x1; y4=.7bar_height; y11=y3;
486 alpha1=diag_ratio(1,.5(stem3-tiny),y3-y4,x3r-x4);
487 alpha2=diag_ratio(1,.5(stem4-tiny),y11-y6,x6r-x1);
488 penpos3(alpha1*(stem3-tiny),0); penpos4(whatever,-90);
489 z5=.5[z5l,z5r]; penpos6(alpha2*(stem4-tiny),0);
490 forsuffixes $=l,r: y3'$=x_height; y6'$=0; z4$=z3'$+whatever*(z3-z4);
491 z5$=z6'$+whatever*(z11-z6)=whatever[z3,z4]; endfor
492 z3'r=z3r+penoffset z3-z4 of currentpen+whatever*(z3-z4);
493 % we have also |z3'l=z3l+penoffset z4-z3 of currentpen+whatever*(z3-z4)|;\]
494 z6'r=z6r+penoffset z11-z6 of currentpen+whatever*(z11-z6);
495 z6'l=z6l+penoffset z6-z11 of currentpen+whatever*(z11-z6);
496 fill z4r--diag_end(4r,3'r,1,.5,3'l,4l)--z4l--cycle; % upper diagonal
497 fill z5l--diag_end(5l,6'l,.5,1,6'r,5r)--z5r--cycle; % lower diagonal
498 pos0(stem1,0); pos0'(stem2,0); y0=y0'; x0=x1; x0'=x2;
499 rt z0r=whatever[z3,z4]; filldraw stroke z1e..z0e--z0'e..z2e; % stem
500 if serifs: numeric inner_jut;
501 if rt x2r+jut+.5u+1<=lft x6l-jut: inner_jut=jut;
502 else: rt x2r+inner_jut+.5u+1=lft x6l-inner_jut; fi
503 sloped_serif.l(1,0,a,1/3,jut,serif_drop); % upper stem serif
504 dish_serif(2,0',b,1/3,jut,c,1/3,inner_jut); % lower stem serif
505 dish_serif(3,4,d,2/3,1.4jut,e,1/2,right_jut)(dark); % upper diagonal serif
506 dish_serif(6,5,f,1/2,inner_jut,g,1/3,right_jut)(dark);fi % lower diagonal serif
507 penlabels(0,1,2,3,4,5,6,11); endchar;
508
509 message "Typewriter type variant g"; % 9pt
510 u#:=18.9/36pt#; % unit width
511 width_adj#:=0pt#; % width adjustment for certain characters
512 serif_fit#:=0pt#; % extra sidebar near lowercase serifs
513 cap_serif_fit#:=0pt#; % extra sidebar near uppercase serifs
514 letter_fit#:=0pt#; % extra space added to all sidebars
515
516 body_height#:=225/36pt#; % height of tallest characters
517 asc_height#:=198/36pt#; % height of lowercase ascenders
518 cap_height#:=198/36pt#; % height of caps
519 fig_height#:=198/36pt#; % height of numerals
520 x_height#:=139.5/36pt#; % height of lowercase without ascenders
521 math_axis#:=99/36pt#; % axis of symmetry for math symbols
522 bar_height#:=71/36pt#; % height of crossbar in lowercase e
523 comma_depth#:=45/36pt#; % depth of comma below baseline
524 desc_depth#:=72/36pt#; % depth of lowercase descenders
525
526 crisp#:=21/36pt#; % diameter of serif corners
527 tiny#:=21/36pt#; % diameter of rounded corners
528 fine#:=20/36pt#; % diameter of sharply rounded corners
529 thin_join#:=20/36pt#; % width of extrafine details
530 hair#:=24/36pt#; % lowercase hairline breadth
531 stem#:=24/36pt#; % lowercase stem breadth
532 curve#:=24/36pt#; % lowercase curve breadth
533 ess#:=21/36pt#; % breadth in middle of lowercase s
534 flare#:=30/36pt#; % diameter of bulbs or breadth of terminals
535 dot_size#:=33/36pt#; % diameter of dots
536 cap_hair#:=24/36pt#; % uppercase hairline breadth
537 cap_stem#:=24/36pt#; % uppercase stem breadth
538 cap_curve#:=24/36pt#; % uppercase curve breadth
539 cap_ess#:=24/36pt#; % breadth in middle of uppercase s
540 rule_thickness#:=24/36pt#; % thickness of lines in math symbols
541
542 dish#:=0pt#; % amount erased at top or bottom of serifs
543 bracket#:=0pt#; % vertical distance from serif base to tangent
544 jut#:=31/36pt#; % protrusion of lowercase serifs
545 cap_jut#:=31/36pt#; % protrusion of uppercase serifs
546 beak_jut#:=0pt#; % horizontal protrusion of beak serifs
547 beak#:=31/36pt#; % vertical protrusion of beak serifs
548 vair#:=21/36pt#; % vertical diameter of hairlines
549 notch_cut#:=24/36pt#; % maximum breadth above or below notches
550 bar#:=21/36pt#; % lowercase bar thickness
551 slab#:=21/36pt#; % serif and arm thickness
552 cap_bar#:=21/36pt#; % uppercase bar thickness
553 cap_band#:=21/36pt#; % uppercase thickness above/below lobes
554 cap_notch_cut#:=24/36pt#; % max breadth above/below uppercase notches
555 serif_drop#:=0pt#; % vertical drop of sloped serifs
556 stem_corr#:=0pt#; % for small refinements of stem breadth
557 vair_corr#:=0pt#; % for small refinements of hairline height
558 apex_corr#:=9/36pt#; % extra width at diagonal junctions
559
560 o#:=3.5/36pt#; % amount of overshoot for curves
561 apex_o#:=3/36pt#; % amount of overshoot for diagonal junctions
562
563 slant:=0; % tilt ratio $(\Delta x/\Delta y)$
564 fudge:=0.81; % factor applied to weights of heavy characters
565 math_spread:=-1; % extra openness of math symbols
566 superness:=1/sqrt2; % parameter for superellipses
567 superpull:=0; % extra openness inside bowls
568 beak_darkness:=0; % fraction of triangle inside beak serifs
569 ligs:=0; % level of ligatures to be included
570
571 square_dots:=false; % should dots be square?
572 hefty:=true; % should we try hard not to be overweight?
573 serifs:=true; % should serifs and bulbs be attached?
574 monospace:=true; % should all characters have the same width?
575 variant_g:=false; % should an italic-style g be used?
576 low_asterisk:=true; % should the asterisk be centered at the axis?
577 math_fitting:=false; % should math-mode spacing be used?
578
579 font_setup;
580
581 cmchar "Variant letter g";
582 beginchar("x",10u#+serif_fit#,x_height#,desc_depth#);
583 italcorr x_height#*slant-serif_fit#+.5stem#-2u# if serifs:+.5u# fi;
584 adjust_fit(0,serif_fit# if serifs: -.5u# fi);
585 pickup tiny.nib; pos1(stem',0); pos2(stem,0);
586 pos0'(stem',0); pos0(stem,0); z0r=z0'r; x0'=x1; x0=x2;
587 rt x1r=hround(w-2.5u+.5stem');
588 numeric edge; edge=lft x2l;
589 path edge_path; edge_path=(edge,h)--(edge,0);
590 pickup fine.nib; pos3(if hefty:thin_join else: hair fi,0);
591 pos4(vair,90); pos5(curve,180); pos6(vair,270); penpos7(x3r-x3l,360);
592 lft x3l=min(lft x3l-(rt x3r-tiny.rt x2r),2/3[lft x2,edge]); y3=bar_height;
593 x4l=.5(w-serif_fit)-.3u; top y4r=x_height+oo;
594 lft x5r=hround max(1.35u-.5curve,.6u); y5=.5x_height;
595 x6l=x4l-.2u; bot y6r=vround 1/3vair;
596 lft x7l=edge; y7=min(y3,y6+y4-y3+.6vair);
597 (x,y4r)=whatever[z3l,z4l]; x4r:=max(x,.5[x5r,x4]);
598 (x',y6r)=whatever[z7l,z6l]; x6r:=max(x',.5[x5r,x6]);
599 filldraw stroke z3e{up}...{left}z4e&super_arc.e(4,5)
600 &super_arc.e(5,6)&z6e{right}...{up}z7e; % bowl
601 y1=ypart(edge_path intersectionpoint(z3l{up}...{left}z4l));
602 y0=ypart(edge_path intersectionpoint(z7l{down}...{left}z6l));
603 pickup tiny.nib; bot y2=if serifs: -.25d else: 0 fi;
604 filldraw stroke z1e--z0'e--z0e--z2e; % stem
605 pickup crisp.nib;
606 pos8(hround(hair-stem_corr),0); pos7'(stem',0);
607 z7'=z1; x8r=x7'r; top y8=h+oo;
608 filldraw stroke z7'e--z8e; % point
609 if serifs: pickup tiny.nib;
610 pos9(vair,-90); x9=.5[x2,x10]; bot y9r=-d-o-1;
611 pos10(hair,-180); lft x10r=hround u; y10=-.75d+.5flare;
612 pos11(flare,-180); z11r=z10r;
613 bulb(9,10,11); filldraw stroke super_arc.e(2,9); % tail
614 else: pickup fine.nib; pos2'(stem,0); z2'=z2;
615 z2''r=z2'r; z2''=z2'; z2''l=(x2'l,0);
616 pos9(vair,-90); x9=4.5u; bot y9r=-d-o-1;
617 pos10(.5[vair,flare],-90); lft x10=hround 1.25u;
618 y10r=good.y -5/6d; y10l:=good.y y10l;
619 filldraw stroke z2'e..z2''e&super_arc.e(2'',9)
620 & term.e(9,10,left,.9,4); fi % tail
621 penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;
622
623 message "Normal roman variant g"; % 10pt
624
625 u#:=20/36pt#; % unit width
626 width_adj#:=0pt#; % width adjustment for certain characters
627 serif_fit#:=0pt#; % extra sidebar near lowercase serifs
628 cap_serif_fit#:=5/36pt#; % extra sidebar near uppercase serifs
629 letter_fit#:=0pt#; % extra space added to all sidebars
630
631 body_height#:=270/36pt#; % height of tallest characters
632 asc_height#:=250/36pt#; % height of lowercase ascenders
633 cap_height#:=246/36pt#; % height of caps
634 fig_height#:=232/36pt#; % height of numerals
635 x_height#:=155/36pt#; % height of lowercase without ascenders
636 math_axis#:=90/36pt#; % axis of symmetry for math symbols
637 bar_height#:=87/36pt#; % height of crossbar in lowercase e
638 comma_depth#:=70/36pt#; % depth of comma below baseline
639 desc_depth#:=70/36pt#; % depth of lowercase descenders
640
641 crisp#:=0pt#; % diameter of serif corners
642 tiny#:=8/36pt#; % diameter of rounded corners
643 fine#:=7/36pt#; % diameter of sharply rounded corners
644 thin_join#:=7/36pt#; % width of extrafine details
645 hair#:=9/36pt#; % lowercase hairline breadth
646 stem#:=25/36pt#; % lowercase stem breadth
647 curve#:=30/36pt#; % lowercase curve breadth
648 ess#:=27/36pt#; % breadth in middle of lowercase s
649 flare#:=33/36pt#; % diameter of bulbs or breadth of terminals
650 dot_size#:=38/36pt#; % diameter of dots
651 cap_hair#:=11/36pt#; % uppercase hairline breadth
652 cap_stem#:=32/36pt#; % uppercase stem breadth
653 cap_curve#:=37/36pt#; % uppercase curve breadth
654 cap_ess#:=35/36pt#; % breadth in middle of uppercase s
655 rule_thickness#:=.4pt#; % thickness of lines in math symbols
656
657 dish#:=1/36pt#; % amount erased at top or bottom of serifs
658 bracket#:=20/36pt#; % vertical distance from serif base to tangent
659 jut#:=28/36pt#; % protrusion of lowercase serifs
660 cap_jut#:=37/36pt#; % protrusion of uppercase serifs
661 beak_jut#:=10/36pt#; % horizontal protrusion of beak serifs
662 beak#:=70/36pt#; % vertical protrusion of beak serifs
663 vair#:=8/36pt#; % vertical diameter of hairlines
664 notch_cut#:=10pt#; % maximum breadth above or below notches
665 bar#:=11/36pt#; % lowercase bar thickness
666 slab#:=11/36pt#; % serif and arm thickness
667 cap_bar#:=11/36pt#; % uppercase bar thickness
668 cap_band#:=11/36pt#; % uppercase thickness above/below lobes
669 cap_notch_cut#:=10pt#; % max breadth above/below uppercase notches
670 serif_drop#:=4/36pt#; % vertical drop of sloped serifs
671 stem_corr#:=1/36pt#; % for small refinements of stem breadth
672 vair_corr#:=1/36pt#; % for small refinements of hairline height
673 apex_corr#:=0pt#; % extra width at diagonal junctions
674
675 o#:=8/36pt#; % amount of overshoot for curves
676 apex_o#:=8/36pt#; % amount of overshoot for diagonal junctions
677
678 slant:=0; % tilt ratio $(\Delta x/\Delta y)$
679 fudge:=1; % factor applied to weights of heavy characters
680 math_spread:=0; % extra openness of math symbols
681 superness:=1/sqrt2; % parameter for superellipses
682 superpull:=1/6; % extra openness inside bowls
683 beak_darkness:=11/30; % fraction of triangle inside beak serifs
684 ligs:=2; % level of ligatures to be included
685
686 square_dots:=false; % should dots be square?
687 hefty:=false; % should we try hard not to be overweight?
688 serifs:=true; % should serifs and bulbs be attached?
689 monospace:=false; % should all characters have the same width?
690 variant_g:=false; % should an italic-style g be used?
691 low_asterisk:=false; % should the asterisk be centered at the axis?
692 math_fitting:=false; % should math-mode spacing be used?
693
694 font_setup;
695
696 cmchar "Variant letter g";
697 beginchar("y",10u#+serif_fit#,x_height#,desc_depth#);
698 italcorr x_height#*slant-serif_fit#+.5stem#-2u# if serifs:+.5u# fi;
699 adjust_fit(0,serif_fit# if serifs: -.5u# fi);
700 pickup tiny.nib; pos1(stem',0); pos2(stem,0);
701 pos0'(stem',0); pos0(stem,0); z0r=z0'r; x0'=x1; x0=x2;
702 rt x1r=hround(w-2.5u+.5stem');
703 numeric edge; edge=lft x2l;
704 path edge_path; edge_path=(edge,h)--(edge,0);
705 pickup fine.nib; pos3(if hefty:thin_join else: hair fi,0);
706 pos4(vair,90); pos5(curve,180); pos6(vair,270); penpos7(x3r-x3l,360);
707 lft x3l=min(lft x3l-(rt x3r-tiny.rt x2r),2/3[lft x2,edge]); y3=bar_height;
708 x4l=.5(w-serif_fit)-.3u; top y4r=x_height+oo;
709 lft x5r=hround max(1.35u-.5curve,.6u); y5=.5x_height;
710 x6l=x4l-.2u; bot y6r=vround 1/3vair;
711 lft x7l=edge; y7=min(y3,y6+y4-y3+.6vair);
712 (x,y4r)=whatever[z3l,z4l]; x4r:=max(x,.5[x5r,x4]);
713 (x',y6r)=whatever[z7l,z6l]; x6r:=max(x',.5[x5r,x6]);
714 filldraw stroke z3e{up}...{left}z4e&super_arc.e(4,5)
715 &super_arc.e(5,6)&z6e{right}...{up}z7e; % bowl
716 y1=ypart(edge_path intersectionpoint(z3l{up}...{left}z4l));
717 y0=ypart(edge_path intersectionpoint(z7l{down}...{left}z6l));
718 pickup tiny.nib; bot y2=if serifs: -.25d else: 0 fi;
719 filldraw stroke z1e--z0'e--z0e--z2e; % stem
720 pickup crisp.nib;
721 pos8(hround(hair-stem_corr),0); pos7'(stem',0);
722 z7'=z1; x8r=x7'r; top y8=h+oo;
723 filldraw stroke z7'e--z8e; % point
724 if serifs: pickup tiny.nib;
725 pos9(vair,-90); x9=.5[x2,x10]; bot y9r=-d-o-1;
726 pos10(hair,-180); lft x10r=hround u; y10=-.75d+.5flare;
727 pos11(flare,-180); z11r=z10r;
728 bulb(9,10,11); filldraw stroke super_arc.e(2,9); % tail
729 else: pickup fine.nib; pos2'(stem,0); z2'=z2;
730 z2''r=z2'r; z2''=z2'; z2''l=(x2'l,0);
731 pos9(vair,-90); x9=4.5u; bot y9r=-d-o-1;
732 pos10(.5[vair,flare],-90); lft x10=hround 1.25u;
733 y10r=good.y -5/6d; y10l:=good.y y10l;
734 filldraw stroke z2'e..z2''e&super_arc.e(2'',9)
735 & term.e(9,10,left,.9,4); fi % tail
736 penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;
737
738 message "Bold roman variant g"; % 9pt
739
740 u#:=21.3/36pt#; % unit width
741 width_adj#:=10.2/36pt#; % width adjustment for certain characters
742 serif_fit#:=0pt#; % extra sidebar near lowercase serifs
743 cap_serif_fit#:=6.2/36pt#; % extra sidebar near uppercase serifs
744 letter_fit#:=0pt#; % extra space added to all sidebars
745
746 body_height#:=243/36pt#; % height of tallest characters
747 asc_height#:=225/36pt#; % height of lowercase ascenders
748 cap_height#:=222.3/36pt#; % height of caps
749 fig_height#:=208.8/36pt#; % height of numerals
750 x_height#:=144/36pt#; % height of lowercase without ascenders
751 math_axis#:=81/36pt#; % axis of symmetry for math symbols
752 bar_height#:=76/36pt#; % height of crossbar in lowercase e
753 comma_depth#:=63/36pt#; % depth of comma below baseline
754 desc_depth#:=63/36pt#; % depth of lowercase descenders
755
756 crisp#:=0pt#; % diameter of serif corners
757 tiny#:=13/36pt#; % diameter of rounded corners
758 fine#:=10/36pt#; % diameter of sharply rounded corners
759 thin_join#:=10/36pt#; % width of extrafine details
760 hair#:=16.6/36pt#; % lowercase hairline breadth
761 stem#:=38/36pt#; % lowercase stem breadth
762 curve#:=43/36pt#; % lowercase curve breadth
763 ess#:=35/36pt#; % breadth in middle of lowercase s
764 flare#:=42/36pt#; % diameter of bulbs or breadth of terminals
765 dot_size#:=51/36pt#; % diameter of dots
766 cap_hair#:=19/36pt#; % uppercase hairline breadth
767 cap_stem#:=47/36pt#; % uppercase stem breadth
768 cap_curve#:=51/36pt#; % uppercase curve breadth
769 cap_ess#:=48/36pt#; % breadth in middle of uppercase s
770 rule_thickness#:=.57pt#; % thickness of lines in math symbols
771
772 dish#:=1/36pt#; % amount erased at top or bottom of serifs
773 bracket#:=9/36pt#; % vertical distance from serif base to tangent
774 jut#:=22/36pt#; % protrusion of lowercase serifs
775 cap_jut#:=35/36pt#; % protrusion of uppercase serifs
776 beak_jut#:=10.2/36pt#; % horizontal protrusion of beak serifs
777 beak#:=63/36pt#; % vertical protrusion of beak serifs
778 vair#:=12.5/36pt#; % vertical diameter of hairlines
779 notch_cut#:=9pt#; % maximum breadth above or below notches
780 bar#:=16/36pt#; % lowercase bar thickness
781 slab#:=16/36pt#; % serif and arm thickness
782 cap_bar#:=16/36pt#; % uppercase bar thickness
783 cap_band#:=16/36pt#; % uppercase thickness above/below lobes
784 cap_notch_cut#:=9pt#; % max breadth above/below uppercase notches
785 serif_drop#:=2.7/36pt#; % vertical drop of sloped serifs
786 stem_corr#:=1.9/36pt#; % for small refinements of stem breadth
787 vair_corr#:=1.4/36pt#; % for small refinements of hairline height
788 apex_corr#:=0pt#; % extra width at diagonal junctions
789
790 o#:=4/36pt#; % amount of overshoot for curves
791 apex_o#:=3/36pt#; % amount of overshoot for diagonal junctions
792
793 slant:=0; % tilt ratio $(\Delta x/\Delta y)$
794 fudge:=1; % factor applied to weights of heavy characters
795 math_spread:=.7; % extra openness of math symbols
796 superness:=8/11; % parameter for superellipses
797 superpull:=1/8; % extra openness inside bowls
798 beak_darkness:=.4; % fraction of triangle inside beak serifs
799 ligs:=2; % level of ligatures to be included
800
801 square_dots:=false; % should dots be square?
802 hefty:=false; % should we try hard not to be overweight?
803 serifs:=true; % should serifs and bulbs be attached?
804 monospace:=false; % should all characters have the same width?
805 variant_g:=false; % should an italic-style g be used?
806 low_asterisk:=false; % should the asterisk be centered at the axis?
807 math_fitting:=false; % should math-mode spacing be used?
808
809 font_setup;
810
811 cmchar "Variant letter g";
812 beginchar("z",10u#+serif_fit#,x_height#,desc_depth#);
813 italcorr x_height#*slant-serif_fit#+.5stem#-2u# if serifs:+.5u# fi;
814 adjust_fit(0,serif_fit# if serifs: -.5u# fi);
815 pickup tiny.nib; pos1(stem',0); pos2(stem,0);
816 pos0'(stem',0); pos0(stem,0); z0r=z0'r; x0'=x1; x0=x2;
817 rt x1r=hround(w-2.5u+.5stem');
818 numeric edge; edge=lft x2l;
819 path edge_path; edge_path=(edge,h)--(edge,0);
820 pickup fine.nib; pos3(if hefty:thin_join else: hair fi,0);
821 pos4(vair,90); pos5(curve,180); pos6(vair,270); penpos7(x3r-x3l,360);
822 lft x3l=min(lft x3l-(rt x3r-tiny.rt x2r),2/3[lft x2,edge]); y3=bar_height;
823 x4l=.5(w-serif_fit)-.3u; top y4r=x_height+oo;
824 lft x5r=hround max(1.35u-.5curve,.6u); y5=.5x_height;
825 x6l=x4l-.2u; bot y6r=vround 1/3vair;
826 lft x7l=edge; y7=min(y3,y6+y4-y3+.6vair);
827 (x,y4r)=whatever[z3l,z4l]; x4r:=max(x,.5[x5r,x4]);
828 (x',y6r)=whatever[z7l,z6l]; x6r:=max(x',.5[x5r,x6]);
829 filldraw stroke z3e{up}...{left}z4e&super_arc.e(4,5)
830 &super_arc.e(5,6)&z6e{right}...{up}z7e; % bowl
831 y1=ypart(edge_path intersectionpoint(z3l{up}...{left}z4l));
832 y0=ypart(edge_path intersectionpoint(z7l{down}...{left}z6l));
833 pickup tiny.nib; bot y2=if serifs: -.25d else: 0 fi;
834 filldraw stroke z1e--z0'e--z0e--z2e; % stem
835 pickup crisp.nib;
836 pos8(hround(hair-stem_corr),0); pos7'(stem',0);
837 z7'=z1; x8r=x7'r; top y8=h+oo;
838 filldraw stroke z7'e--z8e; % point
839 if serifs: pickup tiny.nib;
840 pos9(vair,-90); x9=.5[x2,x10]; bot y9r=-d-o-1;
841 pos10(hair,-180); lft x10r=hround u; y10=-.75d+.5flare;
842 pos11(flare,-180); z11r=z10r;
843 bulb(9,10,11); filldraw stroke super_arc.e(2,9); % tail
844 else: pickup fine.nib; pos2'(stem,0); z2'=z2;
845 z2''r=z2'r; z2''=z2'; z2''l=(x2'l,0);
846 pos9(vair,-90); x9=4.5u; bot y9r=-d-o-1;
847 pos10(.5[vair,flare],-90); lft x10=hround 1.25u;
848 y10r=good.y -5/6d; y10l:=good.y y10l;
849 filldraw stroke z2'e..z2''e&super_arc.e(2'',9)
850 & term.e(9,10,left,.9,4); fi % tail
851 penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;
852
853 font_identifier "CMMAN"; % restore the clobbered value
854
855 bye