Debian Codegraph @

texmf-dist/fonts/source/public/knuth-local/mfman.mf

raw
1 % This file generates most of the figures for The METAFONTbook
2
3 lcode_:=" /"; % suppress overflow labels
4 grayfont black;
5
6 def clear_all = clearit; clearxy; pickup standardpen;
7 proofrulethickness 0;
8 enddef;
9
10 def heavy_dot expr z =
11 makelabel.top("",z-(1,0));
12 makelabel.top("",z+(1,0));
13 makelabel.top("",z-(0,1));
14 makelabel.top("",z+(0,1));
15 makelabel.top("",z+(1,1)/sqrt2);
16 makelabel.top("",z+(1,-1)/sqrt2);
17 makelabel.top("",z-(1,1)/sqrt2);
18 makelabel.top("",z-(1,-1)/sqrt2);
19 enddef;
20
21 def font_setup=
22 define_pixels(u,tiny,axis,hheight,border);
23 define_blacker_pixels(hair,thin,thick,rulethickness);
24 pickup if tiny<.5: nullpen else: pencircle scaled tiny fi;
25 tinypen:=savepen;
26 currenttransform:=identity slanted slant yscaled aspect_ratio;
27 enddef;
28
29 mode=proof; mode_setup;
30 standardpen=savepen;
31
32 "Figure 2a"; % 6 points and a grid
33 clear_all;
34 pair offset; offset=(.5,.5);
35 z1=(0,100)+offset;
36 z2=(100,100)+offset;
37 z3=(200,100)+offset;
38 z4=(0,0)+offset;
39 z5=(100,0)+offset;
40 z6=(200,0)+offset;
41 proofrulethickness .8;
42 proofrule (z1+(0,5),z4-(0,5)); proofrule (z4-(5,0),z6+(5,0));
43 makelabel.top("1 ",z1);
44 makelabel.top("2 ",z2);
45 makelabel.top("3 ",z3);
46 makelabel.bot("4 ",z4);
47 makelabel.bot("5 ",z5);
48 makelabel.bot("6 ",z6);
49 for k=1 upto 6: heavy_dot z[k]; endfor;
50 pickup pencircle;
51 for x=10 step 10 until 200: draw (x,-5)+offset..(x,105)+offset; endfor
52 for y=10 step 10 until 100: draw (-5,y)+offset..(205,y)+offset; endfor
53 showit;
54 shipit;
55
56 "Figure A2a"; % 6 points and a grid and two more points
57 clear_all;
58 proofoffset(30,0);
59 pair offset; offset=(.5,.5);
60 z1=(0,100)+offset;
61 z2=(100,100)+offset;
62 z3=(200,100)+offset;
63 z4=(0,0)+offset;
64 z5=(100,0)+offset;
65 z6=(200,0)+offset;
66 proofrulethickness .8;
67 proofrule (z1+(0,5),z4-(0,5)); proofrule (z4-(5,0),z6+(5,0));
68 makelabel.top("1 ",z1);
69 makelabel.top("2 ",z2);
70 makelabel.top("3 ",z3);
71 makelabel.bot("4 ",z4);
72 makelabel.bot("5 ",z5);
73 makelabel.bot("6 ",z6);
74 for k=1 upto 6: heavy_dot z[k]; endfor;
75 makelabel.lft("(-5,15)",(-5,15)+offset);
76 makelabel.top("(60,30) ",(60,30)+offset);
77 %makelabel.top(" ,30) ",(60,30)+offset);
78 %makelabel.top("(60 ",(60,30)+offset);
79 heavy_dot (-5,15)+offset;
80 heavy_dot (60,30)+offset;
81 pickup pencircle;
82 for x=10 step 10 until 200: draw (x,-5)+offset..(x,105)+offset; endfor
83 for y=10 step 10 until 100: draw (-5,y)+offset..(205,y)+offset; endfor
84 showit;
85 shipit;
86
87 "Figure 2b"; % 6 points and a line
88 clear_all;
89 z1=(0,100);
90 z2=(100,100);
91 z3=(200,100);
92 z4=(0,0);
93 z5=(100,0);
94 z6=(200,0);
95 draw (x1-epsilon,y1)..(x6,y6);
96 makelabel.lft("1 ",z1);
97 makelabel.lft("2",z2);
98 makelabel.rt("3",z3);
99 makelabel.lft("4",z4);
100 makelabel.lft("5",z5);
101 makelabel.rt(" 6",z6);
102 showit;
103 shipit;
104
105 "Figure 2c"; % 6 points and three lines (hex symbol, version 1)
106 clear_all;
107 z1=(0,100);
108 z2=(100,100);
109 z3=(200,100);
110 z4=(0,0);
111 z5=(100,0);
112 z6=(200,0);
113 draw z1..z6; draw z2..z5; draw z3..z4;
114 for k=1 upto 6: drawdot z[k]; endfor
115 makelabel.lft("1 ",z1);
116 makelabel.lft("2 ",z2);
117 makelabel.rt(" 3",z3);
118 makelabel.lft("4 ",z4);
119 makelabel.lft("5 ",z5);
120 makelabel.rt(" 6",z6);
121 showit;
122 shipit;
123
124 "Figure 2d"; % hex symbols with top and bottom adjusted
125 clear_all;
126 top z1=(0,100);
127 top z2=(100,100);
128 top z3=(200,100);
129 bot z4=(0,0);
130 bot z5=(100,0);
131 bot z6=(200,0);
132 draw z1..z6; draw z2..z5; draw z3..z4;
133 for k=1 upto 6: drawdot z[k]; endfor
134 makelabel.lft("1 ",z1);
135 makelabel.lft("2 ",z2);
136 makelabel.rt(" 3",z3);
137 makelabel.lft("4 ",z4);
138 makelabel.lft("5 ",z5);
139 makelabel.rt(" 6",z6);
140 showit;
141 clearxy; pair offset; offset=(250,0);
142 pickup pencircle scaled .6pt;
143 top z1=(0,100)+offset;
144 top z2=(100,100)+offset;
145 top z3=(200,100)+offset;
146 bot z4=(0,0)+offset;
147 bot z5=(100,0)+offset;
148 bot z6=(200,0)+offset;
149 draw z1..z6; draw z2..z5; draw z3..z4;
150 for k=1 upto 6: drawdot z[k]; endfor
151 makelabel.lft("1 ",z1);
152 makelabel.lft("2 ",z2);
153 makelabel.rt(" 3",z3);
154 makelabel.lft("4 ",z4);
155 makelabel.lft("5 ",z5);
156 makelabel.rt(" 6",z6);
157 proofrule ((-5,100),(210,100)+offset);
158 proofrule ((-5,0),(210,0)+offset);
159 showit;
160 shipit;
161
162 "Figure 2e"; % stick-letter A
163 b#:=250/36pt#; a#:=150/36pt#; s#:=30/36pt#;
164 define_pixels(b,a,s);
165 def A(expr alpha)=
166 beginchar (incr(charcode),s#+a#+s#,b#,0);
167 pickup standardpen;
168 bot z1=(good.x s,0); z5=z1+(a,0);
169 z3=(1/2[x1,x5],good.y b);
170 z2=alpha[z1,z3]; z4=alpha[z5,z3];
171 draw z1..z3; draw z3..z5; draw z2..z4;
172 drawdot z1; drawdot z5; drawdot z3;
173 makelabel.lft("1 ",z1);
174 makelabel.lft("2 ",z2);
175 makelabel.top("3 ",z3);
176 makelabel.rt(" 4",z4);
177 makelabel.rt(" 5",z5);
178 endchar; enddef;
179
180 A((3-sqrt5)/2); % (area above bar / area below) = golden ratio
181
182 "Figure 3a"; % 4 points and 3 midpoints
183 clear_all;
184 z1=(.5,.5); z2=(40.5,80.5); z3=(150.5,100.5); z4=(300.5,.5);
185 z12=1/2[z1,z2]; z23=1/2[z2,z3]; z34=1/2[z3,z4];
186 pickup pencircle;
187 draw z1--z2--z3--z4;
188 heavy_dot z1; heavy_dot z2; heavy_dot z3; heavy_dot z4;
189 makelabel.lft("1",z1);
190 makelabel.lft("2",z2);
191 makelabel.top(" 3",z3);
192 makelabel.rt("4",z4);
193 makelabel.rt("12",z12);
194 makelabel.bot(" 23",z23);
195 makelabel.bot("34 ",z34);
196 showit;
197 shipit;
198
199 "Figure 3b"; % 4 points and 6 midpoints
200 clear_all;
201 z1=(.5,.5); z2=(40.5,80.5); z3=(150.5,100.5); z4=(300.5,.5);
202 z12=1/2[z1,z2]; z23=1/2[z2,z3]; z34=1/2[z3,z4];
203 z123=1/2[z12,z23]; z234=1/2[z23,z34]; z1234=1/2[z123,z234];
204 heavy_dot z1; heavy_dot z2; heavy_dot z3; heavy_dot z4;
205 pickup pencircle;
206 draw z1--z2--z3--z4; draw z12--z23--z34; draw z123--z234;
207 makelabel.lft("1",z1);
208 makelabel.lft("2",z2);
209 makelabel.top(" 3",z3);
210 makelabel.rt("4",z4);
211 makelabel.lft("12",z12);
212 makelabel.top("23 ",z23);
213 makelabel.rt("34",z34);
214 makelabel.bot(" 123",z123);
215 makelabel.bot("234 ",z234);
216 makelabel.bot("1234",z1234);
217 showit;
218 shipit;
219
220 "Figure 3c"; % 4 points and infinitely many midpoints
221 clear_all;
222 z1=(.5,.5); z2=(40.5,80.5); z3=(150.5,100.5); z4=(300.5,.5);
223 heavy_dot z1; heavy_dot z2; heavy_dot z3; heavy_dot z4;
224 pickup pencircle;
225
226 def makedot(expr x)= special " 1";
227 numspecial xpart x; numspecial ypart x enddef;
228
229 def recurse(expr a,b,c,d)=
230 dist:=abs(a-d);
231 if dist>4:
232 begingroup save e,f,g,h,i,j; pair e,f,g,h,i,j;
233 e=(a+b)/2; makedot(e);
234 f=(b+c)/2; makedot(f);
235 g=(c+d)/2; makedot(g);
236 h=(e+f)/2; makedot(h);
237 i=(f+g)/2; makedot(i);
238 j=(h+i)/2; makedot(j);
239 if dist>20: draw a--b--c--d; draw e--f--g; draw h--i; fi
240 recurse(a,e,h,j); recurse(j,i,g,d);
241 endgroup;
242 fi enddef;
243
244 makedot(z1); makedot(z2); makedot(z3); makedot(z4); recurse(z1,z2,z3,z4);
245 makelabel.bot.nodot("ignore",(160,-10)); % kludge for GFtoEPS!
246 shipit;
247
248 "Figure 3d"; % 4 points and various cubics
249 clear_all;
250 z1=(0,0); z2=5/6(40,80); z3=5/6(150,100); z4=5/6(300,0);
251 draw z1..controls z2 and z3..z4;
252 drawdot z1; drawdot z4;
253 makelabel.lft("1 ",z1);
254 makelabel.lft("2",z2);
255 makelabel.rt("3",z3);
256 makelabel.rt(" 4",z4);
257 pair offset; offset:=(325,0);
258 draw (z1..controls z3 and z2..z4) shifted offset;
259 drawdot z1+offset; drawdot z4+offset;
260 makelabel.lft("1 ",z1+offset);
261 makelabel.lft("3",z2+offset);
262 makelabel.rt("2",z3+offset);
263 makelabel.rt(" 4",z4+offset);
264 offset:=(0,-100);
265 draw (z2..controls z1 and z3..z4) shifted offset;
266 drawdot z2+offset; drawdot z4+offset;
267 makelabel.lft("2",z1+offset);
268 makelabel.lft("1 ",z2+offset);
269 makelabel.rt("3",z3+offset);
270 makelabel.rt(" 4",z4+offset);
271 offset:=(325,-100);
272 draw (z1..controls z4 and z2..z3) shifted offset;
273 drawdot z1+offset; drawdot z3+offset;
274 makelabel.lft("1 ",z1+offset);
275 makelabel.lft("3",z2+offset);
276 makelabel.rt(" 4",z3+offset);
277 makelabel.rt("2",z4+offset);
278 showit;
279 shipit;
280
281 "Figure 3e"; % example curves with automatic control points
282 clear_all;
283 z1=(0,100); z2=(100,100); z3=(200,100);
284 z4=(0,0); z5=(100,0); z6=(200,0);
285 path p; p=z4..z1..z2..z6;
286 draw p;
287 drawdot z4; drawdot z6;
288 makelabel.bot.nodot(" 1",z1);
289 makelabel.top.nodot(" 2",z2);
290 makelabel.rt.nodot("3",z3+(2,0));
291 makelabel.rt.nodot(" 4",z4);
292 makelabel.rt.nodot("5",z5+(2,0));
293 makelabel.rt.nodot(" 6",z6);
294 for k=1 upto 6: heavy_dot z[k]; endfor;
295 for k=1 upto length p: heavy_dot postcontrol k-1 of p;
296 heavy_dot precontrol k of p; endfor
297 pair offset; offset=(325,0);
298 p:=(z5..z4..z1..z3..z6..z5) shifted offset; draw p;
299 drawdot z5+offset;
300 makelabel.bot.nodot(" 1",z1+offset);
301 makelabel.top.nodot("2",z2+offset+(0,2));
302 makelabel.bot.nodot("3 ",z3+offset);
303 makelabel.top.nodot(" 4",z4+offset);
304 makelabel.top.nodot("5",z5+offset+(0,5));
305 makelabel.top.nodot("6 ",z6+offset);
306 for k=1 upto 6: heavy_dot z[k]+offset; endfor;
307 for k=1 upto length p: heavy_dot postcontrol k-1 of p;
308 heavy_dot precontrol k of p; endfor
309 showit;
310 shipit;
311
312 "Figure 3f"; % bean shape with automatic control points
313 clear_all;
314 z1=(0,100); z2=(100,100); z3=(200,100);
315 z4=(0,0); z5=(100,0); z6=(200,0);
316 path p; p=z5..z4..z1..z3..z6..cycle;
317 draw p;
318 makelabel.bot.nodot(" 1",z1);
319 makelabel.bot.nodot("2",z2-(0,2));
320 makelabel.bot.nodot("3 ",z3);
321 makelabel.top.nodot(" 4",z4+(-1,1));
322 makelabel.top.nodot("5",z5+(0,5));
323 makelabel.top.nodot("6 ",z6+(1,1));
324 for k=1 upto 6: heavy_dot z[k]; endfor;
325 for k=1 upto length p: heavy_dot postcontrol k-1 of p;
326 heavy_dot precontrol k of p; endfor
327 showit;
328 shipit;
329
330 "Figure 3g"; % bean shape with more tension between 1 and 3
331 clear_all;
332 z1=(0,100); z2=(100,100); z3=(200,100);
333 z4=(0,0); z5=(100,0); z6=(200,0);
334 path p; p=z5..z4..z1..tension1.2..z3..z6..cycle;
335 draw p;
336 makelabel.bot.nodot(" 1",z1);
337 makelabel.bot.nodot("2",z2-(0,2));
338 makelabel.bot.nodot("3 ",z3);
339 makelabel.top.nodot(" 4",z4+(-1,1));
340 makelabel.top.nodot("5",z5+(0,5));
341 makelabel.top.nodot("6 ",z6+(1,1));
342 for k=1 upto 6: heavy_dot z[k]; endfor;
343 for k=1 upto length p: heavy_dot postcontrol k-1 of p;
344 heavy_dot precontrol k of p; endfor
345 showit;
346 shipit;
347
348 "Figure 3h"; % bean shape with more tension before and after 1
349 clear_all;
350 z1=(0,100); z2=(100,100); z3=(200,100);
351 z4=(0,0); z5=(100,0); z6=(200,0);
352 path p; p=z5..z4..tension 1 and 1.5..z1..tension 1.5 and 1..z3..z6..cycle;
353 draw p;
354 makelabel.bot.nodot(" 1",z1);
355 makelabel.bot.nodot("2",z2-(0,2));
356 makelabel.bot.nodot("3 ",z3);
357 makelabel.top.nodot(" 4",z4+(-1,1));
358 makelabel.top.nodot("5",z5+(0,5));
359 makelabel.top.nodot("6 ",z6+(1,1));
360 for k=1 upto 6: heavy_dot z[k]; endfor;
361 for k=1 upto length p: heavy_dot postcontrol k-1 of p;
362 heavy_dot precontrol k of p; endfor
363 showit;
364 shipit;
365
366 "Figure 3i"; % bean shape with straight bottom
367 clear_all;
368 z1=(0,100); z2=(100,100); z3=(200,100);
369 z4=(0,0); z5=(100,0); z6=(200,0);
370 path p; p=z5..z4{left}..z1..z3..z6{left}..cycle;
371 draw p;
372 makelabel.bot.nodot(" 1",z1-(1,1));
373 makelabel.bot.nodot("2",z2-(0,2));
374 makelabel.bot.nodot("3 ",z3+(1,-1));
375 makelabel.top.nodot(" 4",z4+(0,5));
376 makelabel.top.nodot("5",z5+(0,5));
377 makelabel.top.nodot("6 ",z6+(0,5));
378 for k=1 upto 6: heavy_dot z[k]; endfor;
379 for k=1 upto length p: heavy_dot postcontrol k-1 of p;
380 heavy_dot precontrol k of p; endfor
381 showit;
382 shipit;
383
384 "Figure 3j"; % example with direction specified
385 clear_all;
386 z1=(0,100); z2=(100,100); z3=(200,100);
387 z4=(0,0); z5=(100,0); z6=(200,0);
388 path p; p=z4..z2{z3-z4}..z3;
389 draw p;
390 makelabel.rt.nodot("1",z1+(0,-9));
391 makelabel.rt.nodot("2",z2+(1,-11));
392 makelabel.rt.nodot("3",z3+(1,-11));
393 makelabel.rt.nodot("4",z4+(1,-11));
394 makelabel.rt.nodot("5",z5+(0,-9));
395 makelabel.rt.nodot("6",z6+(0,-9));
396 for k=1 upto 6: heavy_dot z[k]; endfor;
397 for k=1 upto length p: heavy_dot postcontrol k-1 of p;
398 heavy_dot precontrol k of p; endfor
399 showit;
400 shipit;
401
402 "Figure 3k"; % wiggly shape for exercise
403 clear_all;
404 z1=(0,100); z2=(100,100); z3=(200,100);
405 z4=(0,0); z5=(100,0); z6=(200,0);
406 path p; p=z5..z4{z4-z2}..z1..z3..z6{z2-z6}..cycle;
407 draw p;
408 makelabel.bot.nodot(" 1",z1-(2,2));
409 makelabel.bot.nodot("2",z2-(0,2));
410 makelabel.bot.nodot("3 ",z3+(2,-2));
411 makelabel.bot.nodot(" 4",z4);
412 makelabel.top.nodot("5",z5+(0,5));
413 makelabel.bot.nodot("6 ",z6);
414 for k=1 upto 6: heavy_dot z[k]; endfor;
415 showit;
416 shipit;
417
418 "Figure 3l"; % examples of varying curl
419 clear_all;
420 z1=(0,100); z2=(100,100); z3=(200,100);
421 z4=(0,0); z5=(100,0); z6=(200,0);
422 path p; p=z4{curl0}..z2{z3-z4}..{curl0}z3;
423 draw p;
424 drawdot z4; drawdot z3;
425 makelabel.rt.nodot("1",z1+(0,-9));
426 makelabel.rt.nodot("2",z2+(1,-11));
427 makelabel.rt.nodot("3",z3+(1,-11));
428 makelabel.rt.nodot("4",z4+(1,-11));
429 makelabel.rt.nodot("5",z5+(0,-9));
430 makelabel.rt.nodot("6",z6+(0,-9));
431 for k=1 upto 6: heavy_dot z[k]; endfor;
432 for k=1 upto length p: heavy_dot postcontrol k-1 of p;
433 heavy_dot precontrol k of p; endfor
434 pair offset; offset=(325,0);
435 p:=(z4{curl2}..z2{z3-z4}..{curl2}z3) shifted offset; draw p;
436 drawdot z4+offset; drawdot z3+offset;
437 makelabel.rt.nodot("1",z1+(0,-9)+offset);
438 makelabel.rt.nodot("2",z2+(1,-11)+offset);
439 makelabel.rt.nodot("3",z3+(1,-11)+offset);
440 makelabel.rt.nodot("4",z4+(1,-11)+offset);
441 makelabel.rt.nodot("5",z5+(0,-9)+offset);
442 makelabel.rt.nodot("6",z6+(0,-9)+offset);
443 for k=1 upto 6: heavy_dot z[k]+offset; endfor;
444 for k=1 upto length p: heavy_dot postcontrol k-1 of p;
445 heavy_dot precontrol k of p; endfor
446 showit;
447 shipit;
448
449 "Figure 3m"; % two directions specified
450 clear_all;
451 z1=(0,100); z2=(100,100); z3=(200,100);
452 z4=(0,0); z5=(100,0); z6=(200,0);
453 path p; p=z4{z2-z4}..z6{down};
454 draw p;
455 drawdot z4; drawdot z6;
456 makelabel.rt.nodot("1",z1+(2,0));
457 makelabel.rt.nodot("2",z2+(2,0));
458 makelabel.rt.nodot("3",z3+(2,0));
459 makelabel.bot.nodot(" 4",z4);
460 makelabel.rt.nodot("5",z5+(2,0));
461 makelabel.rt.nodot(" 6",z6);
462 for k=1 upto 6: heavy_dot z[k]; endfor;
463 for k=1 upto length p: heavy_dot postcontrol k-1 of p;
464 heavy_dot precontrol k of p; endfor
465 showit;
466 shipit;
467
468 "Figure 3n"; % two control points specified
469 clear_all;
470 z1=(0,100); z2=(100,100); z3=(200,100);
471 z4=(0,0); z5=(100,0); z6=(200,0);
472 path p; p=z4..controls z1 and z2..z6;
473 draw p;
474 drawdot z4; drawdot z6;
475 makelabel.rt.nodot("1",z1+(2,0));
476 makelabel.rt.nodot("2",z2+(2,0));
477 makelabel.rt.nodot("3",z3+(2,0));
478 makelabel.rt.nodot(" 4",z4);
479 makelabel.rt.nodot("5",z5+(2,0));
480 makelabel.rt.nodot(" 6",z6);
481 for k=1 upto 6: heavy_dot z[k]; endfor;
482 showit;
483 shipit;
484
485 "Figure 4a"; % bean shape with elliptical pens
486 clear_all;
487 z1=(0,100); z2=(100,100); z3=(200,100);
488 z4=(0,0); z5=(100,0); z6=(200,0);
489 path p; p=z5..z4..z1..z3..z6..cycle;
490 pickup pencircle xscaled .8pt yscaled .2pt rotated 30;
491 draw p;
492 makelabel.bot(" 1",z1);
493 makelabel.bot("2",z2);
494 makelabel.bot(" 3",z3);
495 makelabel.top("4 ",z4);
496 makelabel.top("",z5); makelabel.top.nodot("5",z5+(0,5));
497 makelabel.top("",z6); makelabel.top.nodot("6 ",z6+(1,1));
498 pair offset; offset=(325,0);
499 pickup pencircle xscaled .8pt rotated 30;
500 draw p shifted offset;
501 makelabel.bot(" 1",z1+offset);
502 makelabel.bot("2",z2+offset);
503 makelabel.bot(" 3",z3+offset);
504 makelabel.top("4 ",z4+offset);
505 makelabel.top("",z5+offset); makelabel.top.nodot("5",z5+(0,5)+offset);
506 makelabel.top("",z6+offset); makelabel.top.nodot("6 ",z6+(1,1)+offset);
507 showit;
508 shipit;
509
510 "Figure 4b"; % T of METAFONT logo
511 alpha:=.45; % controls bar location and similar things
512 beta:=.2; % controls squareness of bowls
513 numeric h#, xx#, yy#, o#, s#, u#, ph#, pv#;
514 numeric leftstemloc, barheight;
515 h#=6; % height of characters, in pt
516 xx#=0.6; % extra length of certain features, in pt
517 u#=4/9; % unit width, in pt
518 s#=0; % extra sidebar, in pt
519 o#=1/9; % overshoot of curves, in pt
520 ph#=2/3; % horizontal thickness of pen, in pt
521 yy#=xx#; define_whole_pixels(xx,yy);
522 define_pixels(s,u);
523 define_corrected_pixels(o);
524 pv#=.9ph#; define_blacker_pixels(ph,pv);
525 pickup pencircle xscaled ph yscaled pv;
526 logo_pen:=savepen;
527 leftstemloc:=good.x((2.5u#+s#)*pt);
528 barheight:=good.y(alpha*h#*pt);
529 def beginlogochar(suffix c)(expr n) = % code c; width is n units plus sidebars
530 beginchar(str c,n*u#+2s#,h#,0); pickup logo_pen enddef;
531
532 beginlogochar(T,13);
533 if odd(w-ph): w:=w+1; fi % allows a symmetric stem
534 x1+x2=2x3=2x4=w; lft.x1=-epsilon; % I tried s-o instead; was not as good
535 y1=y2=y3; top.y1=h; bot.y4=-o;
536 draw z1..z2; draw z3..z4;
537 labels.rt(2,3);
538 makelabel.top("1",z1);
539 makelabel.top("4",z4);
540 endchar;
541
542 "Figure 4c"; % M of METAFONT logo
543 alpha:=.45; % controls bar location and similar things
544 beta:=.2; % controls squareness of bowls
545 numeric h#, xx#, yy#, o#, s#, u#, ph#, pv#;
546 numeric leftstemloc, barheight;
547 h#=6; % height of characters, in pt
548 xx#=0.6; % extra length of certain features, in pt
549 u#=4/9; % unit width, in pt
550 s#=0; % extra sidebar, in pt
551 o#=1/9; % overshoot of curves, in pt
552 ph#=2/3; % horizontal thickness of pen, in pt
553 yy#=xx#; define_whole_pixels(xx,yy);
554 define_pixels(s,u);
555 define_corrected_pixels(o);
556 pv#=.9ph#; define_blacker_pixels(ph,pv);
557 pickup pencircle xscaled ph yscaled pv;
558 logo_pen:=savepen;
559 leftstemloc:=good.x((2.5u#+s#)*pt);
560 barheight:=good.y(alpha*h#*pt);
561 def beginlogochar(suffix c)(expr n) = % code c; width is n units plus sidebars
562 beginchar(str c,n*u#+2s#,h#,0); pickup logo_pen enddef;
563
564 beginlogochar(M,18);
565 x1+x5=x2+x4=2x3=w; x1=x2=leftstemloc;
566 y1=y5; y2=y4; bot.y1=-o; top y2=h+o; y3=y1+yy;
567 draw z1--z2--z3--z4--z5;
568 labels.rt(3,5);
569 makelabel.lft("1",z1);
570 makelabel.bot("2",z2);
571 makelabel.bot("4",z4);
572 endchar;
573
574 "Figure 4d"; % solid kidney bean
575 clear_all;
576 z1=(0,100); z2=(100,100); z3=(200,100);
577 z4=(0,0); z5=(100,0); z6=(200,0);
578 path p; p=z5..z4..z1..z3..z6..cycle;
579 fill p;
580 makelabel.bot(" 1",z1);
581 makelabel.bot("2",z2);
582 makelabel.bot("3 ",z3);
583 makelabel.top(" 4",z4);
584 makelabel.top("5",z5);
585 makelabel.top("6 ",z6);
586 showit;
587 shipit;
588
589 "Figure 4e"; % black triangle character for exercises
590 beginchar(oct"170", 5pt#, 6.25pt#, 0);
591 t:=(2-sqrt3)/2;
592 x1=x2=w-x3+.5-t=round .43pt; y3=.5+floor.5h; % MANUAL font has it different!
593 %x1=x2=w-x3=round .43pt; y3=.5+floor.5h;
594 z1-z2=(z3-z2) rotated 60;
595 y2:=t+round(y2-t); y1:=h-y2;
596 fill z1--z2--z3--cycle;
597 labels.lft(1,2); labels.rt(3); endchar;
598
599 "Figure 4f"; % black bean with white holes
600 clear_all;
601 z1=(0,100); z2=(100,100); z3=(200,100);
602 z4=(0,0); z5=(100,0); z6=(200,0);
603 path p; p=z5..z4..z1..z3..z6..cycle;
604 fill p;
605 unfill 1/4[z4,z2]..3/4[z4,z2]..cycle;
606 unfill 1/4[z6,z2]..3/4[z6,z2]..cycle;
607 makelabel.bot(" 1",z1);
608 makelabel.bot("2",z2);
609 makelabel.bot("3 ",z3);
610 makelabel.top(" 4",z4);
611 makelabel.top("5",z5);
612 makelabel.top("6 ",z6);
613 showit;
614 shipit;
615
616 "Figure 4g"; % black bean with skewed interior cutout
617 clear_all;
618 z1=(0,100); z2=(100,100); z3=(200,100);
619 z4=(0,0); z5=(100,0); z6=(200,0);
620 path p; p=z5..z4..z1..z3..z6..cycle;
621 fill p;
622 z0=(.8[x1,x2],.5[y1,y4]);
623 for k=1 upto 6: z[k]'=.2[z[k],z0]; endfor
624 unfill z5'..z4'..z1'..z3'..z6'..cycle;
625 makelabel.bot("0",z0);
626 makelabel.top("1 ",z1);
627 makelabel.top("2",z2);
628 makelabel.top(" 3",z3);
629 makelabel.bot("4 ",z4);
630 makelabel.bot("5",z5);
631 makelabel.bot(" 6",z6);
632 makelabel.bot(" 1'",z1');
633 makelabel.bot(" 2'",z2');
634 makelabel.bot("3' ",z3');
635 makelabel.top(" 4'",z4');
636 makelabel.top("5'",z5');
637 makelabel.top("6' ",z6');
638 showit;
639 shipit;
640
641 "Figure 4h"; % sample penstroke
642 clear_all;
643 penpos1(1.2pt,30); penpos2(1.0pt,45); penpos3(0.8pt,90);
644 z1=(0,2pt); z2=(4pt,0); x3=9pt; y3l=y2r;
645 penstroke z1e..z2e{right}..z3e{right};
646 labels.top(2r,3r);
647 labels.bot(2l,3l);
648 labels.rt(3,1r);
649 labels.lft(1l,2);
650 makelabel.top("1 ",z1);
651 showit;
652 shipit;
653
654 "Figure 4i"; % cyclic penstroke example
655 clear_all;
656 d:=25;
657 penpos1(d,30);
658 penpos2(d,60);
659 penpos3(d,210);
660 penpos4(d,240);
661 y1=.51y2r; y2r=175; y3=.49y2r; y4r=0;
662 x1r=175; x2=x4=.5x1r; x3r=0;
663 penstroke z1e{up}..z2e{left}..z3e{down}..z4e{right}..cycle;
664 labels.lft(1l,2,3r,4);
665 labels.rt(1r,3l);
666 labels.top(2r,3,4l);
667 labels.bot(1,2l,4r);
668 showit;
669 shipit;
670
671 "Figure 4j"; % I from IOnian font
672 clear_all;
673 em#:=10pt#; cap#:=7pt#;
674 bar#:=.8pt#;
675 stem#:=.9pt#;
676 thin#:=.8pt#;
677 thick#:=1pt#;
678 define_pixels(em,cap);
679 define_blacker_pixels(thin,thick,bar,stem);
680 beginchar(27,.35em#,cap#,0); % "The letter I"; \IOI=27
681 penpos1(stem,15); penpos2(.9stem,12); penpos3(stem,10);
682 x1=x2=x3=.5w; y1=h; y2=.55h; y3=0;
683 x2l:=1/6[x2l,x2];
684 penstroke z1e..z2e{down}..z3e;
685 labels.top(1,2,1r);
686 labels.lft(2l);
687 labels.rt(2r);
688 labels.bot(3,3l);
689 makelabel("",z1l); makelabel("",z3r);
690 makelabel.lft.nodot("1l",z1l-(0,2));
691 makelabel.rt.nodot("3r",z3r+(0,2));
692 endchar;
693
694 "Figure 4k"; % fixed pens versus penstrokes
695 clear_all;
696 z1=(0,0); z2=(150,0);
697 pickup pencircle xscaled 0.8pt rotated 25;
698 draw z1..z2..cycle;
699 labels.lft(1,2);
700 clearxy;
701 pair offset; offset=(250,0);
702 penpos1(0.8pt,25); penpos2(0.8pt,25);
703 z1=(0,0)+offset; z2=(150,0)+offset;
704 penstroke z1e..z2e..cycle;
705 labels.lft(1l,2l);
706 labels.rt(1r,2r);
707 labels.bot(1,2);
708 showit;
709 shipit;
710
711 "Figure 4l"; % hex symbol with pen-pressure adjustments
712 %b#:=1.0pt#; define_blacker_pixels(b); % FOR INITIAL TESTS ONLY
713 %beginchar(0,500/36pt#,250/36pt#,0); % that's magnified 2.5 as in the type
714 b#:=0.4pt#; define_blacker_pixels(b);
715 beginchar(0,200/36pt#,100/36pt#,0);
716 pickup pencircle scaled b;
717 w:=2good.x .5w;
718 top z1=(0,h); top z2=(.5w,h); top z3=(w,h);
719 bot z4=(0,0); bot z5=(.5w,0); bot z6=(w,0);
720 draw z2..z5;
721 for k=1 upto 6: drawdot z[k]; endfor
722 z1'=.25[z1,z6]; z6'=.75[z1,z6];
723 z3'=.25[z3,z4]; z4'=.75[z3,z4];
724 theta1:=angle(z6-z1)+90;
725 theta3:=angle(z4-z3)+90;
726 penpos1'(b,theta1); penpos6'(b,theta1); penpos7(.6b,theta1);
727 penpos3'(b,theta3); penpos4'(b,theta3); penpos8(.6b,theta3);
728 z7=z8=.5[z1,z6];
729 draw z1..z1'; draw z6'..z6;
730 penstroke z1'e{z6'-z1'}..z7e..{z6'-z1'}z6'e;
731 draw z3..z3'; draw z4'..z4;
732 penstroke z3'e{z4'-z3'}..z8e..{z4'-z3'}z4'e;
733 labels.top(1'r,3'l,4'l,6'r);
734 labels.bot(1'l,3'r,4'r,6'l);
735 forsuffixes $=1',3',4',6': makelabel("",z$); endfor
736 makelabel.lft("1 ",z1);
737 makelabel.lft("2 ",z2);
738 makelabel.rt(" 3",z3);
739 makelabel.lft("4 ",z4);
740 makelabel.lft("5 ",z5);
741 makelabel.rt(" 6",z6);
742 makelabel.top("8l ",z8l);
743 makelabel.top(" 7r",z7r);
744 makelabel.bot("7l ",z7l);
745 makelabel.bot(" 8r",z8r);
746 endchar;
747
748 "Figure 4m"; % same, cut sharp at the terminals, and inside the box
749 %b#:=1.0pt#; define_blacker_pixels(b); % FOR INITIAL TESTS ONLY
750 %beginchar(0,500/36pt#,250/36pt#,0); % that's magnified 2.5 as in the type
751 b#:=0.4pt#; define_blacker_pixels(b);
752 beginchar(0,200/36pt#,100/36pt#,0);
753 pickup pencircle scaled b;
754 w:=2good.x .5w;
755 x1l=x4l=0;x2=x5=.5w;x3r=x6r=w;
756 y1r=y2=y3l=h; y4r=y5=y6l=0;
757 z1'=.25[z1,z6]; z6'=.75[z1,z6]; theta1:=angle(w,-h)+90;
758 z3'=.25[z3,z4]; z4'=.75[z3,z4]; theta3:=angle(-w,-h)+90;
759 z7=z8=.5[z1,z6];
760 penpos1(b,theta1); penpos6(b,theta1);
761 penpos1'(b,theta1); penpos6'(b,theta1); penpos7(.6b,theta1);
762 penpos3(b,theta3); penpos4(b,theta3);
763 penpos3'(b,theta3); penpos4'(b,theta3); penpos8(.6b,theta3);
764 penstroke z1e..z1'e{z6'-z1'}..z7e..{z6'-z1'}z6'e..z6e;
765 penpos2(b,0); penpos5(b,0); penstroke z2e..z5e;
766 penstroke z3e..z3'e{z4'-z3'}..z8e..{z4'-z3'}z4'e..z4e;
767 penlabels(1,1',3,3',4,4',6,6');
768 labels.top(1r,1'r,2,3l,3'l,4l,4'l,6r,6'r);
769 labels.bot(1l,1'l,3r,3'r,4r,4'r,5,6l,6'l);
770 labels.lft(2l,5l);
771 labels.rt(2r,5r);
772 forsuffixes $=1,1',3,3',4,4',6,6': makelabel("",z$); endfor
773 makelabel.top("8l ",z8l);
774 makelabel.top(" 7r",z7r);
775 makelabel.bot("7l ",z7l);
776 makelabel.bot(" 8r",z8r);
777 endchar;
778
779 "Figure A5a"; % S from IOnian font
780 clear_all;
781 em#:=10pt#; cap#:=7pt#;
782 slab#:=.8pt#;
783 stem#:=.9pt#;
784 thin#:=.8pt#;
785 thick#:=5/6pt#;
786 o#:=1/5pt#;
787 define_corrected_pixels(o);
788 define_pixels(em,cap);
789 define_blacker_pixels(thin,thick,slab,stem);
790 beginchar(25,5/9em#,cap#,0); % "The letter S"; /IOS=25
791 penpos1(slab,70);
792 penpos2(.5slab,80);
793 penpos3(.5[slab,thick],200);
794 penpos5(.5[slab,thick],210);
795 penpos6(.7slab,80);
796 penpos7(.25[slab,thick],72);
797 x1=x5; y1r=.94h+o;
798 x2=x4=x6=.5w; y2r=h+o; y4=.54h; y6l=-o;
799 x3r=.04em; y3=.5[y4,y2];
800 x5l=w-.03em; y5=.5[y4,y6];
801 .5[x7l,x7]=.04em; y7l=.12h-o;
802 path trial; trial=z3{down}..z4..{down}z5;
803 pair dz; dz=direction 1 of trial;
804 penpos4(thick,angle dz-90);
805 penstroke z1e..z2e{left}..z3e{down}..z4e{dz}..z5e{down}..z6e{left}..z7e;
806 labels.lft(2,3r,5r,6,7);
807 labels.rt(1,3l,4,5l);
808 labels.top(1r,2r,3,4l,5,6r,7r);
809 labels.bot(1l,2l,4r,6l,7l);
810 endchar;
811
812 "Figure 8a"; % twenty points on p2
813 clear_all;
814 path p[]; p1=(0,0)..(3,3); p2=(0,0)..(3,3)..cycle;
815 transform t; t=identity scaled 60 shifted (50,0);
816 pair zz;
817 z=(1.5,1.5) transformed t;
818 pickup pencircle;
819 draw p2 transformed t;
820 for n=0 upto 19: zz:=point n/10 of p2 transformed t;
821 heavy_dot zz;
822 makelabel.top.nodot(decimal(n/10) if n mod 10=0:&".0" fi,
823 .09[zz,z] shifted(.05xpart(z-zz),-6.5)); endfor
824 %.1[zz,z] shifted(.1xpart(z-zz),-8)); endfor
825 shipit;
826 showit;
827
828 "Figure 11a"; % E of METAFONT logo
829 alpha:=.45; % controls bar location and similar things
830 beta:=.2; % controls squareness of bowls
831 numeric h#, xx#, yy#, o#, s#, u#, ph#, pv#;
832 numeric leftstemloc, barheight;
833 h#=6; % height of characters, in pt
834 xx#=0.6; % extra length of certain features, in pt
835 u#=4/9; % unit width, in pt
836 s#=0; % extra sidebar, in pt
837 o#=1/9; % overshoot of curves, in pt
838 ph#=2/3; % horizontal thickness of pen, in pt
839 yy#=xx#; define_whole_pixels(xx,yy);
840 define_pixels(s,u);
841 define_corrected_pixels(o);
842 pv#=.9ph#; define_blacker_pixels(ph,pv);
843 pickup pencircle xscaled ph yscaled pv;
844 logo_pen:=savepen;
845 leftstemloc:=good.x((2.5u#+s#)*pt);
846 barheight:=good.y(alpha*h#*pt);
847 def beginlogochar(suffix c)(expr n) = % code c; width is n units plus sidebars
848 beginchar(str c,n*u#+2s#,h#,0); pickup logo_pen enddef;
849
850 beginlogochar(E,14);
851 x1=x2=x3=leftstemloc; x4=x6=w-x1+o; x5=x4-xx;
852 y1=y6; y2=y5; y3=y4; bot.y1=0; top.y3=h; y2=barheight;
853 draw z6--z1--z3--z4; draw z2..z5;
854 labels.rt(1,2,3);
855 labels.lft(4,5,6);
856 endchar;
857
858 "Figure 12a"; % cmr10 left parenthesis
859 u#:=20/36pt#;
860 tiny#:=0;
861 axis#:=90/36pt#;
862 hheight#:=250/36pt#;
863 border#:=20/36pt#;
864 hair#:=8/36pt#;
865 thin#:=9/36pt#;
866 thick#:=25/36pt#;
867 slant:=0;
868 rulethickness:=.4pt#;
869
870 font_setup;
871 beginchar("(",7u#, hheight#+border#, hheight#+border#-2axis#);
872 italcorr (hheight#+border#)*slant-.5u#;
873 pickup tinypen;
874 penpos1(hair-tiny,0); penpos3(hair-tiny,0);
875 penpos2(.75[thin,thick]-tiny,0);
876 rt x1r = rt x3r = w-u; lft x2l = x1-4u;
877 top y1=h; y2=.5[y1,y3]=axis;
878 filldraw z1l{curl 4}..z2l..{curl 4}z3l--
879 z3r{curl 4}..z2r..{curl 4}z1r--cycle;
880 labels.top(3,2);
881 labels.bot(1);
882 labels.lft(1l,2l,3l);
883 labels.rt(1r,2r,3r);
884 endchar;
885
886 "Figure 12b"; % cmbx10 left parenthesis
887 u#:=23/36pt#;
888 tiny#:=0;
889 axis#:=90/36pt#;
890 hheight#:=250/36pt#;
891 border#:=20/36pt#;
892 hair#:=13/36pt#;
893 thin#:=17/36pt#;
894 thick#:=41/36pt#;
895 slant:=0;
896
897 font_setup;
898 beginchar("(",7u#, hheight#+border#, hheight#+border#-2axis#);
899 italcorr (hheight#+border#)*slant-.5u#;
900 pickup tinypen;
901 penpos1(hair-tiny,0); penpos3(hair-tiny,0);
902 penpos2(.75[thin,thick]-tiny,0);
903 rt x1r = rt x3r = w-u; lft x2l = x1-4u;
904 top y1=h; y2=.5[y1,y3]=axis;
905 filldraw z1l{curl 4}..z2l..{curl 4}z3l--
906 z3r{curl 4}..z2r..{curl 4}z1r--cycle;
907 labels.top(3,2);
908 labels.bot(1);
909 labels.lft(1l,2l,3l);
910 labels.rt(1r,2r,3r);
911 endchar;
912
913 "Figure 12c"; % cmvtt10 left parenthesis
914 u#:=21/36pt#;
915 tiny#:=22/36pt#;
916 axis#:=110/36pt#;
917 hheight#:=220/36pt#;
918 border#:=30/36pt#;
919 hair#:=22/36pt#;
920 thin#:=25/36pt#;
921 thick#:=25/36pt#;
922 slant:=0;
923
924 font_setup;
925 beginchar("(",7u#, hheight#+border#, hheight#+border#-2axis#);
926 italcorr (hheight#+border#)*slant-.5u#;
927 pickup tinypen;
928 penpos1(hair-tiny,0); penpos3(hair-tiny,0);
929 penpos2(.75[thin,thick]-tiny,0);
930 rt x1r = rt x3r = w-u; lft x2l = x1-4u;
931 top y1=h; y2=.5[y1,y3]=axis;
932 filldraw z1l{curl 4}..z2l..{curl 4}z3l--
933 z3r{curl 4}..z2r..{curl 4}z1r--cycle;
934 labels.top(3,2);
935 labels.bot(1);
936 labels.lft(1l,2l,3l);
937 labels.rt(1r,2r,3r);
938 endchar;
939
940 "Figure 12d"; % cmssdc10 left parenthesis
941 u#:=19/36pt#;
942 tiny#:=8/36pt#;
943 axis#:=95/36pt#;
944 hheight#:=250/36pt#;
945 border#:=20/36pt#;
946 hair#:=23/36pt#;
947 thin#:=40/36pt#;
948 thick#:=40/36pt#;
949 slant:=0;
950
951 font_setup;
952 beginchar("(",7u#, hheight#+border#, hheight#+border#-2axis#);
953 italcorr (hheight#+border#)*slant-.5u#;
954 pickup tinypen;
955 penpos1(hair-tiny,0); penpos3(hair-tiny,0);
956 penpos2(.75[thin,thick]-tiny,0);
957 rt x1r = rt x3r = w-u; lft x2l = x1-4u;
958 top y1=h; y2=.5[y1,y3]=axis;
959 filldraw z1l{curl 4}..z2l..{curl 4}z3l--
960 z3r{curl 4}..z2r..{curl 4}z1r--cycle;
961 labels.top(3,2);
962 labels.bot(1);
963 labels.lft(1l,2l,3l);
964 labels.rt(1r,2r,3r);
965 endchar;
966
967 "Figure 12e"; % cmti10 left parenthesis
968 u#:=18.4/36pt#;
969 tiny#:=7/36;
970 axis#:=90/36pt#;
971 hheight#:=250/36pt#;
972 border#:=20/36pt#;
973 hair#:=8/36pt#;
974 thin#:=11/36pt#;
975 thick#:=23/36pt#;
976 slant:=.25;
977
978 font_setup;
979 beginchar("(",7u#, hheight#+border#, hheight#+border#-2axis#);
980 italcorr (hheight#+border#)*slant-.5u#;
981 pickup tinypen;
982 penpos1(hair-tiny,0); penpos3(hair-tiny,0);
983 penpos2(.75[thin,thick]-tiny,0);
984 rt x1r = rt x3r = w-u; lft x2l = x1-4u;
985 top y1=h; y2=.5[y1,y3]=axis;
986 filldraw z1l{curl 4}..z2l..{curl 4}z3l--
987 z3r{curl 4}..z2r..{curl 4}z1r--cycle;
988 labels.top(3,2);
989 labels.bot(1);
990 labels.lft(1l,2l,3l);
991 labels.rt(1r,2r,3r);
992 endchar;
993 currenttransform:=identity yscaled aspect_ratio;
994
995 "Figure 12f"; % Dangerous bend symbol
996 def font_setup=
997 define_pixels(u,tiny,axis,hheight,border);
998 define_blacker_pixels(hair,thin,thick,rulethickness);
999 pickup if tiny<.5: nullpen else: pencircle scaled tiny fi;
1000 tinypen:=savepen;
1001 currenttransform:=identity slanted slant;
1002 enddef;
1003
1004 % typical cmr10 parameters
1005 u#:=20/36pt#;
1006 tiny#:=0;
1007 axis#:=90/36pt#;
1008 hheight#:=250/36pt#;
1009 border#:=20/36pt#;
1010 hair#:=8/36pt#;
1011 thin#:=9/36pt#;
1012 thick#:=25/36pt#;
1013 fixwidth:=0;
1014 slant:=0;
1015 rulethickness#:=.4pt#;
1016
1017 baselinedistance#:=11pt#;
1018 heavyline#:=50/36pt#;
1019 font_setup;
1020 define_whole_pixels(baselinedistance);
1021 define_blacker_pixels(heavyline);
1022
1023 beginchar(127,25u#,hheight#+border#,0);
1024 pickup pencircle scaled rulethickness;
1025 top y1=25/27h; lft x4=0;
1026 x1+x1=x1a+x1b=x4b+x2a=x4+x2=x4a+x2b=x3b+x3a=x3+x3=w;
1027 x4a=x4b=x4+u; x3b=x1a=x1-2u;
1028 y4+y4=y4a+y4b=y3b+y1a=y3+y1=y3a+y1b=y2b+y2a=y2+y2=0;
1029 y1a=y1b=y1-2/27h; y4b=y2a=y4+4/27h;
1030 draw z1a..z1..z1b---z2a..z2..z2b---
1031 z3a..z3..z3b---z4a..z4..z4b---cycle; % signboard
1032 x10=x11=x12=x13=good.x(.5w-u); x14=x15=x16=x17=w-x10;
1033 y10=y14=28/27h+epsilon; bot y13=-baselinedistance;
1034 z11=(z10..z13) intersectionpoint (z1a{z1a-z4b}..z1{right});
1035 y15=y11; y16=y12=-y11; y17=y20=y21=y13;
1036 draw z11--z10--z14--z15; draw z12--z13; draw z16--z17; % signpost
1037 x20=w-x21; x21-x20=16u; draw z20--z21; % ground level
1038 x36=w-x31; x36-x31=8u; x32=x33=x36; x31=x34=x35;
1039 y31=-y36=12/27h; y32=-y35=9/27h; y33=-y34=3/27h;
1040 pickup pencircle scaled heavyline;
1041 draw z32{z32-z31}..z33---z34..z35{z36-z35}; % the dangerous bend
1042 pickup penrazor xscaled heavyline rotated (angle(z32-z31)+90);
1043 draw z31--z32; draw z35--z36; % upper and lower bars
1044 labels.top(11,15,2a,4b,4,2,32,34);
1045 labels.bot(10,14,2b,4a,33,35);
1046 labels.lft(1a,3b,12,13,21,36);
1047 labels.rt(1,1b,3a,3,16,20,17,31);
1048 endchar;
1049
1050 "Figure 13a"; % Possible cube
1051 clear_all;
1052 fudge_factor:=1/2;
1053 s#:=5pt#*fudge_factor; define_pixels(s); % side of the square
1054 z1=(-epsilon,-epsilon); z2=(s+epsilon,-epsilon);
1055 z3=(-epsilon,s+epsilon); z4=(s+epsilon,s+epsilon);
1056 for k=1 upto 4: z[k+4]=z[k]+(2/3s,1/3s); endfor
1057 pickup pencircle scaled (.4pt*fudge_factor);
1058 draw z5--z6--z8--z7--cycle;
1059 pickup pencircle scaled (1.6pt*fudge_factor);
1060 erase draw z2--z4--z3;
1061 pickup pencircle scaled (.4pt*fudge_factor);
1062 draw z1--z2--z4--z3--cycle;
1063 for k=1 upto 4: draw z[k]--z[k+4]; endfor
1064 labels.top(1,2,5,6);
1065 labels.bot(3,4,7,8);
1066 showit;
1067 shipit;
1068
1069 "Figure 14a"; % El Palo Alto
1070 begingroup save flex; clear_all;
1071 def flex(text t) = % puts dots into normal flex
1072 hide(n_:=0;
1073 for z=t: z_[incr n_]:=z; makelabel("",z); endfor
1074 dz_:=z_[n_]-z_1)
1075 z_1 for k=2 upto n_-1: ...z_[k]{dz_} endfor ...z_[n_] enddef;
1076
1077 def grid= proofoffset (30,0);
1078 for y:=0 step 50 until 650: proofrule((-110,y),(110,y));
1079 makelabel.lft.nodot(str[y],(100,y+5));
1080 endfor;
1081 for x:=-100 step 50 until 100: proofrule((x,-10),(x,660));endfor enddef;
1082
1083 path branch[],trunk;
1084
1085 branch1=
1086 flex((0,660),(-9,633),(-22,610))
1087 &flex((-22,610),(-3,622),(17,617))
1088 &flex((17,617),(7,637),(0,660))
1089 &cycle;
1090
1091 branch2=
1092 flex((30,570),(10,590),(-1,616))
1093 &flex((-1,616),(-11,592),(-29,576),(-32,562))
1094 &flex((-32,562),(-10,577),(30,570))
1095 &cycle;
1096
1097 branch3=
1098 flex((-1,570),(-17,550),(-40,535))
1099 &flex((-40,535),(-45,510),(-60,477))
1100 &flex((-60,477),(-20,505),(40,512))
1101 &flex((40,512),(31,532),(8,550),(-1,570))
1102 &cycle;
1103
1104 branch4=
1105 flex((0,509),(-14,492),(-32,481))
1106 &flex((-32,481),(-42,455),(-62,430))
1107 &flex((-62,430),(-20,450),(42,448))
1108 &flex((42,448),(38,465),(4,493),(0,509))
1109 &cycle;
1110
1111 branch5=
1112 flex((-22,470),(-23,435),(-44,410))
1113 &flex((-44,410),(-10,421),(35,420))
1114 &flex((35,420),(15,455),(-22,470))
1115 &cycle;
1116
1117 branch6=
1118 flex((18,375),(9,396),(5,420))
1119 &flex((5,420),(-5,410),(-50,375),(-50,350))
1120 &flex((-50,350),(-25,375),(18,375))
1121 &cycle;
1122
1123 branch7=
1124 flex((0,400),(-13,373),(-30,350))
1125 &flex((-30,350),(0,358),(30,350))
1126 &flex((30,350),(13,373),(0,400))
1127 &cycle;
1128
1129 branch8=
1130 flex((50,275),(45,310),(3,360))
1131 &flex((3,360),(-20,330),(-70,300),(-100,266))
1132 &flex((-100,266),(-75,278),(-60,266))
1133 &flex((-60,266),(0,310),(50,275))
1134 &cycle;
1135
1136 branch9=
1137 flex((10,333),(-15,290),(-43,256))
1138 &flex((-43,256),(8,262),(58,245))
1139 &flex((58,245),(34,275),(10,333))
1140 &cycle;
1141
1142 branch10=
1143 flex((8,262),(-21,249),(-55,240))
1144 &flex((-55,240),(-51,232),(-53,220))
1145 &flex((-53,220),(-28,229),(27,235))
1146 &flex((27,235),(16,246),(8,262))
1147 &cycle;
1148
1149 branch11=
1150 flex((0,250),(-25,220),(-70,195))
1151 &flex((-70,195),(-78,180),(-90,170))
1152 &flex((-90,170),(-5,188),(74,183))
1153 &flex((74,183),(34,214),(0,250))
1154 &cycle;
1155
1156 branch12=
1157 flex((8,215),(-35,175),(-72,155))
1158 &flex((-72,155),(-75,130),(-92,110),(-95,88))
1159 &flex((-95,88),(-65,117),(-54,104))
1160 &flex((-54,104),(10,151),(35,142))..flex((42,130),(60,123),(76,124))
1161 &flex((76,124),(62,146),(26,180),(8,215))&cycle;
1162
1163 trunk=(0,660)---(-12,70)..{curl 5}(-28,-8)
1164 &flex((-28,-8),(-16,-4),(-10,-11))
1165 &flex((-10,-11),(0,-5),(14,-10))
1166 &flex((14,-10),(20,-6),(29,-11))
1167 &(29,-11){curl 4}..(10,100)---cycle;
1168
1169 makelabel("",(-12,70));
1170 makelabel("",(10,100));
1171
1172 pickup pencircle scaled 2;
1173 draw trunk;
1174 for n=1 upto 12: draw branch[n]; endfor
1175 grid;
1176 showit;shipit;
1177 endgroup;
1178
1179 "Figure 14b"; % Detail of one branch
1180 clear_all;
1181 pair zz[];
1182 zz1=(0,509);
1183 zz2=(-14,492);
1184 zz3=(-32,481);
1185 zz4=(-42,455);
1186 zz5=(-62,430);
1187 zz6=(-20,450);
1188 zz7=(42,448);
1189 zz8=(38,465);
1190 zz9=(4,493);
1191 for n=1 upto 9: z[n]=(zz[n]+(62,-430)) scaled 2.5; endfor
1192 pickup pencircle;
1193 filldraw flex(z1,z2,z3)&flex(z3,z4,z5)
1194 &flex(z5,z6,z7)&flex(z7,z8,z9,z1)&cycle;
1195 labels.lft(2,3,4,5);
1196 labels.rt(1,7,8,9);
1197 labels.bot(6);
1198 showit; shipit;
1199
1200 "Figure 14c"; % superellipses
1201 clear_all;
1202 w:=100; h:=150;
1203 pickup pencircle xscaled 0.7pt yscaled 0.2pt rotated 30;
1204 forsuffixes ss=65,70,75,80: s:=ss/100;
1205 draw superellipse((w,.5h),(.5w,h),(0,.5h),(.5w,0),s) shifted (150/.05(s-.65),0);
1206 makelabel.top.nodot("."&str ss,(.5w,.45h) shifted (150/.05(s-.65),0));
1207 endfor
1208 showit;
1209 shipit;
1210
1211 "Figure 14d"; % demo of joinery
1212 clear_all;
1213 pickup standardpen;
1214 z0=(0,100); z1=(50,0); z2=(180,0);
1215 for n=3 upto 9: z[n]=z[n-3]+(200,0); endfor
1216 draw z0..z1---z2...{up}z3
1217 & z3..z4--z5...{up}z6
1218 & z6...z7---z8..{up}z9;
1219 makelabel.bot("0 ",z0);
1220 makelabel.bot("6 ",z6);
1221 labels.bot(3,9);
1222 labels.rt(1,4,7);
1223 labels.lft(2,5,8);
1224 showit;
1225 shipit;
1226
1227 "Figure 14e"; % JofA logo
1228 beginchar("A",29mm#*.22,25mm#*.22,0);
1229 interim autorounding:=0; interim smoothing:=0;
1230 if odd(w-h): h:=h-1; fi
1231 thick#:=2mm#*.22; thin#:=5/4mm#*.22;
1232 define_whole_blacker_pixels(thick,thin);
1233 forsuffixes @=a,b,c: transform @;
1234 forsuffixes e=l,r: path @e,@'e; numeric t@[]e; endfor endfor
1235 penpos1(thick,0); penpos2(thick,90); penpos3(thick,180); penpos4(thick,270);
1236 penpos5(thick,0); penpos6(thick,90); penpos7(thick,180); penpos8(thick,270);
1237 x2=x4=x6=x8=.5[x5,x7]=.5w; x1r=w; x3r=0; x5-x7=y6-y8;
1238 y1=y3=y5=y7=.5[y6,y8]=.5h; y2r=h; y4r=0; y6r=round.75h;
1239 forsuffixes e=l,r: a.e=b'e=c'e=superellipse(z1e,z2e,z3e,z4e,.75);
1240 a'e=b.e=c.e=superellipse(z5e,z6e,z7e,z8e,.72); endfor
1241 penpos.a1(thin,0); penpos.a5(whatever,-90); penpos.a9(thin,180);
1242 x.a1l-x.a9l=1/3(x5l-x7l); x.a5=.5w; y.a1=y.a9; y.a5r=4/7h;
1243 x.a3l=x.a1l; x.a3r=x.a1r; x.a4r=1/6[x.a3r,x1l]; x0=.5w; y0=.52h;
1244 x.a6l+x.a4l=x.a6r+x.a4r=x.a7l+x.a3l=x.a7r+x.a3r=x.a9+x.a1=w;
1245 y.a3r=y.a4r=y.a6r=y.a7r=.2[y2l,y0]; y.a3l=y.a4l=y.a6l=y.a7l=y.a3r-thin;
1246 z.a4l=z.a4r+(thin,0)rotated(angle(z.a4r-z.a5r)+90)
1247 +whatever*(z.a4r-z.a5r); z.a4l-z.a5l=whatever*(z.a4r-z.a5r);
1248 z=a.r intersectionpoint (z0--(w,0)); y.a1-y.a5=length(z-z0);
1249 b=identity shifted(0,y0-y.a1)rotatedaround(z0,90-angle(z0-(w,0)));
1250 c=b reflectedabout (z2,z4);
1251 for n=1,3,4,5,6,7,9: forsuffixes e=l,,r: forsuffixes @=b,c:
1252 z@[n]e=z.a[n]e transformed @; endfor endfor endfor
1253 forsuffixes e=l,r: forsuffixes @=a,b,c:
1254 z@2e=@r intersectionpoint (z@1e--z@3e);
1255 z@8e=@r intersectionpoint (z@9e--z@7e);
1256 t@1e=xpart(@e intersectiontimes (z@1l--z@3l));
1257 t@9e=xpart(@e intersectiontimes (z@9l--z@7l));
1258 t@4e=xpart(@'e intersectiontimes (z@5r--z@4l));
1259 t@6e=xpart(@'e intersectiontimes (z@5r--z@6l)); endfor endfor
1260 penstroke subpath(t.a9e,t.b6e) of a.e;
1261 penstroke subpath(t.b4e,t.c4e) of b'e;
1262 penstroke subpath(t.c6e,t.a1e+8) of c'e;
1263 penstroke subpath(t.a6e,t.b9e) of a'e;
1264 penstroke subpath(t.b1e,t.c1e) of b.e;
1265 penstroke subpath(t.c9e,t.a4e+8) of c.e;
1266 forsuffixes @=a,b,c:
1267 penstroke z@2e--z@3e--z@4e--z@5e--z@6e--z@7e--z@8e; endfor
1268 labels.lft(0,1l,3r,3,5l,7r,7,a1l,a2l,a3l,a6l,
1269 a6r,a8r,a9r,b2l,b5,b5r,b9,c1,c2r,c5l);
1270 labels.rt(1,1r,3l,5,5r,7l,a1r,a2r,a4l,a4r,a7l,
1271 a9l,b1,b2r,b5l,c2l,c5,c5r,c9);
1272 labels.top(2r,2,2l,4l,6r,6,6l,8l,a3r,a7r,a8l,
1273 b1l,b3l,b3r,b6r,b6l,b8r,b9r,c1l,c3l,c3r,c6r,c6l,c8r,c9r);
1274 labels.bot(2r,2,2l,4,4r,8,8r,a1,a5l,a5,a5r,a9,
1275 b1r,b4l,b4r,b7l,b7r,b8l,c1r,c4l,c4r,c7l,c7r,c8l);
1276 makelabel("",z.b9l);
1277 makelabel("",z.c9l);
1278 makelabel.lft.nodot("b9l",z.b9l-(0,3));
1279 makelabel.rt.nodot("c9l",z.c9l-(0,3));
1280 endchar;
1281
1282 "Figure 15a"; % four u's
1283 beginchar("4",11pt#,11pt#,0);
1284 pickup pencircle scaled 3/4pt yscaled 1/3 rotated 30;
1285 save t; transform t;
1286 t=identity rotatedaround((.5w,.5h),-90);
1287 x2=.35w; x3=good.x .6w;
1288 y2=good.y .1h; top y3=round .4h+eps;
1289 save p; path p; p=z2{right}...{up}z3;
1290 top z1=point .5 of p transformed t;
1291 draw z1...z2{right}...{up}z3;
1292 addto currentpicture also currentpicture transformed t;
1293 addto currentpicture also currentpicture transformed(t transformed t);
1294 labels.bot(1,3); labels.rt(2); endchar;
1295
1296 "Figure 16a"; % circular pen polygon
1297 clear_all;
1298 path p;
1299 p=makepath(pencircle scaled 20) scaled 10 shifted (110,110);
1300 if length p<>32: error; fi
1301 fill p;
1302 for k=1 upto length p: heavy_dot point k of p; endfor
1303 for x=0 step 10 until 220: proofrule((x,0),(x,220)); endfor
1304 for y=0 step 10 until 220: proofrule((0,y),(220,y)); endfor
1305 proofrulethickness .8;
1306 proofrule ((0,110),(220,110)); proofrule ((110,0),(110,220));
1307 makelabel.bot.nodot("ignore",(160,-10)); % kludge for GFtoEPS!
1308 showit;
1309 shipit;
1310
1311 "Figure 16b"; % elliptical pen polygon
1312 clear_all;
1313 path p;
1314 p=makepath(pencircle xscaled 30 yscaled 20) scaled 10 shifted (160,110);
1315 if length p<>40: error; fi
1316 fill p;
1317 for k=1 upto length p: heavy_dot point k of p; endfor
1318 for x=0 step 10 until 320: proofrule((x,0),(x,220)); endfor
1319 for y=0 step 10 until 220: proofrule((0,y),(320,y)); endfor
1320 proofrulethickness .8;
1321 proofrule ((0,110),(320,110)); proofrule ((160,0),(160,220));
1322 makelabel.bot.nodot("ignore",(160,-10)); % kludge for GFtoEPS!
1323 showit;
1324 shipit;
1325
1326 "Figure 16c"; % elliptical pen hexagon
1327 clear_all;
1328 path p;
1329 p=makepath((pencircle xscaled 30) yscaled 20) scaled 10 shifted (160,110);
1330 if length p<>6: error; fi
1331 fill p;
1332 for k=1 upto length p: heavy_dot point k of p; endfor
1333 for x=0 step 10 until 320: proofrule((x,0),(x,220)); endfor
1334 for y=0 step 10 until 220: proofrule((0,y),(320,y)); endfor
1335 proofrulethickness .8;
1336 proofrule ((0,110),(320,110)); proofrule ((160,0),(160,220));
1337 makelabel.bot.nodot("ignore",(160,-10)); % kludge for GFtoEPS!
1338 showit;
1339 shipit;
1340
1341 "Figure 16d"; % cutoff version of Figure 3n
1342 clear_all;
1343 z1=(0,100); z2=(100,100); z3=(200,100);
1344 z4=(0,0); z5=(100,0); z6=(200,0);
1345 path p; p=z4..controls z1 and z2..z6;
1346 cutdraw p;
1347 makelabel.rt.nodot("1",z1+(2,0));
1348 makelabel.rt.nodot("2",z2+(2,0));
1349 makelabel.rt.nodot("3",z3+(2,0));
1350 makelabel.rt.nodot(" 4",z4);
1351 makelabel.rt.nodot("5",z5+(2,0));
1352 makelabel.rt.nodot(" 6",z6);
1353 for k=1 upto 6: heavy_dot z[k]; endfor;
1354 showit;
1355 shipit;
1356
1357 "Figure 16e"; % cutoff version of Figure 4b
1358 alpha:=.45; % controls bar location and similar things
1359 beta:=.2; % controls squareness of bowls
1360 numeric h#, xx#, yy#, o#, s#, u#, ph#, pv#;
1361 numeric leftstemloc, barheight;
1362 h#=6; % height of characters, in pt
1363 xx#=0.6; % extra length of certain features, in pt
1364 u#=4/9; % unit width, in pt
1365 s#=0; % extra sidebar, in pt
1366 o#=1/9; % overshoot of curves, in pt
1367 ph#=2/3; % horizontal thickness of pen, in pt
1368 yy#=xx#; define_whole_pixels(xx,yy);
1369 define_pixels(s,u);
1370 define_corrected_pixels(o);
1371 pv#=.9ph#; define_blacker_pixels(ph,pv);
1372 pickup pencircle xscaled ph yscaled pv;
1373 logo_pen:=savepen;
1374 leftstemloc:=good.x((2.5u#+s#)*pt);
1375 barheight:=good.y(alpha*h#*pt);
1376 def beginlogochar(suffix c)(expr n) = % code c; width is n units plus sidebars
1377 beginchar(str c,n*u#+2s#,h#,0); pickup logo_pen enddef;
1378
1379 beginlogochar(T,13);
1380 if odd(w-ph): w:=w+1; fi % allows a symmetric stem
1381 x1+x2=2x3=2x4=w; lft.x1=0;
1382 y1=y2=y3; top.y1=h; y4=0;
1383 draw z1--z2;
1384 cutoff(z1,170);
1385 cutoff(z2,-10);
1386 draw z3--z4;
1387 cutoff(z4,-80);
1388 labels.rt(1);
1389 labels.lft(2);
1390 labels.bot(3);
1391 makelabel.top("4",z4);
1392 endchar;
1393
1394 "Figure 16f"; % tilde with pencircle
1395 clear_all;
1396 pickup pencircle xscaled .8pt yscaled .2pt rotated 50;
1397 z1=(0,0); z4=(200,30);
1398 z2-z1=z4-z3=whatever*dir 50;
1399 y2-y1=3(y4-y1);
1400 draw z1..controls z2 and z3..z4;
1401 makelabel.lft("1 ",z1);
1402 makelabel.rt(" 4",z4);
1403 showit;
1404 shipit;
1405
1406 "Figure 16g"; % tilde with pensquare
1407 clear_all;
1408 pickup pensquare xscaled .8pt yscaled .2pt rotated 50;
1409 z1=(0,0); z4=(200,30);
1410 z2-z1=z4-z3=whatever*dir 50;
1411 y2-y1=3(y4-y1);
1412 draw z1..controls z2 and z3..z4;
1413 makelabel.lft("1 ",z1);
1414 makelabel.rt(" 4",z4);
1415 showit;
1416 shipit;
1417
1418 "Figure 16h"; % fancy serif with pencircle
1419 clear_all;
1420 pickup pencircle xscaled .8pt yscaled .2pt rotated 20;
1421 z1=(20,175); bot z3=(0,0);
1422 z4=(50,0); z6=(25,175);
1423 x2=x1; z2=z3+whatever*dir 20;
1424 x5=x6; z5=z4+whatever*dir -20;
1425 pair dishing; dishing=(8,0) rotated 20;
1426 filldraw z1..controls z2..z3
1427 --(flex(z3,.5[z3,z4]+dishing,z4))shifted(0,-epsilon)
1428 -- z4..controls z5..z6--cycle;
1429 showit;
1430 labels.lft(1,2,3);
1431 labels.rt(4,5,6);
1432 shipit;
1433
1434 "Figure 16i"; % fancy serif with pensquare
1435 clear_all;
1436 pickup pensquare xscaled .8pt yscaled .2pt rotated 20;
1437 z1=(20,175); bot z3=(0,0);
1438 z4=(50,0); z6=(25,175);
1439 x2=x1; z2=z3+whatever*dir 20;
1440 x5=x6; z5=z4+whatever*dir -20;
1441 pair dishing; dishing=(8,0) rotated 20;
1442 filldraw z1..controls z2..z3
1443 --(flex(z3,.5[z3,z4]+dishing,z4))shifted(0,-epsilon)
1444 -- z4..controls z5..z6--cycle;
1445 showit;
1446 labels.lft(1,2,3);
1447 labels.rt(4,5,6);
1448 shipit;
1449
1450 "Figure 18a"; % O of METAFONT logo
1451 alpha:=.45; % controls bar location and similar things
1452 beta:=.2; % controls squareness of bowls
1453 numeric h#, xx#, yy#, o#, s#, u#, ph#, pv#;
1454 numeric leftstemloc, barheight;
1455 h#=6; % height of characters, in pt
1456 xx#=0.6; % extra length of certain features, in pt
1457 u#=4/9; % unit width, in pt
1458 s#=0; % extra sidebar, in pt
1459 o#=1/9; % overshoot of curves, in pt
1460 ph#=2/3; % horizontal thickness of pen, in pt
1461 yy#=xx#; define_whole_pixels(xx,yy);
1462 define_pixels(s,u);
1463 define_corrected_pixels(o);
1464 pv#=.9ph#; define_blacker_pixels(ph,pv);
1465 pickup pencircle xscaled ph yscaled pv;
1466 logo_pen:=savepen;
1467 leftstemloc:=good.x((2.5u#+s#)*pt);
1468 barheight:=good.y(alpha*h#*pt);
1469 def beginlogochar(expr c)(expr n) = % code c; width is n units plus sidebars
1470 beginchar(c,n*u#+2s#,h#,0); pickup logo_pen enddef;
1471
1472 def super_half(suffix i,j,k) =
1473 draw z.i{0,y.j-y.i}
1474 ... (.8[x.j,x.i],.8[y.i,y.j]){z.j-z.i}
1475 ... z.j{x.k-x.i,0}
1476 ... (.8[x.j,x.k],.8[y.k,y.j]){z.k-z.j}
1477 ... z.k{0,y.k-y.j} enddef;
1478
1479 beginlogochar("O",15);
1480 x1=x4=.5w; top y1=h+o; bot y4=-o;
1481 x2=w-x3=good.x(1.5u+s);
1482 y2=y3=barheight;
1483 super_half(2,1,3); super_half(3,4,2);
1484 labels.lft(2); labels.rt(1,3,4); endchar;
1485
1486 "Figure A18a"; % A of METAFONT logo
1487 alpha:=.45; % controls bar location and similar things
1488 beta:=.2; % controls squareness of bowls
1489 numeric h#, xx#, yy#, o#, s#, u#, ph#, pv#;
1490 numeric leftstemloc, barheight;
1491 h#=6; % height of characters, in pt
1492 xx#=0.6; % extra length of certain features, in pt
1493 u#=4/9; % unit width, in pt
1494 s#=0; % extra sidebar, in pt
1495 o#=1/9; % overshoot of curves, in pt
1496 ph#=2/3; % horizontal thickness of pen, in pt
1497 yy#=xx#; define_whole_pixels(xx,yy);
1498 define_pixels(s,u);
1499 define_corrected_pixels(o);
1500 pv#=.9ph#; define_blacker_pixels(ph,pv);
1501 pickup pencircle xscaled ph yscaled pv;
1502 logo_pen:=savepen;
1503 leftstemloc:=good.x((2.5u#+s#)*pt);
1504 barheight:=good.y(alpha*h#*pt);
1505 def beginlogochar(expr c)(expr n) = % code c; width is n units plus sidebars
1506 beginchar(c,n*u#+2s#,h#,0); pickup logo_pen enddef;
1507
1508 def super_half(suffix i,j,k) =
1509 draw z.i{0,y.j-y.i}
1510 ... (.8[x.j,x.i],.8[y.i,y.j]){z.j-z.i}
1511 ... z.j{x.k-x.i,0}
1512 ... (.8[x.j,x.k],.8[y.k,y.j]){z.k-z.j}
1513 ... z.k{0,y.k-y.j} enddef;
1514
1515 beginlogochar("A",15);
1516 x1=.5w;
1517 x2=x4=leftstemloc;
1518 x3=x5=w-x2;
1519 top y1=h+o;
1520 y2=y3=barheight;
1521 bot y4=bot y5=-o;
1522 draw z4--z2--z3--z5;
1523 super_half(2,1,3);
1524 labels.top(2,3,4,5);
1525 labels.rt(1);
1526 endchar;
1527
1528 "Figure 18b"; % serif points
1529 clear_all;
1530 def serif(suffix $)(expr breadth,theta,left_jut,right_jut)=
1531 penpos$(breadth/abs sind theta,0);
1532 z$a-z$l=z$f-z$r=(bracket/abs sind theta)*dir theta;
1533 y$c=y$d; y$b=y$e=y$; y$b-y$c=if theta<0:-fi slab;
1534 x$b=x$c=x$l-left_jut; x$d=x$e=x$r+right_jut;
1535 enddef;
1536
1537 def serif_edge suffix $ =
1538 (serif_bracket($a,$l,$b)--z$c
1539 --z$d--reverse serif_bracket($f,$r,$e)) enddef;
1540
1541 def serif_bracket(suffix i,j,k) =
1542 (z.i{z.j-z.i}...serif_darkness[z.j,.5[z.i,z.k] ]{z.k-z.i}
1543 ...z.k{z.k-z.j}) enddef;
1544
1545 serif_darkness:=1/4; slab:=50; bracket:=175;
1546 z$=(150,slab);
1547 serif($,100,75,80,90);
1548 pickup pencircle scaled 2; draw serif_edge $;
1549 labels.lft($l,$a);
1550 labels.rt($,$r,$f);
1551 labels.top($b,$e);
1552 labels.bot($c,$d);
1553 showit;
1554 shipit;
1555
1556 "Figure 18c"; % AI by outlines
1557 clear_all;
1558 def serif(suffix $)(expr breadth,theta,left_jut,right_jut)=
1559 penpos$(breadth/abs sind theta,0);
1560 z$a-z$l=z$f-z$r=(bracket/abs sind theta)*dir theta;
1561 y$c=y$d; y$b=y$e=y$; y$b-y$c=if theta<0:-fi slab;
1562 x$b=x$c=x$l-left_jut; x$d=x$e=x$r+right_jut;
1563 enddef;
1564
1565 def serif_edge suffix $ =
1566 (serif_bracket($a,$l,$b)--z$c
1567 --z$d--reverse serif_bracket($f,$r,$e)) enddef;
1568
1569 def serif_bracket(suffix i,j,k) =
1570 (z.i{z.j-z.i}...serif_darkness[z.j,.5[z.i,z.k] ]{z.k-z.i}
1571 ...z.k{z.k-z.j}) enddef;
1572
1573 serif_darkness:=1/3;
1574 slab#:=1/4pt#;
1575 bracket#:=1pt#;
1576 jut#:=.9pt#;
1577 u#:=3/5pt#;
1578 ht#:=7pt#;
1579 thin#:=.5pt#;
1580 thick#:=1.1pt#;
1581 define_pixels(slab,bracket,jut,u,ht,thin,thick);
1582
1583 beginchar("A",13u#,ht#,0);
1584 z1=(.5w,round 1.05h); x4l=w-x5r=u; y4l=y5r=slab;
1585 numeric theta[]; theta4=angle(z1-z4l); theta5=angle(z1-z5r);
1586 serif(4,thin,theta4,.6jut,jut); serif(5,thick,theta5,jut,.6jut);
1587 z0=z4r+whatever*dir theta4=z5l+whatever*dir theta5;
1588 fill z1--serif_edge4--z0 & z0--serif_edge5--z1 & cycle;
1589 penpos2(whatever,theta4); penpos3(whatever,theta5);
1590 y2r=y3r=.5[y4,y0]; y2l=y3l=y2r-thin;
1591 z2=whatever[z1,z4r]; z3=whatever[z1,z5l];
1592 penstroke z2e--z3e;
1593 labels.lft(3,5l,5,4a,5a);
1594 labels.rt(2,4r,4f,5f);
1595 labels.top(1,2r,3r,4l,5r,4b,4e,5b,5e);
1596 labels.bot(0,2l,3l,4,4c,4d,5c,5d);
1597
1598 ww:=w; % special hacks to get two on one
1599 picture tmp; tmp:=currentpicture;
1600 proofrule((w,-d.o_),(w,h.o_));
1601 endgroup;
1602
1603 beginchar("I",6u#,ht#,0);
1604 currentpicture:=tmp;
1605 currenttransform:=currenttransform shifted(ww,0);
1606 x1=x2=.5w; y1=h-y2; y2=slab;
1607 serif(1,thick,-90,1.1jut,1.1jut); serif(2,thick,90,1.1jut,1.1jut);
1608 fill serif_edge 2 -- reverse serif_edge 1 -- cycle;
1609 w:=w+ww;
1610 labels.lft(1a,2a,1l);
1611 labels.rt(1f,2f,1,1r);
1612 labels.top(2l,2,2r,2e,1c,1d);
1613 labels.bot(2d,1b,1e);
1614 makelabel("",z2b); makelabel("",z2c);
1615 makelabel.rt.nodot("2b",z2b+(0,3));
1616 makelabel.rt.nodot("2c",z2c-(0,3));
1617 endchar;
1618
1619 currenttransform:=identity yscaled aspect_ratio;
1620
1621 "Figure A18b"; % H by outlines
1622 clear_all;
1623 def serif(suffix $)(expr breadth,theta,left_jut,right_jut)=
1624 penpos$(breadth/abs sind theta,0);
1625 z$a-z$l=z$f-z$r=(bracket/abs sind theta)*dir theta;
1626 y$c=y$d; y$b=y$e=y$; y$b-y$c=if theta<0:-fi slab;
1627 x$b=x$c=x$l-left_jut; x$d=x$e=x$r+right_jut;
1628 enddef;
1629
1630 def serif_edge suffix $ =
1631 (serif_bracket($a,$l,$b)--z$c
1632 --z$d--reverse serif_bracket($f,$r,$e)) enddef;
1633
1634 def serif_bracket(suffix i,j,k) =
1635 (z.i{z.j-z.i}...serif_darkness[z.j,.5[z.i,z.k] ]{z.k-z.i}
1636 ...z.k{z.k-z.j}) enddef;
1637
1638 serif_darkness:=1/3;
1639 slab#:=1/4pt#;
1640 bracket#:=1pt#;
1641 jut#:=.9pt#;
1642 u#:=3/5pt#;
1643 ht#:=7pt#;
1644 thin#:=.5pt#;
1645 thick#:=1.1pt#;
1646 define_pixels(slab,bracket,jut,u,ht,thin,thick);
1647
1648 beginchar("H",13u#,ht#,0);
1649 x1=x2=x5=3u; x3=x4=x6=w-x1; y1c=y3c=h; y2c=y4c=0;
1650 serif(1,thick,-90,jut,jut);
1651 serif(2,thick,90,jut,jut);
1652 serif(3,thick,-90,jut,jut);
1653 serif(4,thick,90,jut,jut);
1654 fill serif_edge 2 -- reverse serif_edge 1 -- cycle;
1655 fill serif_edge 4 -- reverse serif_edge 3 -- cycle;
1656 penpos5(thin,90); penpos6(thin,90);
1657 y5=y6=.52h; penstroke z5e--z6e;
1658 labels.lft(1a,2a,3a,4a,5,1,2,1l,2l,3l,4l);
1659 labels.rt(1f,2f,3f,4f,6,3,4,1r,2r,3r,4r);
1660 labels.top(1c,1d,2b,2e,4b,4e,3c,3d,5r,6r);
1661 labels.bot(1b,1e,2c,2d,4c,4d,3b,3e,5l,6l);
1662 endchar;
1663
1664 "Figure 18d"; % AI by broadpen
1665 clear_all;
1666 def bot_serif(suffix $)(expr xx,theta,left_jut,right_jut)=
1667 penpos$(xx,0);
1668 z$a-z$l=z$f-z$r=(bracket/abs sind theta)*dir theta;
1669 y$c=top y$l; y$d=y$r; x$c=x$l-left_jut; x$d=x$r+right_jut;
1670 z$b=z$l+whatever*dir theta=z$c+whatever*dir phi;
1671 z$e=z$r+whatever*dir theta=z$d+whatever*dir -phi;
1672 enddef;
1673
1674 def top_serif(suffix $)(expr xx,theta,left_jut,right_jut)=
1675 penpos$(xx,0);
1676 z$a-z$l=z$f-z$r=(bracket/abs sind theta)*dir theta;
1677 %y$c=top y$l; y$d=y$r; x$c=x$l-left_jut; x$d=x$r+right_jut;
1678 y$c=y$d=y$; x$c=x$l-left_jut; x$d=x$r+right_jut;
1679 z$b=z$l+whatever*dir theta=z$c+whatever*dir -phi;
1680 z$e=z$r+whatever*dir theta=z$d+whatever*dir phi;
1681 enddef;
1682
1683 def bot_serif_edge suffix $ =
1684 (z$a..controls z$b..z$c
1685 --(flex(z$c,.5[z$c,z$d]+dishing,z$d)) shifted (0,-epsilon)
1686 -- z$d..controls z$e..z$f) enddef;
1687
1688 def top_serif_edge suffix $ =
1689 (z$a..controls z$b..z$c
1690 --(flex(z$c,.5[z$c,z$d]-dishing,z$d)) shifted (0,+epsilon)
1691 -- z$d..controls z$e..z$f) enddef;
1692
1693 phi:=20;
1694 pair dishing; dishing:=(1/4pt,0) rotated phi;
1695 bracket#:=1pt#;
1696 jut#:=.9pt#;
1697 u#:=3/5pt#;
1698 ht#:=7pt#;
1699 px#:=.8pt#;
1700 py#:=.2pt#;
1701 xx#:=.3pt#;
1702 define_pixels(bracket,jut,u,ht,px,py,xx);
1703
1704 pickup pensquare xscaled px yscaled py rotated phi; broad_pen:=savepen;
1705
1706 beginchar("A",13u#,ht#,0); pickup broad_pen;
1707 z1=(.5w,top h); lft x4l=w-rt x5r=1.2u; y4l=y5r=0;
1708 numeric theta[]; theta4=angle(z1-z4l); theta5=angle(z1-z5r);
1709 numeric xxx;
1710 px*sind(theta5-phi)+xxx*sind theta5 = px*cosd phi+xx;
1711 bot_serif(4,0,theta4,.8jut,.8jut);
1712 bot_serif(5,xxx,theta5,.6jut,.8jut);
1713 z0=z4r+whatever*dir theta4=z5l+whatever*dir theta5;
1714 filldraw z1--bot_serif_edge4--z0 & z0--bot_serif_edge5--z1 & cycle;
1715 top y2=top y3=.45 bot y0; z2=whatever[z1,z4r]; z3=whatever[z1,z5l];
1716 draw z2--z3;
1717 labels.lft(4a,4b,4c,4,5l,5a,5c);
1718 labels.rt(4f,4e,5r,5d,5e,5f);
1719 labels.top(1,2,3,5b);
1720 labels.bot(0,4d,5);
1721
1722 ww:=w; % special hacks to get two on one
1723 picture tmp; tmp:=currentpicture;
1724 proofrule((w,-d.o_),(w,h.o_));
1725 endgroup;
1726
1727 beginchar("I",6u#,ht#,0); pickup broad_pen;
1728 currentpicture:=tmp;
1729 currenttransform:=currenttransform shifted(ww,0);
1730 x1=x2=.5w; y1=h; y2=0;
1731 top_serif(1,xx,-90,1.1jut,1.1jut);
1732 bot_serif(2,xx,90,1.1jut,1.1jut);
1733 filldraw bot_serif_edge 2 -- reverse top_serif_edge 1 -- cycle;
1734 labels.lft(1l,2l,1a,1b,1c,2a,2b);
1735 labels.rt(1r,2r,1d,1e,1f,2d,2e,2f);
1736 labels.top(1);
1737 labels.bot(2,2c);
1738 w:=w+ww;
1739 endchar;
1740
1741 currenttransform:=identity yscaled aspect_ratio;
1742
1743 "Figure A18c"; % H by broadpen
1744 clear_all;
1745 def bot_serif(suffix $)(expr xx,theta,left_jut,right_jut)=
1746 penpos$(xx,0);
1747 z$a-z$l=z$f-z$r=(bracket/abs sind theta)*dir theta;
1748 y$c=top y$l; y$d=y$r; x$c=x$l-left_jut; x$d=x$r+right_jut;
1749 z$b=z$l+whatever*dir theta=z$c+whatever*dir phi;
1750 z$e=z$r+whatever*dir theta=z$d+whatever*dir -phi;
1751 enddef;
1752
1753 def top_serif(suffix $)(expr xx,theta,left_jut,right_jut)=
1754 penpos$(xx,0);
1755 z$a-z$l=z$f-z$r=(bracket/abs sind theta)*dir theta;
1756 y$c=y$d=y$; x$c=x$l-left_jut; x$d=x$r+right_jut;
1757 z$b=z$l+whatever*dir theta=z$c+whatever*dir -phi;
1758 z$e=z$r+whatever*dir theta=z$d+whatever*dir phi;
1759 enddef;
1760
1761 def bot_serif_edge suffix $ =
1762 (z$a..controls z$b..z$c
1763 --(flex(z$c,.5[z$c,z$d]+dishing,z$d))shifted (0,-epsilon)
1764 -- z$d..controls z$e..z$f) enddef;
1765
1766 def top_serif_edge suffix $ =
1767 (z$a..controls z$b..z$c
1768 --(flex(z$c,.5[z$c,z$d]-dishing,z$d))shifted (0,+epsilon)
1769 -- z$d..controls z$e..z$f) enddef;
1770
1771 phi:=20;
1772 pair dishing; dishing:=(1/4pt,0) rotated phi;
1773 bracket#:=1pt#;
1774 jut#:=.9pt#;
1775 u#:=3/5pt#;
1776 ht#:=7pt#;
1777 px#:=.8pt#;
1778 py#:=.2pt#;
1779 xx#:=.3pt#;
1780 define_pixels(bracket,jut,u,ht,px,py,xx);
1781
1782 pickup pensquare xscaled px yscaled py rotated phi; broad_pen:=savepen;
1783
1784 beginchar("H",13u#,ht#,0); pickup broad_pen;
1785 x1=x2=x5=3u; x3=x4=x6=w-x1; y1=y3=h; y2=y4=0;
1786 top_serif(1,xx,-90,jut,jut);
1787 bot_serif(2,xx,90,jut,jut);
1788 top_serif(3,xx,-90,jut,jut);
1789 bot_serif(4,xx,90,jut,jut);
1790 filldraw bot_serif_edge 2 -- reverse top_serif_edge 1 -- cycle;
1791 filldraw bot_serif_edge 4 -- reverse top_serif_edge 3 -- cycle;
1792 y5=y6=.52h; draw z5--z6;
1793 labels.lft(l1,2l,3l,4l,1a,1b,1c,2a,2b,2c,3a,3b,3c,4a,4b,4c);
1794 labels.rt(1r,2r,3r,4r,1d,1e,1f,2d,2e,2f,3d,3e,3f,4d,4e,4f);
1795 labels.top(1,3);
1796 labels.bot(2,4,5,6);
1797 endchar;
1798
1799 currenttransform:=identity yscaled aspect_ratio;
1800
1801 "Figure 20a"; % example of `solve'
1802 clear_all;
1803 z1=(0,25); z2=(100,100); z3=(300,100); z4=(320,0);
1804 vardef upward(expr x)=
1805 ypart direction 1 of (z1{z2-z1}..(x,y2)..{z4-z3}z4)>0 enddef;
1806 z=(solve upward(x2,x3),y2);
1807 pickup pencircle scaled 4;
1808 draw z1{z2-z1}..z..{z4-z3}z4;
1809 pickup pencircle scaled 2;
1810 draw z1--z2; draw z3--z4;
1811 makelabel.lft("z1 ",z1);
1812 makelabel.lft("z2 ",z2);
1813 makelabel.rt(" z3",z3);
1814 makelabel.rt(" z4",z4);
1815 makelabel.top.nodot("z",z+(0,2));
1816 forsuffixes $=1,2,3,4,: heavy_dot z$; endfor
1817 showit;
1818 shipit;
1819
1820 "Figure 21a"; % N of METAFONT logo
1821 alpha:=.45; % controls bar location and similar things
1822 beta:=.2; % controls squareness of bowls
1823 numeric h#, xx#, yy#, o#, s#, u#, ph#, pv#;
1824 numeric leftstemloc, barheight;
1825 h#=6; % height of characters, in pt
1826 xx#=0.6; % extra length of certain features, in pt
1827 u#=4/9; % unit width, in pt
1828 s#=0; % extra sidebar, in pt
1829 o#=1/9; % overshoot of curves, in pt
1830 ph#=2/3; % horizontal thickness of pen, in pt
1831 yy#=xx#; define_whole_pixels(xx,yy);
1832 define_pixels(s,u);
1833 define_corrected_pixels(o);
1834 pv#=.9ph#; define_blacker_pixels(ph,pv);
1835 pickup pencircle xscaled ph yscaled pv;
1836 logo_pen:=savepen;
1837 leftstemloc:=good.x((2.5u#+s#)*pt);
1838 barheight:=good.y(alpha*h#*pt);
1839 def beginlogochar(expr c)(expr n) = % code c; width is n units plus sidebars
1840 beginchar(c,n*u#+2s#,h#,0); pickup logo_pen enddef;
1841
1842 beginlogochar("N",15);
1843 x1+x4=x1+x3=x2+x5=w; x1=x2=leftstemloc;
1844 y1=y4=y3-yy; bot.y1=-o; y2=y5; top.y5=h+o;
1845 draw z1--z2--z3; draw z4..z5;
1846 labels.top(1,3,4);
1847 labels.bot(2,5);
1848 endchar;
1849
1850 "Figure 21b"; % random N of METAFONT logo, nine-point size
1851 randomseed:=1;
1852
1853 vardef noise=normaldeviate*.1pt enddef;
1854
1855 ht#:=.9*6pt#;
1856 xgap#:=.9*0.6pt#;
1857 u#:=.91*4/9pt#;
1858 s#:=.08pt#;
1859 o#:=1/10pt#;
1860 px#:=.9*2/3pt#;
1861 ygap#:=(ht#/13.5u#)*xgap#;
1862 leftstemloc#:=2.5u#+s#;
1863 barheight#:=.45ht#;
1864 define_pixels(s,u,xgap,ygap,leftstemloc,barheight);
1865 py#:=.9px#; define_blacker_pixels(px,py);
1866 pickup pencircle xscaled px yscaled py; logo_pen:=savepen;
1867 define_corrected_pixels(o);
1868
1869 def beginlogochar(expr c,n) =
1870 beginchar(c,n*u#+2s#,ht#,0); pickup logo_pen enddef;
1871
1872 beginlogochar("N",15);
1873 x1=leftstemloc+noise;
1874 x2=leftstemloc+noise;
1875 x4=w-leftstemloc+noise;
1876 x5=w-leftstemloc+noise;
1877 bot y1=noise-o;
1878 top y2=h+o+noise;
1879 y3=y4+ygap+noise;
1880 bot y4=noise-o;
1881 top y5=h+o+noise;
1882 z3=whatever[z4,z5];
1883 draw z1--z2--z3; draw z4--z5;
1884 labels.top(1,3,4);
1885 labels.bot(2,5);
1886 endchar;
1887
1888 "Figure 21c"; % random N of METAFONT logo, nine-point size
1889 randomseed:=2;
1890
1891 vardef noise=normaldeviate*.1pt enddef;
1892
1893 ht#:=.9*6pt#;
1894 xgap#:=.9*0.6pt#;
1895 u#:=.91*4/9pt#;
1896 s#:=.08pt#;
1897 o#:=1/10pt#;
1898 px#:=.9*2/3pt#;
1899 ygap#:=(ht#/13.5u#)*xgap#;
1900 leftstemloc#:=2.5u#+s#;
1901 barheight#:=.45ht#;
1902 define_pixels(s,u,xgap,ygap,leftstemloc,barheight);
1903 py#:=.9px#; define_blacker_pixels(px,py);
1904 pickup pencircle xscaled px yscaled py; logo_pen:=savepen;
1905 define_corrected_pixels(o);
1906
1907 def beginlogochar(expr c,n) =
1908 beginchar(c,n*u#+2s#,ht#,0); pickup logo_pen enddef;
1909
1910 beginlogochar("N",15);
1911 x1=leftstemloc+noise;
1912 x2=leftstemloc+noise;
1913 x4=w-leftstemloc+noise;
1914 x5=w-leftstemloc+noise;
1915 bot y1=noise-o;
1916 top y2=h+o+noise;
1917 y3=y4+ygap+noise;
1918 bot y4=noise-o;
1919 top y5=h+o+noise;
1920 z3=whatever[z4,z5];
1921 draw z1--z2--z3; draw z4--z5;
1922 labels.top(1,3,4);
1923 labels.bot(2,5);
1924 endchar;
1925
1926 "Figure 21d"; % random N of METAFONT logo, nine-point size
1927 randomseed:=3;
1928
1929 vardef noise=normaldeviate*.1pt enddef;
1930
1931 ht#:=.9*6pt#;
1932 xgap#:=.9*0.6pt#;
1933 u#:=.91*4/9pt#;
1934 s#:=.08pt#;
1935 o#:=1/10pt#;
1936 px#:=.9*2/3pt#;
1937 ygap#:=(ht#/13.5u#)*xgap#;
1938 leftstemloc#:=2.5u#+s#;
1939 barheight#:=.45ht#;
1940 define_pixels(s,u,xgap,ygap,leftstemloc,barheight);
1941 py#:=.9px#; define_blacker_pixels(px,py);
1942 pickup pencircle xscaled px yscaled py; logo_pen:=savepen;
1943 define_corrected_pixels(o);
1944
1945 def beginlogochar(expr c,n) =
1946 beginchar(c,n*u#+2s#,ht#,0); pickup logo_pen enddef;
1947
1948 beginlogochar("N",15);
1949 x1=leftstemloc+noise;
1950 x2=leftstemloc+noise;
1951 x4=w-leftstemloc+noise;
1952 x5=w-leftstemloc+noise;
1953 bot y1=noise-o;
1954 top y2=h+o+noise;
1955 y3=y4+ygap+noise;
1956 bot y4=noise-o;
1957 top y5=h+o+noise;
1958 z3=whatever[z4,z5];
1959 draw z1--z2--z3; draw z4--z5;
1960 labels.top(1,3,4);
1961 labels.bot(2,5);
1962 endchar;
1963
1964 "Figure 24a"; % Ionian O at 200 pixels/inch
1965 ss:=10;
1966 begingroup interim hppp:=200/72.27; % lowres parameters
1967 interim blacker:=.65; % make pens a bit blacker
1968 interim o_correction:=.4; % but don't overshoot as much
1969 em#:=10pt#; cap#:=7pt#;
1970 thin#:=1/3pt#; thick#:=5/6pt#;
1971 o#:=1/5pt#;
1972 define_pixels(em,cap);
1973 define_blacker_pixels(thin,thick);
1974 define_corrected_pixels(o);
1975 curve_sidebar:=round 1/18em;
1976 pair u,uu,v;
1977 beginchar("O",0.8em#,cap#,0);
1978 penpos1(thick,10); penpos2(.1[thin,thick],90-10);
1979 penpos3(thick,180+10); penpos4(thin,270-10);
1980 x1l=w-x3l=curve_sidebar; x2=x4=.5w;
1981 y1=.49h; y2l=-o; y3=.51h; y4l=h+o;
1982 penstroke (z1e{down}..z2e{right}
1983 ..z3e{up}..z4e{left}..cycle) scaled ss;
1984 for m=0 upto w: proofrule((m*ss,0),(m*ss,h*ss)); endfor
1985 for n=0 upto h: proofrule((0,n*ss),(w*ss,n*ss)); endfor
1986 proofrulethickness 1;
1987 forsuffixes e=l,r:
1988 u:=round((point 0 of path_.e)/ss);
1989 for t=0 step 1/64 until 4:
1990 v:=round((point t of path_.e)/ss);
1991 if u<>v: if abs(u-v)=1: proofrule(u*ss,v*ss);
1992 else: del:=1/128; tt:=t-del;
1993 forever: uu:=round((point tt of path_.e)/ss);
1994 exitif abs(u-uu)=1;
1995 if del=epsilon:ddt;fi
1996 del:=del/2;
1997 tt:=tt if uu=u:+ else:-fi del; endfor
1998 proofrule(u*ss,uu*ss); proofrule(uu*ss,v*ss); fi
1999 u:=v; fi endfor
2000 endfor
2001 showit;
2002 shipit;
2003 endgroup;
2004 endgroup;
2005 numeric u,uu,v;
2006
2007 "Figure 24b"; % Ionian O at 200 pixels/inch, unrounded position
2008 ss:=10;
2009 begingroup interim hppp:=200/72.27; % lowres parameters
2010 interim blacker:=.65; % make pens a bit blacker
2011 interim o_correction:=.4; % but don't overshoot as much
2012 em#:=10pt#; cap#:=7pt#;
2013 thin#:=1/3pt#; thick#:=5/6pt#;
2014 o#:=1/5pt#;
2015 define_pixels(em,cap);
2016 define_blacker_pixels(thin,thick);
2017 define_corrected_pixels(o);
2018 curve_sidebar:= 1/18em;
2019 pair u,uu,v;
2020 beginchar("O",0.8em#,cap#,0);
2021 penpos1(thick,10); penpos2(.1[thin,thick],90-10);
2022 penpos3(thick,180+10); penpos4(thin,270-10);
2023 x1l=w-x3l=curve_sidebar; x2=x4=.5w;
2024 y1=.49h; y2l=-o; y3=.51h; y4l=h+o;
2025 penstroke (z1e{down}..z2e{right}
2026 ..z3e{up}..z4e{left}..cycle) scaled ss;
2027 for m=0 upto w: proofrule((m*ss,0),(m*ss,h*ss)); endfor
2028 for n=0 upto h: proofrule((0,n*ss),(w*ss,n*ss)); endfor
2029 proofrulethickness 1;
2030 forsuffixes e=l,r:
2031 u:=round((point 0 of path_.e)/ss);
2032 for t=0 step 1/64 until 4:
2033 v:=round((point t of path_.e)/ss);
2034 if u<>v: if abs(u-v)=1: proofrule(u*ss,v*ss);
2035 else: del:=1/128; tt:=t-del;
2036 forever: uu:=round((point tt of path_.e)/ss);
2037 exitif abs(u-uu)=1;
2038 if del=epsilon:ddt;fi
2039 del:=del/2;
2040 tt:=tt if uu=u:+ else:-fi del; endfor
2041 proofrule(u*ss,uu*ss); proofrule(uu*ss,v*ss); fi
2042 u:=v; fi endfor
2043 endfor
2044 showit;
2045 shipit;
2046 endgroup;
2047 endgroup;
2048 numeric u,uu,v;
2049
2050 "Figure 24c"; % Fig 24b shifted right .05 pixel
2051 ss:=10;
2052 begingroup interim hppp:=200/72.27; % lowres parameters
2053 interim blacker:=.65; % make pens a bit blacker
2054 interim o_correction:=.4; % but don't overshoot as much
2055 em#:=10pt#; cap#:=7pt#;
2056 thin#:=1/3pt#; thick#:=5/6pt#;
2057 o#:=1/5pt#;
2058 define_pixels(em,cap);
2059 define_blacker_pixels(thin,thick);
2060 define_corrected_pixels(o);
2061 curve_sidebar:= 1/18em;
2062 pair u,uu,v;
2063 beginchar("O",0.8em#,cap#,0);
2064 penpos1(thick,10); penpos2(.1[thin,thick],90-10);
2065 penpos3(thick,180+10); penpos4(thin,270-10);
2066 x1l=w-x3l=curve_sidebar; x2=x4=.5w;
2067 y1=.49h; y2l=-o; y3=.51h; y4l=h+o;
2068 penstroke (z1e{down}..z2e{right}
2069 ..z3e{up}..z4e{left}..cycle) shifted (.05,0) scaled ss;
2070 for m=0 upto w: proofrule((m*ss,0),(m*ss,h*ss)); endfor
2071 for n=0 upto h: proofrule((0,n*ss),(w*ss,n*ss)); endfor
2072 proofrulethickness 1;
2073 forsuffixes e=l,r:
2074 u:=round((point 0 of path_.e)/ss);
2075 for t=0 step 1/64 until 4:
2076 v:=round((point t of path_.e)/ss);
2077 if u<>v: if abs(u-v)=1: proofrule(u*ss,v*ss);
2078 else: del:=1/128; tt:=t-del;
2079 forever: uu:=round((point tt of path_.e)/ss);
2080 exitif abs(u-uu)=1;
2081 if del=epsilon:ddt;fi
2082 del:=del/2;
2083 tt:=tt if uu=u:+ else:-fi del; endfor
2084 proofrule(u*ss,uu*ss); proofrule(uu*ss,v*ss); fi
2085 u:=v; fi endfor
2086 endfor
2087 showit;
2088 shipit;
2089 endgroup;
2090 endgroup;
2091 numeric u,uu,v;
2092
2093 "Figure 24d"; % Fig 24c shifted right .05 pixel
2094 ss:=10;
2095 begingroup interim hppp:=200/72.27; % lowres parameters
2096 interim blacker:=.65; % make pens a bit blacker
2097 interim o_correction:=.4; % but don't overshoot as much
2098 em#:=10pt#; cap#:=7pt#;
2099 thin#:=1/3pt#; thick#:=5/6pt#;
2100 o#:=1/5pt#;
2101 define_pixels(em,cap);
2102 define_blacker_pixels(thin,thick);
2103 define_corrected_pixels(o);
2104 curve_sidebar:= 1/18em;
2105 pair u,uu,v;
2106 beginchar("O",0.8em#,cap#,0);
2107 penpos1(thick,10); penpos2(.1[thin,thick],90-10);
2108 penpos3(thick,180+10); penpos4(thin,270-10);
2109 x1l=w-x3l=curve_sidebar; x2=x4=.5w;
2110 y1=.49h; y2l=-o; y3=.51h; y4l=h+o;
2111 penstroke (z1e{down}..z2e{right}
2112 ..z3e{up}..z4e{left}..cycle) shifted (.1,0) scaled ss;
2113 for m=0 upto w: proofrule((m*ss,0),(m*ss,h*ss)); endfor
2114 for n=0 upto h: proofrule((0,n*ss),(w*ss,n*ss)); endfor
2115 proofrulethickness 1;
2116 forsuffixes e=l,r:
2117 u:=round((point 0 of path_.e)/ss);
2118 for t=0 step 1/64 until 4:
2119 v:=round((point t of path_.e)/ss);
2120 if u<>v: if abs(u-v)=1: proofrule(u*ss,v*ss);
2121 else: del:=1/128; tt:=t-del;
2122 forever: uu:=round((point tt of path_.e)/ss);
2123 exitif abs(u-uu)=1;
2124 if del=epsilon:ddt;fi
2125 del:=del/2;
2126 tt:=tt if uu=u:+ else:-fi del; endfor
2127 proofrule(u*ss,uu*ss); proofrule(uu*ss,v*ss); fi
2128 u:=v; fi endfor
2129 endfor
2130 showit;
2131 shipit;
2132 endgroup;
2133 endgroup;
2134 numeric u,uu,v;
2135
2136 "Figure 24e"; % hash mark
2137 numeric u;
2138 u#:=10/18pt#; define_pixels(u);
2139 beginchar(0,15u#,250/36pt#,70/36pt#);
2140 pickup pencircle scaled (.4pt+blacker);
2141 lft x1=round u-eps; x3=x1; x2=x4=w-x1;
2142 y1=y2=good.y(.5[-d,h]+1.1pt); y3=y4=h-d-y1;
2143 draw z1--z2; draw z3--z4;
2144 lft x6=round 3u; x7=w-x6;
2145 x8=good.x .5w; x5-x6=x7-x8;
2146 top y5=top y7=h+eps; bot y6=bot y8=-d-eps;
2147 draw z5--z6; draw z7--z8;
2148 labels.top(6,8);
2149 labels.bot(5,7);
2150 labels.lft(2,4);
2151 labels.rt(1,3);
2152 endchar;
2153
2154 "Figure 24f"; % Ionian O at 200 pixels/inch, autorounding=1
2155 ss:=10;
2156 begingroup interim hppp:=200/72.27; % lowres parameters
2157 interim blacker:=.65; % make pens a bit blacker
2158 interim o_correction:=.4; % but don't overshoot as much
2159 em#:=10pt#; cap#:=7pt#;
2160 thin#:=1/3pt#; thick#:=5/6pt#;
2161 o#:=1/5pt#;
2162 define_pixels(em,cap);
2163 define_blacker_pixels(thin,thick);
2164 define_corrected_pixels(o);
2165 curve_sidebar:= 1/18em;
2166 interim autorounding:=1;
2167 interim granularity:=10;
2168 beginchar("O",0.8em#,cap#,0);
2169 penpos1(thick,10); penpos2(.1[thin,thick],90-10);
2170 penpos3(thick,180+10); penpos4(thin,270-10);
2171 x1l=w-x3l=curve_sidebar; x2=x4=.5w;
2172 y1=.49h; y2l=-o; y3=.51h; y4l=h+o;
2173 penstroke (z1e{down}..z2e{right}
2174 ..z3e{up}..z4e{left}..cycle) scaled ss;
2175 for m=0 upto w: proofrule((m*ss,0),(m*ss,h*ss)); endfor
2176 for n=0 upto h: proofrule((0,n*ss),(w*ss,n*ss)); endfor
2177 proofrulethickness 1;
2178 pair u;
2179 for v= % pairs gotten from tracingedges on a separate run!
2180 (2,9), (2,6), (3,6), (3,4), (4,4), (4,3), (5,3), (5,2), (6,2),
2181 (6,1), (8,1), (8,0), (14,0), (14,1), (16,1), (16,2), (17,2), (17,3),
2182 (18,3), (18,4), (19,4), (19,7), (20,7), (20,13), (19,13), (19,15),
2183 (18,15), (18,16), (17,16), (17,17), (16,17), (16,18), (14,18), (14,19),
2184 (8,19), (8,18), (6,18), (6,17), (5,17), (5,16), (4,16), (4,15), (3,15),
2185 (3,12), (2,12), (2,9)
2186 :if known u: proofrule(u*ss,v*ss) ; fi
2187 u:=v; endfor
2188
2189 pair u;
2190 for v=
2191 (4,9), (4,7), (5,7), (5,5), (6,5),
2192 (6,4), (7,4), (7,3), (9,3), (9,2), (14,2), (14,3), (15,3), (15,4), (16,4),
2193 (16,5), (17,5), (17,7), (18,7), (18,12), (17,12), (17,14), (16,14),
2194 (16,15), (15,15), (15,16), (13,16), (13,17), (8,17), (8,16), (7,16),
2195 (7,15), (6,15), (6,14), (5,14), (5,12), (4,12), (4,9)
2196 :if known u: proofrule(u*ss,v*ss) ; fi
2197 u:=v; endfor
2198 showit;
2199 shipit;
2200 endgroup;
2201 endgroup;
2202 numeric u;
2203
2204 "Figure 24g"; % Ionian O at 200 pixels/inch, autorounding=2
2205 ss:=10;
2206 begingroup interim hppp:=200/72.27; % lowres parameters
2207 interim blacker:=.65; % make pens a bit blacker
2208 interim o_correction:=.4; % but don't overshoot as much
2209 em#:=10pt#; cap#:=7pt#;
2210 thin#:=1/3pt#; thick#:=5/6pt#;
2211 o#:=1/5pt#;
2212 define_pixels(em,cap);
2213 define_blacker_pixels(thin,thick);
2214 define_corrected_pixels(o);
2215 curve_sidebar:= 1/18em;
2216 interim autorounding:=2;
2217 interim granularity:=10;
2218 beginchar("O",0.8em#,cap#,0);
2219 penpos1(thick,10); penpos2(.1[thin,thick],90-10);
2220 penpos3(thick,180+10); penpos4(thin,270-10);
2221 x1l=w-x3l=curve_sidebar; x2=x4=.5w;
2222 y1=.49h; y2l=-o; y3=.51h; y4l=h+o;
2223 penstroke (z1e{down}..z2e{right}
2224 ..z3e{up}..z4e{left}..cycle) scaled ss;
2225 for m=0 upto w: proofrule((m*ss,0),(m*ss,h*ss)); endfor
2226 for n=0 upto h: proofrule((0,n*ss),(w*ss,n*ss)); endfor
2227 proofrulethickness 1;
2228 pair u;
2229 for v=
2230 (2,9), (2,6), (3,6),
2231 (3,4), (4,4), (4,3), (5,3), (5,2), (6,2), (6,1), (8,1), (8,0), (14,0),
2232 (14,1), (16,1), (16,2), (17,2), (17,3), (18,3), (18,4), (19,4), (19,7),
2233 (20,7), (20,13), (19,13), (19,15), (18,15), (18,16), (17,16), (17,17),
2234 (16,17), (16,18), (14,18), (14,19), (8,19), (8,18), (6,18), (6,17),
2235 (5,17), (5,16), (4,16), (4,15), (3,15), (3,12), (2,12), (2,9)
2236 :if known u: proofrule(u*ss,v*ss) ; fi
2237 u:=v; endfor
2238
2239 pair u;
2240 for v=
2241 (4,9), (4,7), (5,7), (5,5), (6,5),
2242 (6,4), (7,4), (7,3), (9,3), (9,2), (13,2), (13,3), (15,3), (15,4), (16,4),
2243 (16,5), (17,5), (17,7), (18,7), (18,12), (17,12), (17,14), (16,14),
2244 (16,15), (15,15), (15,16), (13,16), (13,17), (9,17), (9,16), (7,16),
2245 (7,15), (6,15), (6,14), (5,14), (5,12), (4,12), (4,9)
2246 :if known u: proofrule(u*ss,v*ss) ; fi
2247 u:=v; endfor
2248 showit;
2249 shipit;
2250 endgroup;
2251 endgroup;
2252 numeric u;
2253
2254 "Figure 24h"; % Ionian O at 200 pixels/inch, autorounding=0, smoothing=1
2255 ss:=10;
2256 begingroup interim hppp:=200/72.27; % lowres parameters
2257 interim blacker:=.65; % make pens a bit blacker
2258 interim o_correction:=.4; % but don't overshoot as much
2259 em#:=10pt#; cap#:=7pt#;
2260 thin#:=1/3pt#; thick#:=5/6pt#;
2261 o#:=1/5pt#;
2262 define_pixels(em,cap);
2263 define_blacker_pixels(thin,thick);
2264 define_corrected_pixels(o);
2265 curve_sidebar:= 1/18em;
2266 beginchar("O",0.8em#,cap#,0);
2267 penpos1(thick,10); penpos2(.1[thin,thick],90-10);
2268 penpos3(thick,180+10); penpos4(thin,270-10);
2269 x1l=w-x3l=curve_sidebar; x2=x4=.5w;
2270 y1=.49h; y2l=-o; y3=.51h; y4l=h+o;
2271 penstroke (z1e{down}..z2e{right}
2272 ..z3e{up}..z4e{left}..cycle) scaled ss;
2273 for m=0 upto w: proofrule((m*ss,0),(m*ss,h*ss)); endfor
2274 for n=0 upto h: proofrule((0,n*ss),(w*ss,n*ss)); endfor
2275 proofrulethickness 1;
2276 pair u;
2277 for v=
2278 (2,9), (2,5), (3,5),
2279 (3,3), (4,3), (4,2), (6,2), (6,1), (8,1), (8,0), (14,0), (14,1), (16,1),
2280 (16,2), (17,2), (17,3), (18,3), (18,4), (19,4), (19,6), (20,6), (20,14),
2281 (19,14), (19,16), (18,16), (18,17), (16,17), (16,18), (14,18), (14,19),
2282 (8,19), (8,18), (6,18), (6,17), (5,17), (5,16), (4,16), (4,15), (3,15),
2283 (3,13), (2,13), (2,9)
2284 :if known u: proofrule(u*ss,v*ss) ; fi
2285 u:=v; endfor
2286
2287 pair u;
2288 for v=
2289 (4,10), (4,9), (5,9), (5,5), (6,5),
2290 (6,4), (7,4), (7,3), (8,3), (8,2), (14,2), (14,3), (15,3), (15,4), (16,4),
2291 (16,6), (17,6), (17,8), (18,8), (18,10), (17,10), (17,13), (16,13),
2292 (16,15), (15,15), (15,16), (14,16), (14,17), (8,17), (8,16), (7,16),
2293 (7,15), (6,15), (6,13), (5,13), (5,11), (4,11), (4,10)
2294 :if known u: proofrule(u*ss,v*ss) ; fi
2295 u:=v; endfor
2296 showit;
2297 shipit;
2298 endgroup;
2299 endgroup;
2300 numeric u;
2301
2302 "Figure 27a"; % Modification of Fig. 14b
2303 clear_all;
2304 pair zz[];
2305 zz1=(0,509);
2306 zz2=(-14,492);
2307 zz3=(-32,481);
2308 zz4=(-42,455);
2309 zz5=(-62,430);
2310 zz6=(-20,452);
2311 zz7=(42,448);
2312 zz8=(38,465);
2313 zz9=(4,493);
2314 for n=1 upto 9: z[n-1]=(zz[n]+(62,-430)) scaled 2.5; heavy_dot z[n-1]; endfor
2315 pickup pencircle scaled 3;
2316 draw flex(z0,z1,z2)&flex(z2,z3,z4)
2317 &flex(z4,z5,z6)&flex(z6,z7,z8,z0)&cycle;
2318 labels.lft(1,2,3,4);
2319 labels.rt(0,6,7,8);
2320 labels.bot(5);
2321 showit; shipit;
2322
2323 "Figure Da"; % Neenie's problem
2324 clear_all;
2325 z1l=(0,240-y); z1r=(15,288-y);
2326 z0l-z0r=z1l-z1r; z0r=(144,189-y); y0l=0;
2327 pickup pencircle scaled 2;
2328 numeric a,b,c,d;
2329 a=x1l; b=y1r; (c,d)=z0r;
2330 draw z0l--z0r--z1r--z1l--cycle;
2331 proofrule((a,d),(a,b)); proofrule((a,b),(a-d+b,b));
2332 for z=z0l,z0r,z1l,z1r,(a,b): heavy_dot z; endfor
2333 makelabel.bot.nodot("<=",z1r+(3,-8));
2334 makelabel.lft("(a,b)",(a,b));
2335 makelabel.top("z1r",z1r);
2336 makelabel.lft("z1l",z1l);
2337 makelabel.rt("(c,d)",z0r);
2338 makelabel.lft("z0r ",z0r);
2339 makelabel.lft("z0l ",z0l);
2340 showit; shipit;
2341
2342 "Figure Ea"; % T of METAFONT logo, with italic correction
2343 alpha:=.45; % controls bar location and similar things
2344 beta:=.2; % controls squareness of bowls
2345 numeric h#, xx#, yy#, o#, s#, u#, ph#, pv#;
2346 numeric leftstemloc, barheight;
2347 h#=6; % height of characters, in pt
2348 xx#=0.6; % extra length of certain features, in pt
2349 u#=4/9; % unit width, in pt
2350 s#=0; % extra sidebar, in pt
2351 o#=1/9; % overshoot of curves, in pt
2352 ph#=2/3; % horizontal thickness of pen, in pt
2353 yy#=xx#; define_whole_pixels(xx,yy);
2354 define_pixels(s,u);
2355 define_corrected_pixels(o);
2356 pv#=.9ph#; define_blacker_pixels(ph,pv);
2357 pickup pencircle xscaled ph yscaled pv;
2358 logo_pen:=savepen;
2359 leftstemloc:=good.x((2.5u#+s#)*pt);
2360 barheight:=good.y(alpha*h#*pt);
2361 def beginlogochar(suffix c)(expr n) = % code c; width is n units plus sidebars
2362 beginchar(str c,n*u#+2s#,h#,0); pickup logo_pen enddef;
2363 slant:=0;
2364
2365 beginlogochar(T,13);
2366 italcorr h#*slant+.5u#;
2367 if odd(w-ph): w:=w+1; fi % allows a symmetric stem
2368 x1+x2=2x3=2x4=w; lft.x1=-epsilon; % I tried s-o instead; was not as good
2369 y1=y2=y3; top.y1=h; bot.y4=-o;
2370 draw z1..z2; draw z3..z4;
2371 labels.rt(2,3);
2372 makelabel.top("1",z1);
2373 makelabel.top("4",z4);
2374 endchar;
2375
2376 "Figure Eb"; % F of METAFONT logo
2377 alpha:=.45; % controls bar location and similar things
2378 beta:=.2; % controls squareness of bowls
2379 numeric h#, xx#, yy#, o#, s#, u#, ph#, pv#;
2380 numeric leftstemloc, barheight;
2381 h#=6; % height of characters, in pt
2382 xx#=0.6; % extra length of certain features, in pt
2383 u#=4/9; % unit width, in pt
2384 s#=0; % extra sidebar, in pt
2385 o#=1/9; % overshoot of curves, in pt
2386 ph#=2/3; % horizontal thickness of pen, in pt
2387 yy#=xx#; define_whole_pixels(xx,yy);
2388 define_pixels(s,u);
2389 define_corrected_pixels(o);
2390 pv#=.9ph#; define_blacker_pixels(ph,pv);
2391 pickup pencircle xscaled ph yscaled pv;
2392 logo_pen:=savepen;
2393 leftstemloc:=good.x((2.5u#+s#)*pt);
2394 barheight:=good.y(alpha*h#*pt);
2395 def beginlogochar(suffix c)(expr n) = % code c; width is n units plus sidebars
2396 beginchar(str c,n*u#+2s#,h#,0); pickup logo_pen enddef;
2397
2398 beginlogochar(F,14);
2399 x1=x2=x3=leftstemloc; x4=w-x1+o; x5=x4-xx;
2400 y2=y5; y3=y4; bot.y1=-o; top.y3=h; y2=barheight;
2401 draw z1--z3--z4; draw z2--z5;
2402 labels.rt(2,3);
2403 labels.lft(4,5);
2404 labels.top(1);
2405 endchar;
2406
2407 "Figure Ec"; % cmr10 period
2408 u#:=20/36pt#;
2409 dot_diam#:=38/36pt#;
2410 body_height#:=270/36pt#; % height of tallest characters
2411 asc_height#:=250/36pt#; % height of lowercase ascenders
2412 x_height#:=155/36pt#; % height of lowercase without ascenders
2413 bar_height#:=87/36pt#; % height of crossbar in lowercase e
2414 desc_depth#:=70/36pt#; % depth of lowercase descenders
2415 body_depth#:=90/36pt#;
2416 fine#:=7/36pt#;
2417
2418 define_pixels(u);
2419 define_whole_blacker_pixels(dot_diam,fine);
2420 define_whole_vertical_pixels(body_height,asc_height,x_height,bar_height,
2421 desc_depth,body_depth);
2422
2423 beginchar(".",5u#,dot_diam#,0);
2424 def makebox(text rule) =
2425 for y=0,asc_height,body_height,x_height,bar_height,-desc_depth,-body_depth:
2426 rule((0,y),(w,y)); endfor % horizontals
2427 for x=0,w: rule((x,-body_depth),(x,body_height)); endfor % verticals
2428 for x=u step u until w-1:
2429 rule((x,-body_depth),(x,body_height)); endfor % more verticals
2430 if charic<>0:
2431 rule((w+charic*pt,h.o_),(w+charic*pt,.5h.o_)); fi % italic correction
2432 enddef;
2433 pickup pencircle scaled fine;
2434 penpos1(dot_diam-fine,0); penpos2(dot_diam-fine,90);
2435 x1l=good.x(x1l+.5w-x1); bot y2l=0; z1=z2;
2436 filldraw z1l...z2l...z1r...z2r...cycle; % roundish dot
2437 labels.lft(1,1l);
2438 labels.rt(2,1r);
2439 labels.top(2r);
2440 labels.bot(2l);
2441 endchar;
2442
2443 "Figure Ed"; % cmr10 emdash
2444 u#:=20/36pt#;
2445 dot_diam#:=38/36pt#;
2446 body_height#:=270/36pt#; % height of tallest characters
2447 asc_height#:=250/36pt#; % height of lowercase ascenders
2448 x_height#:=155/36pt#; % height of lowercase without ascenders
2449 bar_height#:=87/36pt#; % height of crossbar in lowercase e
2450 desc_depth#:=70/36pt#; % depth of lowercase descenders
2451 body_depth#:=90/36pt#;
2452 vair#:=8/36pt#; % vertical diameter of hairlines
2453
2454 define_pixels(u);
2455 define_whole_blacker_pixels(dot_diam,vair);
2456 define_whole_vertical_pixels(body_height,asc_height,x_height,bar_height,
2457 desc_depth,body_depth);
2458
2459 beginchar(oct"174",18u#,x_height#,0);
2460 def makebox(text rule) =
2461 for y=0,asc_height,body_height,x_height,bar_height,-desc_depth,-body_depth:
2462 rule((0,y),(w,y)); endfor % horizontals
2463 for x=0,w: rule((x,-body_depth),(x,body_height)); endfor % verticals
2464 for x=u step u until w-1:
2465 rule((x,-body_depth),(x,body_height)); endfor % more verticals
2466 if charic<>0:
2467 rule((w+charic*pt,h.o_),(w+charic*pt,.5h.o_)); fi % italic correction
2468 enddef;
2469 italcorr .61803x_height#*0 + .5u#;
2470 pickup nullpen;
2471 penpos1(vair,90); penpos2(vair,90);
2472 y1r=y2r=good.y(y1r+.61803h-y1);
2473 lft x1=-eps; rt x2=w+eps;
2474 penstroke z1e--z2e; % crossbar
2475 labels.lft(1);
2476 labels.rt(2);
2477 labels.top(1r,2r);
2478 labels.bot(1l,2l);
2479 endchar;
2480
2481 bye