]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-din-code.mf
''
[lilypond.git] / mf / feta-din-code.mf
1
2 code := 111;
3
4 save serif_thick;
5 serif_thick# = 1.1 stafflinethickness#;
6 define_blacker_pixels (serif_thick);
7 med_thick = round (1.5 stafflinethickness);
8
9
10
11 % forte f, grabbed from Ed Breitkopf Mozart horn concerto 3.
12 %
13 % NOTES:
14 %
15 % * the bulbs are open.
16 %
17 % * blotting around the serif
18 %
19 %
20 %
21 % TODO: insert blots around the serif
22 %
23 %
24 %
25 slant_angle = 20;
26
27
28 code := 101;
29 fet_beginchar("dynamic f", "f", "dynf");
30         set_char_box (0, 1.25 ex#, descender#, ex# + ascender#);
31
32         save left_angle, right_angle;
33         save serif_length, serif_excentricity;
34         save f_thick;
35         save bulb_thick, bulb_diam, fill_up;
36         save p;
37         path p; 
38         bulb_diam = 7.5 / 40 ex;
39         bulb_thick = 8.5/40 ex;
40         fill_up = 1.5 serif_thick;
41         save slant;
42         left_angle =   slant_angle - 6;
43         right_angle =  slant_angle - 3;
44         f_thick = 7/16 ex;
45         serif_length = 0.96 ex;
46         serif_excentricity = 0.01 ex;
47
48         z1 = (0.375 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         pickup pencircle scaled 1.1 serif_thick;
97         (rt x13) - (lft x14) = serif_length;
98         y13 = y14;
99         y14 = y2;
100         0.5 [x13, x14] = x2 + serif_excentricity;
101
102         draw z13 .. z14;
103
104         penlabels(16);
105         labels(13,14,15);
106 fet_endchar;
107
108
109 save slant;
110 slant := ypart (dir(20));
111
112 %
113 % piano p, grabbed from Ed Breitkopf Mozart horn concerto 3.
114 %
115 % Notes:
116 %
117 % * there is no dishing in the serif (but we do it anyway)
118 %
119 % * The cheek is a little fatter than the stem 
120
121 % * The slant is extreme: 20 degrees
122 %
123 % * the twiddle (what'sitcalled) is a slightly darker than the serif
124 %
125 % * The hole in the cheek has a straight right side.
126 %
127 % * Corners are filled up.
128 %
129 %
130
131 save slant;
132 slant := ypart (dir(slant_angle));
133 currenttransform := currenttransform slanted slant;
134
135
136 fet_beginchar("dynamic p", "p", "dynp")
137         %
138         % TODO w really   is 13/12 ex
139         % but should do kerning
140         set_char_box (0, 15/12 ex#, descender#, 1.0 ex#);
141
142         save twiddle_thick, stem_thick, cheek_thick;
143         save updir, fill_up;
144         save serif, dishing_angle, p, q;
145         save cheek_medium, left_serif_protude, right_serif_protude;
146
147         pair updir;
148         path serif,q,p;
149         save my_slant_angle;
150         my_slant_angle = 0; 
151         updir := dir (90 - my_slant_angle );
152         twiddle_thick = med_thick;
153         cheek_medium = 1/6 ex;
154
155         dishing_angle = 5;
156         fill_up := 1.5 serif_thick;
157         straigh_len = 0.5 ex;
158
159         stem_thick = 2/6 ex;
160         cheek_thick = 13/32 ex;
161         cheek_width = 0.72 ex;
162         left_serif_protude = 18/60 ex;
163         right_serif_protude= 15/60 ex;
164         
165         penpos1 (twiddle_thick, -slant - 5);
166         penpos2 (cheek_medium, 90 - slant );
167         penpos3 (cheek_medium, 90 - slant);
168
169         x4r - x4l = cheek_thick;
170         penpos4 (whatever, 0);
171         penpos5 (cheek_medium, -55);
172         penpos6 (stem_thick, 0);
173         penpos17 (straigh_len, 90 -slant);
174         whatever [z17l, z17r] =  z4l;
175         y17 = 7/16 ex;
176
177         x6l = 0;
178         y6l = - descender + serif_thick/2;
179         z1l = z6l - whatever *dir (90 - my_slant_angle + 20 );
180         y1r = 0.5 ex;
181         y2r = ex;
182         z7 = whatever * updir + z6l;
183         y7 = 43/60  ex;
184         
185         z2l = whatever *updir + 0.3 [z7, z1r];
186         y8 = ypart (0.9 [z7, z2l]);
187         z8 = 2/3 [z6l, z6r] + whatever * updir;
188
189
190         y3r = ex;
191         z3l = 0.58 [(stem_thick, -descender), (stem_thick + cheek_width - cheek_thick, -descender)] + whatever * updir;
192         y4r = 1/3  ex;
193         z4r = whatever*updir + (stem_thick+  cheek_width, -descender);
194
195         z5l = whatever*updir  + z3l;
196         y5l = 1/12 ex;
197
198         z9 = z6r + whatever*updir;
199         y9 = .2 [y5l, y5r];
200
201         p :=
202                 z2r{right} .. {dir( -60)}z8 & z8{dir 35} .. z3r{right}
203                 .. tension 1.0 .. z4r{-updir} .. z5r{left} .. z9
204                 & z9 -- z6r -- z6l -- z7{updir} 
205                 ..  z2l{left} .. tension 1.2 ..
206                 % z1r & z1r -- z1l & z1l
207                 simple_serif (z1r, z1l, -90)
208                 .. cycle;
209         pickup pencircle scaled 1;
210         fill p;
211
212         y12  = 0.5 ex;
213         z12 = z6r + whatever*updir;
214
215         save inner_tension;
216         inner_tension = 1.4;
217         q :=
218                 z17l .. tension 1.5 .. z17r  .. z3l{left}.. tension 1.05 .. z12{-updir} .. tension 1.05 .. z5l{right} .. cycle; 
219         unfill q;
220         penlabels (1, 2, 3, 4, 5, 6, 17);
221
222
223
224
225         pickup pencircle scaled serif_thick;
226         lft x11 = -left_serif_protude;
227         rt x10 = stem_thick+ right_serif_protude;
228         bot y10 = bot y11 = -descender;
229
230         
231         serif := simple_serif (z10, z11, dishing_angle);
232         draw serif;
233
234         labels(7,8, 9, 10, 11,12);
235
236         
237         z13 = point 0.05 of serif;
238         z14 = point 0.85 of serif;
239         z15 = z6l + updir * fill_up +( serif_thick/2, 0);
240         z16 = z6r + updir * 1.2fill_up- +( serif_thick/2, 0);
241         labels(13,14, 15, 16);
242
243 %       pickup pencircle scaled 1;
244         draw z13{direction 0.05 of serif} .. z16{updir};
245         draw z14{-(direction 0.85 of serif)} .. z15{updir};
246 fet_endchar;
247
248 %
249 % NOTES:
250 %
251 % * right stem is fatter and more straight than the left 2 two  stems.
252 %
253 % * The twiddle  at the left is similar to the p twiddle 
254 %
255 % * The bottoms of the stems are blotted. 
256 %
257
258
259 %
260 %
261 % This is cut & paste programming. Somehow 3 i shapes in two chars (p and m)
262 % Doesn't seem worth the trouble of writing a macro.
263 %
264 code := 108;
265
266 fet_beginchar("dynamic m", "m", "dynm");
267         set_char_box (0, 1.3 ex#, 0, 1.0 ex#);
268
269         % should share code with p for twiddle.
270
271         save i_thick, i_angle, i_twiddle_thick,
272                 i_twiddle_start_angle, i_twiddle_start_y, 
273                 i_left_space;
274         save p;
275         save idir, center, right_ending;
276         pair center, idir, right_ending;
277         path p;
278
279         i_thick := 21 / 80 ex;
280         i_angle := 0;
281         idir := dir(90- i_angle);
282
283         i_left_space = 18/80 ex;
284         i_twiddle_thick = serif_thick;
285         i_twiddle_start_y =  8/16 ex;
286         i_twiddle_start_angle = 0;
287         center =(0,0);
288         bottom_blot = serif_thick;
289
290         penpos1 (i_twiddle_thick, -i_twiddle_start_angle);
291         y1 = i_twiddle_start_y;
292         z1r = center - (i_left_space,0)  + whatever * idir;
293
294         y3 = bottom_blot + ypart center; 
295         penpos3(i_thick, 0);
296         z3l = center + whatever * idir;
297         y4 = ypart center;
298         penpos4 (i_thick - bottom_blot, 0);
299         z4 - z3 = whatever * idir;
300
301         y2l = 1 ex;
302         z2l = .15 [z3l, z3r] + whatever * idir;
303         z2r = 5/8 [z1r, z3l] + whatever * idir;
304         y2r = y5l + 1/9 ex;
305         z2 = 1/2 [z2l, z2r] ;
306         penpos5(i_thick, 0);
307         z5 = z4 + whatever * idir;
308         y5 = 55 / 80 ex;
309
310         p := simple_serif (z1l, z1r, 90) .. tension 1.2 .. z2r{right} .. z5l --- z3l
311                 ..  z4l --- z4r .. z3r --- z5r .. tension 1.2 .. z2l{left} .. cycle;
312
313         fill p;
314         right_ending := z5r;
315         penlabels (1, 2, 3 , 4,5);
316
317 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
318         clearxy;
319
320
321         z1r = right_ending;
322         z5l = right_ending + (i_left_space,0);
323         penpos1(serif_thick, - i_twiddle_start_angle);
324
325         y3 = bottom_blot + ypart center; 
326         penpos3(i_thick, 0);
327         z3l = z5l + whatever * idir;
328         y4 = ypart center;
329         penpos4(i_thick - bottom_blot, 0);
330         z4 - z3 = whatever * idir;
331
332         y2l = 1 ex;
333         z2l = .15 [z3l, z3r] + whatever * idir;
334         z2r = 5/8 [z1r, z3l] + whatever * idir;
335         y2r = y5l + 1/9 ex;
336         z2 = 1/2 [z2l, z2r] ;
337         penpos5(i_thick, 0);
338
339         p := simple_serif (z1l, z1r, 90) .. tension 1.05 .. z2r{right} .. z5l --- z3l
340                 ..  z4l --- z4r .. z3r --- z5r .. tension 1.2 .. z2l{left} .. cycle;
341
342         fill p;
343         right_ending := z5r;
344         penlabels (1, 2, 3 , 4,5);
345         clearxy;
346 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
347
348         i_thick := 23 / 80 ex;
349         i_angle := -7;
350         i_left_space := 14/80 ex;
351         end_overshoot = .25  serif_thick;
352
353
354         idir := dir(90- i_angle);
355         z1r = right_ending;
356         z5l = right_ending + (i_left_space,0);
357         penpos5 (whatever, 10);
358         penpos3 (whatever, 20);
359
360         y7 = 0; 
361         penpos7(i_thick ,0);
362         
363         penpos1(serif_thick, - i_twiddle_start_angle);
364         
365         z3l = z7l + whatever * idir;
366         z3r = z7r + whatever * idir;
367         z5l = z7l + whatever * idir;
368         z5r = z7r + whatever * idir;
369
370         save end_twiddle_angle;
371         end_twiddle_angle := 35;
372         penpos6(.9 serif_thick, - end_twiddle_angle);
373         y6l = 23/80 ex + ypart center;
374         z6l = 1.6 [z3l, z3r]  + whatever * idir;
375         
376
377
378         y3l =  1/8 ex + ypart center; 
379         y2l = 1 ex+  end_overshoot;
380         z2l = .08 [z3l, z3r] + whatever * idir;
381         z2r = 5/8 [z1r, z3l] + whatever * idir;
382         y2r = y5l + 1/9 ex;
383         z2 = 1/2 [z2l, z2r] ;
384         z8 = z7 - (0, 2 end_overshoot);
385
386         p := simple_serif (z1l, z1r, 90) .. tension 1.05
387                 .. z2r{right} .. z5l --- z3l
388                 .. z8{right}
389                 .. simple_serif(z6r, z6l, 90)
390                 .. tension 0.85
391                 .. z3r --- z5r
392                 .. tension 1.2
393                 .. z2l{left} .. cycle;
394
395 %       pickup pencircle scaled 1;
396 %       draw p;
397         fill p;
398         right_ending := z5r;
399         penlabels (1, 2, 3 , 4,5,6,7, 8);
400         clearxy;
401
402 fet_endchar;
403
404 %% notes from old dyn code.
405
406 % "f" obviously has a _lot_ bigger slant than "p" (see Wanske p.239)
407 % however; perhaps we need two f symbols:
408 %  - a super-slanted one used in "f" "mf" "sfz" "sf", and
409 %  - a more normal-slanted in "ff" "fff" "fp" "fp" (see Wanske p.241)
410 %
411 % looking at professionally typeset music reveals that typesetters 
412 % are somewhat unsure about slanting in "mf", "fp", "sfz"
413
414 % "f" and "p" (in any combination) are a lot (factor two) fatter than
415 % "s", "m", and "z".  sometimes the "m" and "z" are a bit fatter than
416 % "s".
417
418
419 % Chester, Breitkopf suggest smaller sizes of these other chars,
420 % using the x-height as reference point.