]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-din-code.mf
*** empty log message ***
[lilypond.git] / mf / feta-din-code.mf
1 %%
2 %
3 % TODO: blot diameter should be fixed, not scalable.
4 %
5 %
6
7
8 save serif_thick;
9 serif_thick# = 1.1 linethickness#;
10 define_blacker_pixels (serif_thick);
11 med_thick = round (1.5 linethickness);
12 bottom_blot = 1.3 serif_thick;
13
14
15 code := 32;
16 fet_beginchar("Space", "space", "space")
17         set_char_box(0, horizontal_space#,  0, ex#);
18 fet_endchar;
19
20
21 %
22 % Couldn't find many z examples. This one is losely inspired 
23 % by a sfz from Mueller etuden fuer Horn (Edition Hofmeister.)
24 %
25
26 code := 121;
27 fet_beginchar ("dynamic z", "z", "z");
28         set_char_box (0, .98 ex#, 0, 0.9 ex#);
29
30         save thin_thick, top_narrow, over_shoot;
31         save bot_thick;
32
33         thin_thick = serif_thick;
34         top_narrow = thin_thick;
35         top_overshoot =  .8 serif_thick;
36         top_thick = .3 h ;
37         bot_thick = .2 ex;
38         bot_overshoot = serif_thick;
39
40         x0 = + top_narrow;
41         y0 = .9  [y1r, y1l];
42         y1l = .72 h;
43         x1r = .34 ex;
44         x2 = .66 ex;
45         y2 = y1r - top_overshoot;
46
47
48         y3 = h - .7 thin_thick;
49         x3 = w - .6 top_narrow - .5 thin_thick;
50
51         y4 = .5 thin_thick;
52         x4 = .5 thin_thick;
53
54         x5l =.25 ex;
55         y5l = .4 bot_overshoot;
56         y6l = -bot_overshoot;
57         x6 = w - 3 top_narrow;
58         x7 = w;
59         y7 = .82 [y8r, y6r];
60         x8r = w - .35 top_narrow;
61         x9 = w;
62         y8r = .45 h;
63
64         penpos1(top_thick, 80);
65         penpos3 (thin_thick, angle(z3-z4) + 90);
66         penpos4(thin_thick, angle (z3-z4) + 90);
67         penpos5(bot_thick, 70);
68         penpos6(3/2 bot_thick, 70);
69         penpos8 (thin_thick, 20);
70
71         penlabels(range 0 thru 9);
72
73         save p,q,r;
74         path p,q,r;
75
76         p := z0{down}
77                 ..  z1l{dir(10)}
78
79                 .. simple_serif (z3l, z3r, 90) .. z2{left} .. z1r{left}
80                 .. tension 1.2 
81                 .. cycle;
82         q := z3l -- z3r -- z4r -- z4l -- cycle;
83         r := simple_serif (z4r, z4l, 90) .. z5l{right}
84                 .. z6l{right}
85                 .. z7{up}
86                 .. simple_serif (z8r, z8l, 90)
87                 ..  z6r{left} .. z5r{left} .. cycle;
88         pickup pencircle scaled 1;
89 %       draw p ; draw q ; draw r ;
90
91         fill p; fill q; fill r;
92
93 fet_endchar;
94
95
96 % forte f, grabbed from Ed Breitkopf Mozart horn concerto 3.
97 %
98 % NOTES:
99 %
100 % * the bulbs are open.
101 %
102 % * blotting around the serif
103 %
104 %
105 %
106 % TODO: insert blots around the serif
107 %
108 %
109 %
110 slant_angle = 20;
111
112
113 code := 101;
114 fet_beginchar("dynamic f", "f", "f");
115         set_char_box (0, 1.1 ex#, descender#, ex# + ascender#);
116
117         save left_angle, right_angle;
118         save serif_length, serif_excentricity;
119         save f_thick;
120         save bulb_thick, bulb_diam, fill_up;
121         save p;
122         path p; 
123         bulb_diam = 7.5 / 40 ex;
124         bulb_thick = 8.5/40 ex;
125         fill_up = 1.5 serif_thick;
126         save slant;
127         left_angle =   slant_angle - 6;
128         right_angle =  slant_angle - 3;
129         f_thick = 7/16 ex;
130         serif_length = 0.96 ex;
131         serif_excentricity = 0.01 ex;
132
133
134         % z1 is the "base point"
135         z1 = (0.2 ex, - serif_thick);
136         y2 = y1 + ex;
137         z2l = z1 + whatever*dir (90 - left_angle);
138         penpos2 (f_thick, 0);
139
140         y3l = y1 + ex + ascender;
141         x3l = x1 + 1 ex;
142         penpos3 (med_thick, -90);
143         penpos4 (bulb_thick, -20);
144         z3r = whatever [z4r,z4l];
145
146         x4l - x3l = 1/10 ex;
147
148         penpos5(bulb_thick, -45);
149         x5r = 0.1 [x4l, x4r];
150         y5l = y4l - bulb_diam;
151
152         z6 = z2r + whatever* dir (90 - right_angle);
153         y6 = y1 + 3/8 ex;
154
155         x7 = x1 - 1/4 ex;
156         y7r = y1 -descender;
157         penpos7(med_thick, -90);
158
159         penpos8 (bulb_thick, 160);
160         x8l = x7l - 1/10 ex;
161         z7l = whatever [z8r,z8l];
162
163         penpos9 (bulb_thick, 135);
164         x9r = 0.1 [x8l, x8r];
165         y9l = y8l + bulb_diam;
166         labels(1,6,9);
167         penlabels(2, 3,4,5, 7, 8,9);
168
169         p := z1 --- z2l 
170                 .. tension 1.1
171                 .. z3l{right} .. z4r{down}
172                 .. z5r{left} .. z5l{up}
173                 .. tension 0.8
174                 .. z4l{up} .. z3r{left}
175                 .. tension 1.1
176                 .. z2r --- z6 .. tension 1.25 ..  z7r{left}
177                 .. z8r{up} .. z9r{right} .. z9l{down} .. tension 0.8
178                 .. z8l{down} .. z7l{right} .. cycle;
179         pickup pencircle scaled 1;
180         fill p;
181 %       draw p;
182
183 %
184 % todo round for pixels...
185 %
186         pickup pencircle scaled round (1.4 serif_thick);
187         (rt x13) - (lft x14) = serif_length;
188         y13 = y14;
189         y14 = y2;
190         0.5 [x13, x14] = x2 + serif_excentricity;
191
192         draw z13 .. z14;
193
194         penlabels(16);
195         labels(13,14,15);
196 fet_endchar;
197
198
199 %
200 % Notes:
201 %  
202 % - The S is trapezoidal (i.e. narrower at the top) 
203 %
204 % - The white space is differently shaped at the top (the bulb's inner
205 % curve is filled up.)
206 %
207 % - less heavy than the f and p signs.
208 %
209
210
211 code := 114;
212 fet_beginchar("dynamic s", "s", "s");
213         set_char_box (0, 17/24  ex#, 0, 1 ex#);
214
215         save left_angle, right_angle;
216         save s_thick, s_thin;
217         save base_point;
218         save bulb_diam, bulb_len;
219         save over_shoot;
220         over_shoot = 0; % .2 serif_thick;
221         pair base_point;
222
223         bulb_diam = 11/70 ex;
224         bulb_len = 1.0 bulb_diam;
225         left_angle =  slant_angle - 2;
226         right_angle =  slant_angle -11;
227
228         s_thick = 16/70 ex;
229         s_thin = serif_thick;
230
231         base_point = (0,0);
232
233         penpos1 (bulb_diam, -45);
234         z1 = 0.35 [z2l,z2r] + bulb_len * dir(45);
235         penpos2 (bulb_diam, -25);
236         y2l = 0.845 [y7r, y3r];
237
238         z2l = base_point + whatever * dir (90-left_angle);
239         penpos3 (s_thin, 100);
240         x3l = 1/2 w ;
241         y3l = ypart base_point - over_shoot ;
242         
243         penpos4 (s_thick, 25);
244         ypart z4l  = ypart z1r;
245         z4r = base_point + (w,0) + whatever *dir(90-right_angle);
246         penpos5 (s_thick, 40);
247         z5 = z3l + whatever * dir (90-right_angle);
248         y5 = ypart (0.48 [z7r, z3r]);
249
250         
251         penpos6 (s_thick, 25);
252         z6l = base_point + whatever *dir(90-left_angle);
253         y6r = y9l;
254
255         penpos7 (.9 s_thin, 110);
256         z7l = 0.45 [z6r, z8l] + whatever * dir (90-left_angle);
257         y7r = h + over_shoot;
258
259         penpos8 (.9 bulb_diam, -25);
260         z8 = .6 [z4l,z4r] + whatever *dir(90-right_angle);
261
262         y8r = ypart (0.23 [z7r, z3r]);
263
264         penpos9 (.9 bulb_diam, -45);
265         z9 = .4 [z8r,z8l] + .9 bulb_len * dir (-135);
266
267         penlabels(1,2,3,4,5,6,7,8,9);
268
269         labels(12);
270         save p;
271         path p;
272         p := z2l{down} .. z3l{right} .. z4r{up}
273                 .. z5r
274                 .. z6r{up}
275                 .. z7l{right}
276                 %.. z8l{down}
277                 ..z9l{down}
278                 .. z9r{right} .. z7r{left}
279                 .. z6l{down}
280                 .. z5l
281                 .. z4l{down}
282                 .. z3r{left}
283                 .. z2r{up} .. z1r{up}
284                 .. z1l{left} .. cycle;
285         pickup pencircle scaled 1;
286         fill p;
287 fet_endchar;
288
289
290
291
292 %
293 % piano p, grabbed from Ed Breitkopf Mozart horn concerto 3.
294 %
295 % Notes:
296 %
297 % * there is no dishing in the serif (but we do it anyway)
298 %
299 % * The cheek is a little fatter than the stem 
300
301 % * The slant is extreme: 20 degrees
302 %
303 % * the twiddle (what'sitcalled) is a slightly darker than the serif
304 %
305 % * The hole in the cheek has a straight right side.
306 %
307 % * Corners are filled up.
308 %
309 %
310
311 save slant;
312 slant := ypart (dir(slant_angle));
313 currenttransform := currenttransform slanted slant;
314
315 code := 111;
316
317
318 fet_beginchar("dynamic p", "p", "p")
319         %
320         % TODO w really   is 13/12 ex
321         % but should do kerning
322         set_char_box (0, 15/12 ex#, descender#, 1.0 ex#);
323
324         save twiddle_thick, stem_thick, cheek_thick;
325         save updir, fill_up;
326         save serif, dishing_angle, p, q;
327         save cheek_medium, left_serif_protude, right_serif_protude;
328         save lower_overshoot;
329
330         pair updir;
331         path serif,q,p;
332         save my_slant_angle;
333         my_slant_angle = 0; 
334         updir := dir (90 - my_slant_angle );
335         twiddle_thick = med_thick;
336         cheek_medium = 1/6 ex;
337
338         dishing_angle = 5;
339         fill_up := 1.5 serif_thick;
340         straigh_len = 0.5 ex;
341         lower_overshoot  := .3 serif_thick; 
342
343         stem_thick = 2/6 ex;
344         cheek_thick = 13/32 ex;
345         cheek_width = 0.72 ex;
346         left_serif_protude = 18/60 ex;
347         right_serif_protude= 15/60 ex;
348         
349         penpos1 (twiddle_thick, -slant - 5);
350         penpos2 (cheek_medium, 90 - slant );
351         penpos3 (cheek_medium, 90 - slant);
352
353         x4r - x4l = cheek_thick;
354         penpos4 (whatever, 0);
355         penpos5 (whatever, -38);
356         penpos6 (stem_thick, 0);
357         penpos17 (straigh_len, 90 -slant);
358         whatever [z17l, z17r] =  z4l;
359         y17 = 7/16 ex;
360
361         x6l = 0;
362         y6l = - descender + serif_thick/2;
363         z1l = z6l - whatever *dir (90 - my_slant_angle + 20 );
364         y1r = 0.5 ex;
365         y2r = ex;
366         z7 = whatever * updir + z6l;
367         y7 = 43/60  ex;
368         
369         z2l = whatever *updir + 0.3 [z7, z1r];
370         y8 = ypart (0.9 [z7, z2l]);
371         z8 = 2/3 [z6l, z6r] + whatever * updir;
372
373
374         y3r = ex;
375         z3l = 0.58 [(stem_thick, -descender), (stem_thick + cheek_width - cheek_thick, -descender)] + whatever * updir;
376         y4r = .38  ex;
377         z4r = whatever*updir + (stem_thick+  cheek_width, -descender);
378
379         z5l = whatever*updir  + z3l;
380         y5r = -lower_overshoot;
381         y5l = y5r + cheek_medium * ypart dir(55);
382
383         z9 = z6r + whatever*updir;
384         y9 = .2 [y5l, y5r];
385
386         p :=
387                 z2r{right} .. {dir( -60)}z8 & z8{dir 35} .. z3r{right}
388                 .. z4r{-updir}
389                 .. tension 1.1
390                 .. z5r{left} .. z9
391                 & z9 -- z6r -- z6l -- z7{updir} 
392                 ..  z2l{left} .. tension 1.2 ..
393                 % z1r & z1r -- z1l & z1l
394                 simple_serif (z1r, z1l, -90)
395                 .. cycle;
396
397
398         save blot_t, corner_t;
399
400         blot_t := 0.13;
401         corner_t := xpart (p intersectiontimes z9);
402
403         z19 = point corner_t - 2 blot_t of p;
404         z20 = point corner_t + blot_t of p;
405         labels(19,20);
406
407         save blot_path;
408         path blot_path;
409
410         pickup pencircle scaled 1;
411
412         fill z19{up} .. {right}z20{updir} .. z19{-(direction corner_t - 2 blot_t of p)} .. cycle;
413
414         pickup pencircle scaled 1;
415         fill p;
416
417         y12  = 0.5 ex;
418         z12 = z6r + whatever*updir;
419
420         save inner_tension;
421         inner_tension = 1.4;
422         q :=
423                 z17l .. tension 1.5 .. z17r  .. z3l{left}.. tension 1.05 .. z12{-updir} .. tension 1.05 .. z5l{right} .. cycle; 
424         unfill q;
425         penlabels (1, 2, 3, 4, 5, 6, 17);
426
427
428
429
430         pickup pencircle scaled serif_thick;
431         lft x11 = -left_serif_protude;
432         rt x10 = stem_thick+ right_serif_protude;
433         bot y10 = bot y11 = -descender;
434
435         
436         serif := simple_serif (z10, z11, dishing_angle);
437         draw serif;
438
439         labels(7,8, 9, 10, 11,12);
440
441         
442         z13 = point 0.05 of serif;
443         z14 = point 0.85 of serif;
444         z15 = z6l + updir * fill_up +( serif_thick/2, 0);
445         z16 = z6r + updir * 1.2fill_up- +( serif_thick/2, 0);
446         labels(13,14, 15, 16);
447
448 %       pickup pencircle scaled 1;
449         draw z13{direction 0.05 of serif} .. z16{updir};
450         draw z14{-(direction 0.85 of serif)} .. z15{updir};
451 fet_endchar;
452
453 %
454 % NOTES:
455 %
456 % * right stem is fatter and more straight than the left 2 two stems.
457 %
458 % * The twiddle  at the left is similar to the p twiddle 
459 %
460 % * The bottoms of the stems are blotted. 
461 %
462
463 %
464 %
465 % This is cut & paste programming. Somehow 3 i shapes in two chars (p and m)
466 % Doesn't seem worth the trouble of writing a macro.
467 %
468 code := 108;
469
470 fet_beginchar("dynamic m", "m", "m");
471         set_char_box (0, 1.5 ex#, 0, 1.0 ex#);
472
473         % should share code with p for twiddle.
474
475         save i_thick, i_angle, i_twiddle_thick,
476                 i_twiddle_start_angle, i_twiddle_start_y, 
477                 i_left_space;
478         save p;
479         save idir, center, right_ending;
480         save overshoot;
481         pair center, idir, right_ending;
482
483         path p;
484
485         overshoot = .25  serif_thick;
486         i_thick := 21 / 80 ex;
487         i_angle := 0;
488         idir := dir(90- i_angle);
489
490         i_left_space = 16/80 ex;
491         i_twiddle_thick = 1.2 serif_thick;
492         i_twiddle_start_y =  8/16 ex;
493         i_twiddle_start_angle = 0;
494         center =(0,0);
495
496         penpos1 (i_twiddle_thick, -i_twiddle_start_angle);
497         y1 = i_twiddle_start_y;
498         z1r = center - (i_left_space,0)  + whatever * idir;
499
500         y3 = 0.5 bottom_blot + ypart center; 
501         penpos3(i_thick, 0);
502         z3l = center + whatever * idir;
503         y4 = ypart center;
504         penpos4 (i_thick - bottom_blot, 0);
505         z4 - z3 = whatever * idir;
506
507         y2l = 1 ex  +  overshoot;
508         z2l = .08 [z3l, z3r] + whatever * idir;
509         z2r = 5/8 [z1r, z3l] + whatever * idir;
510         y2r = y5l + 1/9 ex;
511         z2 = 1/2 [z2l, z2r] ;
512         penpos5(i_thick, 0);
513         z5 = z4 + whatever * idir;
514         y5 = 55 / 80 ex;
515
516         p := simple_serif (z1l, z1r, 90) .. tension 1.2 .. z2r{right} .. z5l --- z3l
517                 ..  z4l --- z4r .. z3r --- z5r .. tension 1.2 .. z2l{left} .. cycle;
518
519         fill p;
520         right_ending := z5r;
521         penlabels (1, 2, 3 , 4,5);
522
523 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
524         clearxy;
525
526         i_angle := -3.2;
527         idir := dir(90 - i_angle);
528         i_left_space := 14/80 ex;
529
530
531         z1r = right_ending;
532         z5l = right_ending + (i_left_space,0);
533         penpos1(serif_thick, - i_twiddle_start_angle);
534
535         y3 = .5 bottom_blot + ypart center; 
536         penpos3(i_thick, 0);
537         z3l = z5l + whatever * idir;
538         y4 = ypart center;
539         penpos4(i_thick - bottom_blot, 0);
540         z4 - z3 = whatever * idir;
541
542         y2l = 1 ex+ overshoot;
543
544         z2l = .08 [z3l, z3r] + whatever * idir;
545         z2r = 5/8 [z1r, z3l] + whatever * idir;
546         y2r = y5l + 1/9 ex;
547         z2 = 1/2 [z2l, z2r] ;
548         penpos5(i_thick, 0);
549
550         p := simple_serif (z1l, z1r, 90) .. tension 1.05 .. z2r{right} .. z5l --- z3l
551                 ..  z4l --- z4r .. z3r --- z5r .. tension 1.2 .. z2l{left} .. cycle;
552
553         fill p;
554         right_ending := z5r;
555         penlabels (1, 2, 3 , 4,5);
556         clearxy;
557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
558
559         i_thick := 23 / 80 ex;
560         i_angle := -6;
561         i_left_space := 14/80 ex;
562
563
564         idir := dir(90- i_angle);
565         z1r = right_ending;
566         z5l = right_ending + (i_left_space,0);
567         penpos5 (whatever, 10);
568         penpos3 (whatever, 20);
569
570         y7 = 0; 
571         penpos7(i_thick ,0);
572         
573         penpos1(serif_thick, - i_twiddle_start_angle);
574         
575         z3l = z7l + whatever * idir;
576         z3r = z7r + whatever * idir;
577         z5l = z7l + whatever * idir;
578         z5r = z7r + whatever * idir;
579
580         save end_twiddle_angle;
581         end_twiddle_angle := 35;
582         penpos6(serif_thick, - end_twiddle_angle);
583         y6l = 23/80 ex + ypart center;
584         z6l = 1.6 [z3l, z3r]  + whatever * idir;
585         
586
587
588         y3l =  1/8 ex + ypart center; 
589         y2l = 1 ex+  overshoot;
590         z2l = .08 [z3l, z3r] + whatever * idir;
591         z2r = 5/8 [z1r, z3l] + whatever * idir;
592         y2r = y5l + 1/9 ex;
593         z2 = 1/2 [z2l, z2r] ;
594         z8 = z7 - (0, 1 overshoot);
595
596         p := simple_serif (z1l, z1r, 90) .. tension 1.05
597                 .. z2r{right} .. z5l --- z3l
598                 .. z8{right}
599                 .. simple_serif(z6r, z6l, 90)
600                 .. tension 0.85
601                 .. z3r --- z5r
602                 .. tension 1.2
603                 .. z2l{left} .. cycle;
604
605 %       pickup pencircle scaled 1;
606 %       draw p;
607         fill p;
608         right_ending := z5r;
609         penlabels (1, 2, 3 , 4,5,6,7, 8);
610         clearxy;
611
612 fet_endchar;
613
614
615 code := 113;
616
617
618 currenttransform := identity slanted ypart(dir(15));
619 fet_beginchar("dynamic r", "r", "r");
620         set_char_box (0, .75 ex#, 0, 1ex#);
621
622
623         save base_point, stem_thick, bulb_diam;
624         save twiddle_thick, attach_len, overshoot, taille;
625         stem_thick =.26 ex;
626         bulb_diam = .30 ex;
627         twiddle_thick= 1.1 serif_thick;
628         overshoot = .5 serif_thick;
629
630         taille = -0.3 serif_thick;
631
632         pair base_point;
633         base_point = (0,0);
634
635         x1l = 0;
636         y1l = .5 bottom_blot;
637
638         penpos10(stem_thick - bottom_blot, 0);
639         y10 = 0;
640         x10 = x1;
641
642         penpos1 (stem_thick, 0);
643         y2l - y1l = 36/47 ex;
644         x2l = x1l;
645         penpos2 (stem_thick, 0);
646
647         y3 = .77  ex;
648         x3r = x2l - .2 ex;
649         penpos3(twiddle_thick, -20);
650
651         x9 = 0.15 [x1r, x1l] ;
652         y9 = y4l - .12 ex ;
653
654         x4l = -0.1 [x1l, x1r];
655         y4l = ex + overshoot;
656
657         x4r = 0.62 [x3r, x2l];
658         y4r = 0.5 [y4l, y2l];
659
660         penpos5(whatever, -74);
661         y5l - y5r =  bulb_diam;
662         y5l = ex + overshoot;
663         x5 = x2r + attach_len;
664         attach_len + bulb_diam/2 + stem_thick = w;
665
666         z6 = z5;
667         penpos6 (bulb_diam, 0);
668 %       z7 = z6l + taille* dir(180);
669
670         save alpha;
671         alpha := 35;
672         z7 = z6 + .4 * bulb_diam * dir (-90 -alpha);
673         z8 = 9/10 [z1r, z2r];
674
675
676         save p;
677         path p;
678
679         p := z1r .. z10r --- z10l .. z1l 
680                 --- z2l
681                 .. z4r{left}
682                 .. tension 1.2
683                 .. {down}simple_serif(z3r, z3l,-90){up}
684                 .. tension 0.95
685                 .. z4l
686                 .. z9
687                 & z9{curl 0}
688                 .. z5l
689                 .. z6r{dir(-80)}
690                 .. z5r{left}
691                 .. z7
692                 .. z6l
693                 .. tension 1.2
694                 .. z8 --- cycle;
695         pickup pencircle scaled 1;
696         draw p;
697         fill p;
698         penlabels (1,2,3, 4,5,6,7,8, 9, 10);
699 fet_endchar ;
700
701
702
703
704
705 %%% KERNING
706
707 ligtable "m" : "p" kern 0.2 ex#, "f" kern -0.1 ex#;
708 ligtable "f" : "f" kern -0.13 ex#;
709 ligtable "r" : "f" kern 0.1 ex#;
710
711
712
713
714
715
716
717
718
719
720 %% notes from old dyn code.
721
722 % "f" obviously has a _lot_ bigger slant than "p" (see Wanske p.239)
723 % however; perhaps we need two f symbols:
724 %  - a super-slanted one used in "f" "mf" "sfz" "sf", and
725 %  - a more normal-slanted in "ff" "fff" "fp" "fp" (see Wanske p.241)
726 %
727 % looking at professionally typeset music reveals that typesetters 
728 % are somewhat unsure about slanting in "mf", "fp", "sfz"
729
730 % "f" and "p" (in any combination) are a lot (factor two) fatter than
731 % "s", "m", and "z".  sometimes the "m" and "z" are a bit fatter than
732 % "s".
733
734
735 % Chester, Breitkopf suggest smaller sizes of these other chars,
736 % using the x-height as reference point.