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