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