]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-nummer-code.mf
* input/test/compound-time.ly: New file.
[lilypond.git] / mf / feta-nummer-code.mf
1 % feta-nummer.mf -- implement bold Orator numerals
2 %
3 % part of LilyPond's pretty-but-neat music font
4 %
5 % source file of the Feta (not the Font-En-Tja) music font
6 %
7 % (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
8
9
10 height# := number_design_size;
11 space# := number_design_size / 2;
12
13 font_x_height height#;
14 font_normal_space space#;
15
16
17 %
18 % DOCME!
19 %
20 % ugh. b and h are reused.
21 %
22
23 save b, h;
24 4h + b = 1.15;
25 10h + b = 1;
26 fatten := number_design_size * h + b;
27
28 save b, h;
29 4h + b = 1.05;
30 10h + b = 1;
31 widen := number_design_size * h + b;
32
33 tense = 0.85;
34 thick# := 7/30 height# * fatten;
35 thin# := thick# / 4 * fatten + max (.1 (height# / 10 - 1), 0);
36
37 %% sqrt (.8 * blot_diameter# * thin#);
38 hair# := thin# * .8;
39
40 flare# := 9/8 thick# + .75 (height# / 10 - 1);
41
42 save b, h;
43 4h + b = 1/8;
44 10h + b = 1/6;
45 kuulleke# := thick# * number_design_size * h + b;
46 foot_top# := thick#;
47 foot_width# := 9/4 thick#;
48
49
50 %
51 % These numbers were taken from a part that that the EJE violas played
52 % 1997 -- Probably Mendelssohn's ouverture `Heimkehr aus der Fremde'.
53 %
54
55
56 %
57 % TODO all the invocation of flare_path are weird --
58 % the horizontal tangents should be more at the center of the
59 % glyph.
60 %
61
62 define_pixels (height, thick, thick, thin, hair, flare);
63 define_pixels (foot_top, foot_width);
64 define_pixels (kuulleke);
65
66
67 %
68 % Yet Another Bulb Routine with smooth inside curve.
69 %
70 % alpha = start direction.
71 % beta = which side to turn to
72 % flare = diameter of the bulb
73 % line = diameter of line attachment
74 % direction = is ink on left or right side (1 or -1)
75 %
76 %
77 % move_away_to = amount left (for 2)
78 % turn_to  = amount down (for  2 )
79 %
80
81 def number_flare_path (expr pos, alpha, beta, line, flare,
82                        move_away_to, turn_to, taille, taille_ratio,
83                        direction) =
84 begingroup;
85         save res;
86         path res;
87
88         clearxy;
89
90 %       z5 = z2 + 0.43 * flare * dir (alpha - 1.5 beta);
91
92         z4 = (0.75 - taille) [z2r, z2l] + whatever * dir (alpha - beta);
93         z4 = (taille_ratio * taille) [z3l, z3r] + whatever * dir (alpha);
94
95         z1r = pos;
96         z2r = z1r + move_away_to * dir (alpha)
97               + (line + turn_to) * dir (alpha + beta);
98         z3r = 0.5 [z2l, z2r] + 0.5 * flare * dir (alpha + beta);
99
100         penpos1 (line, 180 + beta + alpha);
101         penpos2 (flare, alpha );
102         penpos3 (flare, alpha +  beta);
103
104         penlabels (1, 2, 3, 4, 5);
105
106         res := z1r{dir (alpha)}
107                .. z2r{dir (180 + alpha - beta)}
108                .. z3r{dir (alpha + 180)}
109                .. z2l{dir (alpha - beta)}
110
111 %%% Two versions of the curve: one with z4, the other with z5.
112 %              .. z5{dir (alpha - beta / 2)}
113
114                .. z4{dir (180 + alpha + beta)}
115                .. z1l{dir (alpha + 180)};
116
117 %       pickup pencircle;
118 %       draw res;
119
120         if direction <> 1:
121                 res := reverse res;
122         fi;
123
124 res
125 endgroup
126 enddef;
127
128
129 def calc_kuulleke (expr w, alpha) =
130 begingroup;
131         save beta, gamma;
132
133         beta = (alpha - 90) / 2;
134         gamma = (90 + alpha) / 2;
135
136         penpos1 (w / cosd (alpha), alpha);
137         penpos2 (hair, 90 + beta);
138         penpos3 (hair, gamma - 90);
139
140         z2 = z1l + (1/2 hair / tand ((alpha + 90) / 2)) * dir (beta);
141         z3 = z1r - (1/2 hair / tand ((90 - alpha) / 2)) * dir (gamma);
142         z4 = z1 + kuulleke * dir (alpha - 90);
143 endgroup;
144 enddef;
145
146
147 % should make generic macro?
148 %
149 def draw_foot(expr xpos) =
150 begingroup;
151         clearxy;
152
153         penpos1 (thick, 0);
154         penpos2 (foot_width, 0);
155         penpos3 (hair, -90);
156         penpos4 (hair, 90);
157
158         z1= (xpos, foot_top);
159         z2= (x1, 0);
160         z3r = z2r;
161         z4l = z2l;
162         z5 = (x1, kuulleke);
163
164         penlabels (1, 2, 3, 4);
165
166         fill z1
167              .. {right}z1r{down}
168              .. {right}z3l
169              .. z3r{left}
170              .. z5
171              .. {left}z4l
172              .. z4r{right}
173              .. {up}z1l{right}
174              .. z1
175              .. cycle;
176 endgroup;
177 enddef;
178
179
180 def draw_six =
181         save outer_t, t;
182         save before, after, u, v;
183         path before, after;
184
185         set_char_box (0, .68 height# * widen, 0, height#);
186
187         message "w:" & decimal w;
188         message "h:" & decimal h;
189
190         penpos2 (hair, 90);
191         z2 = (w / 2, h / 2 + thin - hair / 2);
192
193         penpos3 (15/16 thick, 0);
194         x3r = w;
195         y3r = .5 [y4r, y2r];
196
197         penpos4 (hair, -90);
198         z4r = (x2, 0);
199
200         penpos6 (hair, 90);
201         x6r = .56 w;
202         y6r = h;
203
204         penpos7 (thick, 180);
205         x7r = 0;
206         y7r = .50 h;
207
208         penpos10 (thick, 180);
209         z10r = (0, y3);
210
211         penlabels (range 1 thru 10);
212
213         outer_t = 0.88;
214         t := tense;
215
216         before := z7{right}
217                   .. z2r{right};
218         after := z7r{up}
219                  .. number_flare_path (z6r, 0, -90, hair, flare,
220                                        w - x6r - hair / 2, .16 h,
221                                        0.05, 2.5, 1)
222                  .. z7l{down};
223         (u, v) = before intersectiontimes after;
224
225 %       draw
226         fill subpath (u, infinity) of before
227              ..tension outer_t.. z3r{down}
228              ..tension outer_t.. z4r{left}
229              .. subpath (0, v) of after
230              .. cycle;
231
232         unfill z2l{right}
233                ..tension t.. z3l{down}
234                ..tension t.. z4l{left}
235                ..tension t.. z10l{up}
236                ..tension t.. cycle;
237 enddef;
238
239
240 save dot_diam;
241 dot_diam# = 7/8 flare#;
242 define_pixels (dot_diam);
243
244
245 code := 31;     % , 32
246
247 fet_beginchar ("Space", "space");
248         set_char_box (0, space#, 0, height#);
249 fet_endchar;
250
251
252 code := 42;     % , 43
253
254 fet_beginchar ("Plus", "plus");
255         set_char_box (0, .5 height#, -0.25 height#, 0.75 height#);
256
257         save hthick, vthick, size, outer_hsize, outer_vsize;
258
259         hthick# = vthick# = 2 linethickness#;
260         size# = 1.1 staff_space#;
261         define_whole_blacker_pixels (vthick);
262         define_whole_vertical_blacker_pixels (hthick);
263
264         outer_hsize = hround ((b + w - vthick) / 2);
265         outer_vsize = vround ((h + d - hthick) / 2);
266
267         centerx := hround (w/2);
268         centery := vround ((h - d)/2);
269
270         z1 = (centerx - hthick/2, -d); 
271         z2 = (centerx + hthick/2, h); 
272         labels(1,2);
273         draw_rounded_block (z1, z2, hthick);
274         draw_rounded_block ((0, centery - vthick/2),
275           (w, (centery + vthick/2)), vthick);
276 fet_endchar;
277
278
279 code := 43;     % , = 44
280
281 fet_beginchar ("Numeral comma", "comma");
282         save pat, pos;
283         path pat;
284
285         set_char_box (0, dot_diam#, 3/2 dot_diam#, dot_diam#);
286
287         pat := (dot_diam / 2, 0)
288                .. (dot_diam, dot_diam / 2)
289                .. (dot_diam / 2, dot_diam)
290                .. (0, dot_diam / 2)
291                .. cycle;
292         
293         pos = ypart (((w / 3, 0) -- (w / 3, dot_diam / 2))
294                      intersectiontimes pat);
295         z0 = point pos of pat;
296
297         alpha = 65;
298         penpos1 (thin, alpha + 90);
299
300         z1l = (w / 2, -1.5 h + hair);
301         z2 = (w, h / 2);
302
303         pickup feta_fillpen;
304
305         % include z0 to assist removal of overlaps
306         fill subpath (0,3) of pat
307              .. z0
308              .. cycle;
309         filldraw z1l{dir(alpha)}
310                  .. {up}z2
311                  -- z0{direction pos of pat}
312                  ..tension 0.95.. {dir (180 + alpha)}z1r
313                  .. cycle;
314
315         labels (0, 2);
316         penlabels (1);
317 fet_endchar;
318
319
320 fet_beginchar ("Numeral dash", "hyphen");
321         set_char_box (0, height# / 3, 0, height#);
322
323         draw_rounded_block ((-b, h / 3 - thin / 2),
324                             (w, h / 3 + thin / 2), thin);
325 fet_endchar;
326
327
328 fet_beginchar ("Numeral dot", "period");
329         set_char_box (0, dot_diam#, 0, dot_diam#);
330
331         pickup pencircle scaled dot_diam;
332
333         drawdot (dot_diam / 2, dot_diam / 2);
334 fet_endchar;
335
336
337 % skip slash
338
339 code := 47;     % 0 = 48
340
341 fet_beginchar("Numeral 0", "zero");
342         set_char_box (0, 11/15 height# * widen, 0, height#);
343
344         message "w:" & decimal w;
345         message "h:" & decimal h;
346
347         penpos1 (thin, 90);
348         penpos2 (thick, 180);
349         penpos3 (thin,- 90);
350         penpos4 (thick, 0);
351
352         z1r = (w / 2, h);
353         z2r = (0, h / 2);
354         z3r = (w / 2, 0);
355         z4r = (w, h / 2);
356
357         fill z1r
358              .. z2r
359              .. z3r
360              .. z4r
361              .. cycle;
362
363         save t;
364         t = 1 / tense;
365
366         penlabels (1, 2, 3, 4);
367
368         unfill z1l
369                ..tension t.. z2l
370                ..tension t.. z3l
371                ..tension t.. z4l
372                ..tension t.. cycle;
373 fet_endchar;
374
375
376 fet_beginchar ("Numeral 1", "one");
377         save alpha, beta, gamma;
378
379 %       set_char_box (0, 19/30 height# * widen, 0, height#);
380         set_char_box (0, 1/2 foot_width# + 3/2 thick# + 1/2 hair#,
381                       0, height#);
382
383         message "w:" & decimal w;
384         message "h:" & decimal h;
385
386         alpha = 0;
387         calc_kuulleke (thick, alpha);
388         z1 = (3/2 thick, height);
389
390         penpos5 (thick, 0);
391         z5 = (x1, foot_top);
392
393         z6 = (0, h / 2);
394         beta = angle (z1l - z6);
395
396         penpos7 (thin, beta - 90);
397         z7l = z6;
398
399         penpos8 (thin / cosd (beta), -90);
400         z8l = z1l;
401
402         penpos9 (thin, beta - 90);
403         z9r = z8r + (thin / cosd (beta)) * down;
404
405         penlabels (range 1 thru 9);
406
407         gamma = angle (length (z1r - z1), 2 kuulleke);
408
409         fill z2r{dir (alpha - gamma)}
410              .. z4
411              .. {dir (alpha + gamma)}z3l
412              .. z3r{down}
413              -- z5r
414              -- z5l
415              -- z2l{up}
416              .. cycle;
417
418         fill z7l
419              -- z1l{dir (beta)}
420              .. {dir (alpha - gamma)}z2r
421              -- z9r{up}
422              .. {dir (180 + beta)}z9l
423              -- z7r{dir (180 + beta)}
424              .. {dir (beta)}cycle;
425
426         draw_foot (x1);
427 fet_endchar;
428
429
430 fet_beginchar ("Numeral 2", "two");
431         save tolerance;
432         save alpha, beta, gamma, theta;
433         save flare_start_distance;
434         save t, pat, bow;
435         path pat, bow;
436
437         set_char_box (0, 22/30 height# * widen, 0, height#);
438
439         message "w:" & decimal w;
440         message "h:" & decimal h;
441
442         alpha = -45 * widen;
443         beta = 85;
444         gamma = beta - 10;
445         theta = 20 / widen;
446
447         flare_start = 0.25;
448
449         penpos1 (hair, 90 + beta);
450         z1 = (0, 0) + (1/2 sqrt (2) * hair) * dir (45);
451
452         penpos3 (hair,90 + gamma);
453         z3 = (w, thick) + (1/2 sqrt (2) * hair) * dir (-135);
454
455         penpos2 (thick, 90 + alpha - 15);
456         x2 - x1 = x3 - x2;
457         y2 = 10/16 thick / widen;
458
459         tolerance := epsilon;
460
461         % Find proper tension to exactly touch the x axis.
462         % Later on we directly use `bow'.
463         vardef f (expr t) =
464                 bow := z3l{dir (180 + gamma)}
465                        ..tension t.. {dir (180 + alpha -5)}z2l;
466                 ypart (directionpoint left of bow) < 0
467         enddef;
468
469         % the return value of `solve' is stored in a dummy variable
470         t = solve f (0.8, 1.2);
471
472         fill z1r{dir (beta)}
473              ..tension 0.9.. {dir (alpha + 10)}z2r
474              .. {dir (gamma)}z3r
475              .. bow
476              .. {dir (180 + beta)}z1l
477              .. cycle;
478
479         penpos4 (thick, 0);
480         z4r = (w - thin / 2, .71 h);
481
482         penpos5 (hair, 90);
483         y5r = h;
484         x5r = 9/20 w;
485
486         penlabels (range 1 thru 6);
487
488         t := tense;
489
490         pat := z1l{dir (beta)}
491                ..tension t.. z4r{up}
492                .. number_flare_path (z5r, 180, 90, hair, 1.05 flare,
493                                      x5r - 1/2 hair, .21 h, 0.006, 0.4, 1)
494                .. z4l{down}
495                ..tension t.. {dir (180 + beta)}z1r
496                -- cycle;
497
498 %       pickup pencircle scaled 1;
499 %       draw pat;
500
501         fill pat;
502 fet_endchar;
503
504
505 %%
506 % TODO: should widen a bit.  The right edge of the 3 bumps into next glyph in
507 % combinations
508 %
509 fet_beginchar ("Numeral 3", "three");
510         set_char_box (0, 2/3 height# * widen, 0, height#);
511
512         message "w:" & decimal w;
513         message "h:" & decimal h;
514
515         penpos1 (hair, -90);
516
517 %       flare_start = 0.25;
518
519         x1l = 36/80 w;
520         y1l = h;
521
522 %       z1l = (17/16 thick, h);
523
524         penpos2 (7/8 thick, 180);
525         x2l = w - thick / 8;
526         y2l = 3/4 h + thick * 3/32;
527
528         penpos3 (thin, 90);
529         z3 = (w / 2, h / 2 + 1/8 thick);
530
531         penpos4 (thin, 90);
532         z4 = (5/8 thick + 1/2 thin, y3);
533
534         penpos5 (thick, 0);
535         x5r = w;
536         y5r = 17/64 h + thick / 16;
537
538         penpos6 (hair, -90);
539         x6r = 37/80 w;
540         y6r = 0;
541
542         penpos7 (3/2 thin, 90);
543         x7 = .83 w;
544         y7 = y3;
545
546         penlabels (range 1 thru 7);
547
548         save alpha, t, outer_t;
549         alpha = 25;
550         t = tense;
551         outer_t := 0.93;
552
553 %       pickup pencircle scaled 1;
554 %       draw
555         fill number_flare_path (z1l, 180, 90, hair, 7/8 flare, x1l - .5 hair,
556                                 .16 h, 0.06, 1.5, -1)
557              ..tension outer_t.. z2l{down}
558              ..tension outer_t.. z7r{dir (180 + alpha)}
559              .. z7l{dir (-alpha)}
560              ..tension outer_t.. z5r{down}
561              ..tension outer_t.. number_flare_path (z6r, 180, -90, hair,
562                                                     flare, x6l, .18 h, 0.06,
563                                                     1.5, 1)
564              .. z5l{up}
565              ..tension t.. z3l{left}
566              .. z4l{left}
567              .. z4r{right}
568              .. z3r{right}
569              ..tension t.. z2r{up}
570              ..tension t.. cycle;
571 fet_endchar;
572
573
574 fet_beginchar ("Numeral 4", "four");
575         save alpha, beta, gamma;
576
577         set_char_box (0, 4/5 height# * widen, 0, height#);
578
579         message "w:" & decimal w;
580         message "h:" & decimal h;
581
582         alpha = 0;
583         calc_kuulleke (3/2 thick, alpha);
584
585         z1r = (w - 3/4 thick, height);
586         z5 = (thin, 1/4 height + thin);
587
588         beta = angle (z3r - z5);
589
590         penpos6 (thin, -90);
591         z6l = z5;
592
593         penpos7 (thin, -90);
594         y7 = y6;
595         x7 = w - 1/2 thin;
596
597         penpos8 (thin, -alpha);
598         z8r = z5;
599
600         penlabels (range 1 thru 8);
601
602         gamma = angle (length (z1r - z1), 2 kuulleke);
603
604         fill z2r{dir (alpha - gamma)}
605              .. z4
606              .. {dir (alpha + gamma)}z3l
607              .. {dir (180 + beta)}z3r
608              -- z8r
609              -- z7l{right}
610              .. {left}z7r
611              -- z6r{left}
612              ..tension 0.8 and 2.. z8l{dir (beta)}
613              .. {up}z2l
614              .. cycle;
615
616         clearxy;
617
618         alpha := beta;
619         calc_kuulleke (thick, alpha);
620
621         z1r = (w - 3/4 thick, height - (3/2 thin) / cosd (alpha));
622
623         penpos5 (thick, 0);
624         z5 = (x1, foot_top);
625
626         gamma := angle (length (z1r - z1), 2 kuulleke);
627
628         fill z2r{dir (alpha - gamma)}
629              .. z4
630              .. {dir (alpha + gamma)}z3l
631              .. {down}z3r
632              -- z5r
633              -- z5l
634              -- z2l{up}
635              .. cycle;
636
637         penlabels (1, 2, 3, 4, 5);
638
639         draw_foot (x5);
640 fet_endchar;
641
642
643 fet_beginchar ("Numeral 5", "five");
644         save alpha, beta, gamma, delta;
645         save inner_t, outer_t;
646         save pat;
647         path pat;
648
649         set_char_box (0, 27/40 height# * widen, 0, height#);
650
651         message "w:" & decimal w;
652         message "h:" & decimal h;
653
654         alpha = 0;
655         calc_kuulleke (w - thin, alpha);
656
657         z1 = (w / 2 + 1/8 thick, h);
658
659         penpos5 (thin, 0);
660         z5l = (x1l, h - 15/16 thick);
661
662         penpos6 (hair, 90 - 45);
663         z6 = z5r + 1/2 hair * dir (-45);
664
665         penpos7 (thin, 0);
666         z7l = (x1l, h / 2 + thin - hair);
667
668         penlabels (range 1 thru 7);
669
670         gamma = angle (length (z1r - z1), 2 kuulleke);
671
672         pat := z2r{dir (alpha - gamma)}
673                .. z4
674                .. {dir (alpha + gamma)}z3l
675                .. z3r{dir (-135)}
676                .. {left}z6r
677                .. {down}z6l
678                -- z7r{down}
679                .. {up}z7l
680                -- z2l{up}
681                .. cycle;
682
683         beta = 45;
684         delta = 180 + beta + 10;
685         z8r = (x7r, y7r - 1/16 thick + thin);
686         z8l = directionpoint dir (delta) of
687                 subpath (6, 7) of pat;
688
689         % include intersection point to improve overlap removal
690         fill subpath (0, 6) of pat
691              .. z8l
692              .. subpath (7, length (pat)) of pat
693              .. cycle;
694
695         penpos9 (thin, 90);
696         y9 = 10/16 [y5, y7];
697         x9 = .36 [x8r, x10r];
698
699         penpos10 (thick, 0);
700         x10r = w + hair / 2;
701         y10r = 1/2 [y9r, y11r];
702
703         penpos11 (hair, -90);
704         y11r = 0;
705         x11r = .7 [0, x10l];
706
707         penlabels (range 8 thru 12);
708
709         inner_t = 1.0;
710         outer_t = .85;
711
712         fill z8r {dir (beta)}
713              .. z9r{right}
714              ..tension outer_t.. z10r{down}
715              .. number_flare_path (z11r, 180, -90, hair, flare, x11l,
716                                    .18 h, 0.06, 1.5, 1)
717              .. z11l{right}
718              ..tension inner_t.. z10l{up}
719              ..tension inner_t.. z9l{left}
720              .. z8l{dir (delta)}
721              -- cycle;
722 fet_endchar;
723
724
725 fet_beginchar ("Numeral 6", "six");
726         draw_six;
727 fet_endchar;
728
729
730 fet_beginchar ("Numeral 7", "seven");
731         save tolerance;
732         save alpha, beta, gamma, delta;
733         save bow;
734         path bow;
735
736         set_char_box (0, 11/15 height# * widen, 0, height#);
737
738         message "w:" & decimal w;
739         message "h:" & decimal h;
740
741         alpha = -180;
742
743 if true:
744         penpos1 (3/2 thick, 180 + alpha);
745         penpos2 (hair, 180 + alpha - 45);
746         penpos3 (hair, 180 + alpha + 45);
747
748         z2 = z1l + (1/4 sqrt (2) * hair) * dir (alpha - 135);
749         z3 = z1r + (1/4 sqrt (2) * hair) * dir (alpha - 45);
750         z4 = z1 + kuulleke * dir (alpha - 90);
751 else:
752         % does not work
753         calc_kuulleke (3/2 thick, -alpha);
754 fi;
755
756         z1l = (thin, 0);
757
758         beta = 55;
759         penpos5 (thin, 90 + beta);
760         z5 = (w, h) + (1/2 sqrt (2) * thin) * dir (-135);
761
762         gamma = angle (length (z1r - z1), 2 kuulleke);
763         delta = 12;
764
765         pickup pencircle;
766
767         fill z3l{dir (alpha - gamma)}
768              .. z4
769              .. {dir (alpha + gamma)}z2r
770              .. z2l{dir (beta + delta)}
771              .. {dir (beta)}z5r
772              .. z5l{dir (180 + beta)}
773              .. {dir (delta - 90)}z3r
774              .. cycle;
775
776         penlabels (1, 2, 3, 4, 5);
777
778         alpha := -45 * widen;
779
780         penpos11 (1/2 thick, 90);
781         z11 = (3/2 thin, h - (thick + thin) / 2);
782
783         penpos13 (thin, 90 + beta);
784         z13 = z5;
785
786         penpos12 (thick, 90 + alpha);
787         x12 = 1/2 [x11, x13] - 1/4 thick;
788         y12 = h - 15/16 thick + thin * widen;
789
790         penpos14 (thin, 0);
791         z14l = (0, h - thin / 2);
792
793         penpos15 (thin, 0);
794         z15l = (0, h / 2 + thin / 2);
795
796         penpos16 (9/8 thick, 90);
797         z16r = (thin, y11r + 2/16 thick);
798
799         tolerance := epsilon;
800
801         % Find proper tension to exactly touch the x axis.
802         % Later on we directly use `bow'.
803         vardef f (expr t) =
804                 bow := z11r{dir (beta)}
805                        ..tension t.. {dir (alpha)}z12r;
806                 ypart (directionpoint right of bow) > h
807         enddef;
808
809         % the return value of `solve' is stored in a dummy variable
810         t = solve f (0.8, 1.2);
811
812         fill bow
813              .. {dir (beta)}z13r
814              -- z13l{dir (180 + beta)}
815              .. {dir (180 + alpha)}z12l
816              .. {dir (180 + beta)}z11l
817              .. {down}z16l
818              -- z15r{down}
819              .. {up}z15l
820              -- z14l{up}
821              .. {down}z14r
822              -- z16r{down}
823              ..tension 1.5.. {dir (beta)}cycle;
824
825         penlabels (range 11 thru 16);
826 fet_endchar;
827
828
829 fet_beginchar ("Numeral 8", "eight");
830         save alpha, beta;
831
832         set_char_box (0, 11/15 height# * widen, 0, height#);
833
834         message "w:" & decimal w;
835         message "h:" & decimal h;
836
837         alpha = 60;
838         beta = alpha - 15;
839
840         z1 = (w / 2, h / 2 + thick / 8);
841
842         penpos2 (14/8 thin, 0);
843         z2 = (w / 3, h / 2 + thin);
844
845         penpos3 (3/2 thin, 0);
846         z3l = (0, h / 4 + thin / 2);
847
848         penpos4 (hair, 90);
849         z4l = (x1, 0);
850
851         penpos5 (thick, 90 + 90 + alpha);
852         z5 = z1 + w / 4 * dir (alpha - 90);
853
854         penpos6 (thick, 90 + 90 + alpha);
855         z6 = z1 + (w / 4 - thin / 2) * dir (90 + alpha);
856
857         penpos7 (hair, 90);
858         z7r = (x1 + .02 w, h);
859
860         penpos8 (3/2 thin, 0);
861         z8r = (w - thin / 2, 3/4 h + thin / 2);
862
863         penpos9 (13/8 thin, 0);
864         z9 = (2/3 w, h / 2);
865
866         penlabels (range 1 thru 9);
867
868         save t;
869         t = tense;
870
871         fill z2r{dir (180 + beta)}
872              .. z3r{down}
873              .. z4r{right}
874              .. z5r{dir (90 + alpha)}
875              -- z6r{dir (90 + alpha)}
876              ..tension t.. z7r{right}
877              .. z8r{down}
878              .. {dir (180 + beta)}z9r
879              -- z9l{dir (beta)}
880              .. z8l{up}
881              .. z7l{left}
882              .. {dir (alpha - 90)}z6l
883              -- z5l{dir (alpha - 90)}
884              ..tension t.. z4l{left}
885              .. z3l{up}
886              .. {dir (beta)}z2l
887              -- cycle;
888 fet_endchar;
889
890
891 fet_beginchar ("Numeral 9", "nine");
892         draw_six;
893 %       xy_mirror_char;
894
895         currentpicture := currentpicture scaled -1;
896         currentpicture := currentpicture shifted (w, h);
897 fet_endchar;
898
899
900 ligtable "3":
901         "3" kern 0.1 space#,
902         "0" kern 0.1 space#;
903
904 ligtable "2":
905         "7" kern 0.15 space#;