]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-nummer-code.mf
b0fca2d4824281e71a6f5422e71ba4685376bbfc
[lilypond.git] / mf / feta-nummer-code.mf
1 % feta-nummer-code.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--2007 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 4 h + b = 1.15;
25 10 h + b = 1;
26 fatten := number_design_size * h + b;
27
28 save b, h;
29 4 h + b = 1.05;
30 10 h + 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 := 42;     % , 43
246
247 fet_beginchar ("Plus", "plus");
248         set_char_box (0, .5 height#, -0.25 height#, 0.75 height#);
249
250         save hthick, vthick, size, outer_hsize, outer_vsize;
251
252         hthick# = vthick# = 2 linethickness#;
253         size# = 1.1 staff_space#;
254         define_whole_blacker_pixels (vthick);
255         define_whole_vertical_blacker_pixels (hthick);
256
257         outer_hsize = hround ((b + w - vthick) / 2);
258         outer_vsize = vround ((h + d - hthick) / 2);
259
260         centerx := hround (w / 2);
261         centery := vround ((h - d) / 2);
262
263         z1 = (centerx - hthick / 2, -d); 
264         z2 = (centerx + hthick / 2, h); 
265
266         labels (1, 2);
267
268         draw_rounded_block (z1, z2, hthick);
269         draw_rounded_block ((0, centery - vthick / 2),
270                             (w, (centery + vthick / 2)),
271                             vthick);
272 fet_endchar;
273
274
275 code := 43;     % , = 44
276
277 fet_beginchar ("Numeral comma", "comma");
278         save pat, pos;
279         path pat;
280
281         set_char_box (0, dot_diam#, 3/2 dot_diam#, dot_diam#);
282
283         pat := (dot_diam / 2, 0)
284                .. (dot_diam, dot_diam / 2)
285                .. (dot_diam / 2, dot_diam)
286                .. (0, dot_diam / 2)
287                .. cycle;
288         
289         pos = ypart (((w / 3, 0) -- (w / 3, dot_diam / 2))
290                      intersectiontimes pat);
291         z0 = point pos of pat;
292
293         alpha = 65;
294         penpos1 (thin, alpha + 90);
295
296         z1l = (w / 2, -1.5 h + hair);
297         z2 = (w, h / 2);
298
299         pickup feta_fillpen;
300
301         % include z0 to assist removal of overlaps
302         fill subpath (0,3) of pat
303              .. z0
304              .. cycle;
305         filldraw z1l{dir (alpha)}
306                  .. {up}z2
307                  -- z0{direction pos of pat}
308                  ..tension 0.95.. {dir (180 + alpha)}z1r
309                  .. cycle;
310
311         labels (0, 2);
312         penlabels (1);
313 fet_endchar;
314
315
316 fet_beginchar ("Numeral dash", "hyphen");
317         set_char_box (0, height# / 3, 0, height#);
318
319         draw_rounded_block ((-b, h / 3 - thin / 2),
320                             (w, h / 3 + thin / 2), thin);
321 fet_endchar;
322
323
324 fet_beginchar ("Numeral dot", "period");
325         set_char_box (0, dot_diam#, 0, dot_diam#);
326
327         pickup pencircle scaled dot_diam;
328
329         drawdot (dot_diam / 2, dot_diam / 2);
330 fet_endchar;
331
332
333 % skip slash
334
335 code := 47;     % 0 = 48
336
337 fet_beginchar ("Numeral 0", "zero");
338         set_char_box (0, 11/15 height# * widen, 0, height#);
339
340         message "w:" & decimal w;
341         message "h:" & decimal h;
342
343         penpos1 (thin, 90);
344         penpos2 (thick, 180);
345         penpos3 (thin,- 90);
346         penpos4 (thick, 0);
347
348         z1r = (w / 2, h);
349         z2r = (0, h / 2);
350         z3r = (w / 2, 0);
351         z4r = (w, h / 2);
352
353         fill z1r
354              .. z2r
355              .. z3r
356              .. z4r
357              .. cycle;
358
359         save t;
360         t = 1 / tense;
361
362         penlabels (1, 2, 3, 4);
363
364         unfill z1l
365                ..tension t.. z2l
366                ..tension t.. z3l
367                ..tension t.. z4l
368                ..tension t.. cycle;
369 fet_endchar;
370
371
372 fet_beginchar ("Numeral 1", "one");
373         save alpha, beta, gamma;
374
375 %       set_char_box (0, 19/30 height# * widen, 0, height#);
376         set_char_box (0, 1/2 foot_width# + 3/2 thick# + 1/2 hair#,
377                       0, height#);
378
379         message "w:" & decimal w;
380         message "h:" & decimal h;
381
382         alpha = 0;
383         calc_kuulleke (thick, alpha);
384         z1 = (3/2 thick, height);
385
386         penpos5 (thick, 0);
387         z5 = (x1, foot_top);
388
389         z6 = (0, h / 2);
390         beta = angle (z1l - z6);
391
392         penpos7 (thin, beta - 90);
393         z7l = z6;
394
395         penpos8 (thin / cosd (beta), -90);
396         z8l = z1l;
397
398         penpos9 (thin, beta - 90);
399         z9r = z8r + (thin / cosd (beta)) * down;
400
401         penlabels (range 1 thru 9);
402
403         gamma = angle (length (z1r - z1), 2 kuulleke);
404
405         fill z2r{dir (alpha - gamma)}
406              .. z4
407              .. {dir (alpha + gamma)}z3l
408              .. z3r{down}
409              -- z5r
410              -- z5l
411              -- z2l{up}
412              .. cycle;
413
414         fill z7l
415              -- z1l{dir (beta)}
416              .. {dir (alpha - gamma)}z2r
417              -- z9r{up}
418              .. {dir (180 + beta)}z9l
419              -- z7r{dir (180 + beta)}
420              .. {dir (beta)}cycle;
421
422         draw_foot (x1);
423 fet_endchar;
424
425
426 fet_beginchar ("Numeral 2", "two");
427         save tolerance;
428         save alpha, beta, gamma, theta;
429         save flare_start_distance;
430         save t, pat, bow;
431         path pat, bow;
432
433         set_char_box (0, 22/30 height# * widen, 0, height#);
434
435         message "w:" & decimal w;
436         message "h:" & decimal h;
437
438         alpha = -45 * widen;
439         beta = 85;
440         gamma = beta - 10;
441         theta = 20 / widen;
442
443         flare_start = 0.25;
444
445         penpos1 (hair, 90 + beta);
446         z1 = (0, 0) + (1/2 sqrt (2) * hair) * dir (45);
447
448         penpos3 (hair,90 + gamma);
449         z3 = (w, thick) + (1/2 sqrt (2) * hair) * dir (-135);
450
451         penpos2 (thick, 90 + alpha - 15);
452         x2 - x1 = x3 - x2;
453         y2 = 10/16 thick / widen;
454
455         tolerance := epsilon;
456
457         % Find proper tension to exactly touch the x axis.
458         % Later on we directly use `bow'.
459         vardef f (expr t) =
460                 bow := z3l{dir (180 + gamma)}
461                        ..tension t.. {dir (180 + alpha -5)}z2l;
462                 ypart (directionpoint left of bow) < 0
463         enddef;
464
465         % the return value of `solve' is stored in a dummy variable
466         t = solve f (0.8, 1.2);
467
468         fill z1r{dir (beta)}
469              ..tension 0.9.. {dir (alpha + 10)}z2r
470              .. {dir (gamma)}z3r
471              .. bow
472              .. {dir (180 + beta)}z1l
473              .. cycle;
474
475         penpos4 (thick, 0);
476         z4r = (w - thin / 2, .71 h);
477
478         penpos5 (hair, 90);
479         y5r = h;
480         x5r = 9/20 w;
481
482         penlabels (range 1 thru 6);
483
484         t := tense;
485
486         pat := z1l{dir (beta)}
487                ..tension t.. z4r{up}
488                .. number_flare_path (z5r, 180, 90, hair, 1.05 flare,
489                                      x5r - 1/2 hair, .21 h, 0.006, 0.4, 1)
490                .. z4l{down}
491                ..tension t.. {dir (180 + beta)}z1r
492                -- cycle;
493
494 %       pickup pencircle scaled 1;
495 %       draw pat;
496
497         fill pat;
498 fet_endchar;
499
500
501 %%
502 % TODO: should widen a bit.  The right edge of the 3 bumps into next glyph in
503 % combinations
504 %
505 fet_beginchar ("Numeral 3", "three");
506         set_char_box (0, 2/3 height# * widen, 0, height#);
507
508         message "w:" & decimal w;
509         message "h:" & decimal h;
510
511         penpos1 (hair, -90);
512
513 %       flare_start = 0.25;
514
515         x1l = 36/80 w;
516         y1l = h;
517
518 %       z1l = (17/16 thick, h);
519
520         penpos2 (7/8 thick, 180);
521         x2l = w - thick / 8;
522         y2l = 3/4 h + thick * 3/32;
523
524         penpos3 (thin, 90);
525         z3 = (w / 2, h / 2 + 1/8 thick);
526
527         penpos4 (thin, 90);
528         z4 = (5/8 thick + 1/2 thin, y3);
529
530         penpos5 (thick, 0);
531         x5r = w;
532         y5r = 17/64 h + thick / 16;
533
534         penpos6 (hair, -90);
535         x6r = 37/80 w;
536         y6r = 0;
537
538         penpos7 (3/2 thin, 90);
539         x7 = .83 w;
540         y7 = y3;
541
542         penlabels (range 1 thru 7);
543
544         save alpha, t, outer_t;
545         alpha = 25;
546         t = tense;
547         outer_t := 0.93;
548
549 %       pickup pencircle scaled 1;
550 %       draw
551         fill number_flare_path (z1l, 180, 90, hair, 7/8 flare, x1l - .5 hair,
552                                 .16 h, 0.06, 1.5, -1)
553              ..tension outer_t.. z2l{down}
554              ..tension outer_t.. z7r{dir (180 + alpha)}
555              .. z7l{dir (-alpha)}
556              ..tension outer_t.. z5r{down}
557              ..tension outer_t.. number_flare_path (z6r, 180, -90, hair,
558                                                     flare, x6l, .18 h, 0.06,
559                                                     1.5, 1)
560              .. z5l{up}
561              ..tension t.. z3l{left}
562              .. z4l{left}
563              .. z4r{right}
564              .. z3r{right}
565              ..tension t.. z2r{up}
566              ..tension t.. cycle;
567 fet_endchar;
568
569
570 fet_beginchar ("Numeral 4", "four");
571         save alpha, beta, gamma;
572
573         set_char_box (0, 4/5 height# * widen, 0, height#);
574
575         message "w:" & decimal w;
576         message "h:" & decimal h;
577
578         alpha = 0;
579         calc_kuulleke (3/2 thick, alpha);
580
581         z1r = (w - 3/4 thick, height);
582         z5 = (thin, 1/4 height + thin);
583
584         beta = angle (z3r - z5);
585
586         penpos6 (thin, -90);
587         z6l = z5;
588
589         penpos7 (thin, -90);
590         y7 = y6;
591         x7 = w - 1/2 thin;
592
593         penpos8 (thin, -alpha);
594         z8r = z5;
595
596         penlabels (range 1 thru 8);
597
598         gamma = angle (length (z1r - z1), 2 kuulleke);
599
600         fill z2r{dir (alpha - gamma)}
601              .. z4
602              .. {dir (alpha + gamma)}z3l
603              .. {dir (180 + beta)}z3r
604              -- z8r
605              -- z7l{right}
606              .. {left}z7r
607              -- z6r{left}
608              ..tension 0.8 and 2.. z8l{dir (beta)}
609              .. {up}z2l
610              .. cycle;
611
612         clearxy;
613
614         alpha := beta;
615         calc_kuulleke (thick, alpha);
616
617         z1r = (w - 3/4 thick, height - (3/2 thin) / cosd (alpha));
618
619         penpos5 (thick, 0);
620         z5 = (x1, foot_top);
621
622         gamma := angle (length (z1r - z1), 2 kuulleke);
623
624         fill z2r{dir (alpha - gamma)}
625              .. z4
626              .. {dir (alpha + gamma)}z3l
627              .. {down}z3r
628              -- z5r
629              -- z5l
630              -- z2l{up}
631              .. cycle;
632
633         penlabels (1, 2, 3, 4, 5);
634
635         draw_foot (x5);
636 fet_endchar;
637
638
639 fet_beginchar ("Numeral 5", "five");
640         save alpha, beta, gamma, delta;
641         save inner_t, outer_t;
642         save pat;
643         path pat;
644
645         set_char_box (0, 27/40 height# * widen, 0, height#);
646
647         message "w:" & decimal w;
648         message "h:" & decimal h;
649
650         alpha = 0;
651         calc_kuulleke (w - thin, alpha);
652
653         z1 = (w / 2 + 1/8 thick, h);
654
655         penpos5 (thin, 0);
656         z5l = (x1l, h - 15/16 thick);
657
658         penpos6 (hair, 90 - 45);
659         z6 = z5r + 1/2 hair * dir (-45);
660
661         penpos7 (thin, 0);
662         z7l = (x1l, h / 2 + thin - hair);
663
664         penlabels (range 1 thru 7);
665
666         gamma = angle (length (z1r - z1), 2 kuulleke);
667
668         pat := z2r{dir (alpha - gamma)}
669                .. z4
670                .. {dir (alpha + gamma)}z3l
671                .. z3r{dir (-135)}
672                .. {left}z6r
673                .. {down}z6l
674                -- z7r{down}
675                .. {up}z7l
676                -- z2l{up}
677                .. cycle;
678
679         beta = 45;
680         delta = 180 + beta + 10;
681         z8r = (x7r, y7r - 1/16 thick + thin);
682         z8l = directionpoint dir (delta) of
683                 subpath (6, 7) of pat;
684
685         % include intersection point to improve overlap removal
686         fill subpath (0, 6) of pat
687              .. z8l
688              .. subpath (7, length (pat)) of pat
689              .. cycle;
690
691         penpos9 (thin, 90);
692         y9 = 10/16 [y5, y7];
693         x9 = .36 [x8r, x10r];
694
695         penpos10 (thick, 0);
696         x10r = w + hair / 2;
697         y10r = 1/2 [y9r, y11r];
698
699         penpos11 (hair, -90);
700         y11r = 0;
701         x11r = .7 [0, x10l];
702
703         penlabels (range 8 thru 12);
704
705         inner_t = 1.0;
706         outer_t = .85;
707
708         fill z8r {dir (beta)}
709              .. z9r{right}
710              ..tension outer_t.. z10r{down}
711              .. number_flare_path (z11r, 180, -90, hair, flare, x11l,
712                                    .18 h, 0.06, 1.5, 1)
713              .. z11l{right}
714              ..tension inner_t.. z10l{up}
715              ..tension inner_t.. z9l{left}
716              .. z8l{dir (delta)}
717              -- cycle;
718 fet_endchar;
719
720
721 fet_beginchar ("Numeral 6", "six");
722         draw_six;
723 fet_endchar;
724
725
726 fet_beginchar ("Numeral 7", "seven");
727         save tolerance;
728         save alpha, beta, gamma, delta;
729         save bow;
730         save x_overshoot;
731
732         path bow;
733
734         set_char_box (0, 11/15 height# * widen - thin#, 0, height#);
735         overshoot_x = .75 thin;
736
737         message "w:" & decimal w;
738         message "h:" & decimal h;
739
740         alpha = -180;
741
742         penpos1 (3/2 thick, 180 + alpha);
743         penpos2 (hair, 180 + alpha - 45);
744         penpos3 (hair, 180 + alpha + 45);
745
746         z2 = z1l + (1/4 sqrt (2) * hair) * dir (alpha - 135);
747         z3 = z1r + (1/4 sqrt (2) * hair) * dir (alpha - 45);
748         z4 = z1 + kuulleke * dir (alpha - 90);
749
750         z1l = (thin, 0);
751
752         beta = 55;
753         penpos5 (thin, 90 + beta);
754         z5 = (w, h) + (1/2 sqrt (2) * thin) * dir (-135) + (overshoot_x, 0);
755
756         gamma = angle (length (z1r - z1), 2 kuulleke);
757         delta = 12;
758
759         pickup pencircle;
760
761         fill z3l{dir (alpha - gamma)}
762              .. z4
763              .. {dir (alpha + gamma)}z2r
764              .. z2l{dir (beta + delta)}
765              .. {dir (beta)}z5r
766              .. z5l{dir (180 + beta)}
767              .. {dir (delta - 90)}z3r
768              .. cycle;
769
770         penlabels (1, 2, 3, 4, 5);
771
772         alpha := -45 * widen;
773
774         penpos11 (1/2 thick, 90);
775         z11 = (3/2 thin, h - (thick + thin) / 2);
776
777         penpos13 (thin, 90 + beta);
778         z13 = z5;
779
780         penpos12 (thick, 90 + alpha);
781         x12 = 1/2 [x11, x13] - 1/4 thick;
782         y12 = h - 15/16 thick + thin * widen;
783
784         penpos14 (thin, 0);
785         z14l = (0, h - thin / 2);
786
787         penpos15 (thin, 0);
788         z15l = (0, h / 2 + thin / 2);
789
790         penpos16 (9/8 thick, 90);
791         z16r = (thin, y11r + 2/16 thick);
792
793         tolerance := epsilon;
794
795         % Find proper tension to exactly touch the x axis.
796         % Later on we directly use `bow'.
797         vardef f (expr t) =
798                 bow := z11r{dir (beta)}
799                        ..tension t.. {dir (alpha)}z12r;
800                 ypart (directionpoint right of bow) > h
801         enddef;
802
803         % the return value of `solve' is stored in a dummy variable
804         t = solve f (0.8, 1.2);
805
806         fill bow
807              .. {dir (beta)}z13r
808              -- z13l{dir (180 + beta)}
809              .. {dir (180 + alpha)}z12l
810              .. {dir (180 + beta)}z11l
811              .. {down}z16l
812              -- z15r{down}
813              .. {up}z15l
814              -- z14l{up}
815              .. {down}z14r
816              -- z16r{down}
817              ..tension 1.5.. {dir (beta)}cycle;
818
819         penlabels (range 11 thru 16);
820 fet_endchar;
821
822
823 fet_beginchar ("Numeral 8", "eight");
824         save alpha, beta;
825
826         set_char_box (0, 11/15 height# * widen, 0, height#);
827
828         message "w:" & decimal w;
829         message "h:" & decimal h;
830
831         alpha = 60;
832         beta = alpha - 15;
833
834         z1 = (w / 2, h / 2 + thick / 8);
835
836         penpos2 (14/8 thin, 0);
837         z2 = (w / 3, h / 2 + thin);
838
839         penpos3 (3/2 thin, 0);
840         z3l = (0, h / 4 + thin / 2);
841
842         penpos4 (hair, 90);
843         z4l = (x1, 0);
844
845         penpos5 (thick, 90 + 90 + alpha);
846         z5 = z1 + w / 4 * dir (alpha - 90);
847
848         penpos6 (thick, 90 + 90 + alpha);
849         z6 = z1 + (w / 4 - thin / 2) * dir (90 + alpha);
850
851         penpos7 (hair, 90);
852         z7r = (x1 + .02 w, h);
853
854         penpos8 (3/2 thin, 0);
855         z8r = (w - thin / 2, 3/4 h + thin / 2);
856
857         penpos9 (13/8 thin, 0);
858         z9 = (2/3 w, h / 2);
859
860         penlabels (range 1 thru 9);
861
862         save t;
863         t = tense;
864
865         fill z2r{dir (180 + beta)}
866              .. z3r{down}
867              .. z4r{right}
868              .. z5r{dir (90 + alpha)}
869              -- z6r{dir (90 + alpha)}
870              ..tension t.. z7r{right}
871              .. z8r{down}
872              .. {dir (180 + beta)}z9r
873              -- z9l{dir (beta)}
874              .. z8l{up}
875              .. z7l{left}
876              .. {dir (alpha - 90)}z6l
877              -- z5l{dir (alpha - 90)}
878              ..tension t.. z4l{left}
879              .. z3l{up}
880              .. {dir (beta)}z2l
881              -- cycle;
882 fet_endchar;
883
884
885 fet_beginchar ("Numeral 9", "nine");
886         draw_six;
887 %       xy_mirror_char;
888
889         currentpicture := currentpicture scaled -1;
890         currentpicture := currentpicture shifted (w, h);
891 fet_endchar;
892
893
894 ligtable "3":
895         "3" kern 0.1 space#,
896         "0" kern 0.1 space#;
897
898 ligtable "2":
899         "7" kern 0.15 space#;