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