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