1% Feta (not the Font-En-Tja) music font --  dynamic signs
2% This file is part of LilyPond, the GNU music typesetter.
3%
4% Copyright (C) 1997--2021 Jan Nieuwenhuizen <janneke@gnu.org>
5%
6% The LilyPond font is free software: you can redistribute it and/or modify
7% it under the terms of the GNU General Public License as published by
8% the Free Software Foundation, either version 3 of the License, or
9% (at your option) any later version, or under the SIL Open Font License.
10%
11% LilyPond is distributed in the hope that it will be useful,
12% but WITHOUT ANY WARRANTY; without even the implied warranty of
13% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14% GNU General Public License for more details.
15%
16% You should have received a copy of the GNU General Public License
17% along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18
19
20ex# := (dynamic_design_size / 2.4) * pt#;
21descender# := 0.5 ex#;
22ascender# := 0.72 ex#;
23staffspace# := 1.75 / 2.0 * ex#;
24horizontal_space# := .66 ex#;
25
26font_x_height ex#;
27font_normal_space horizontal_space#;
28
29define_pixels (staffspace, linethickness, ex, descender, ascender);
30
31
32%
33% TODO: blot diameter should be fixed, not scalable.
34%
35
36save serif_thick, med_thick, bottom_blot;
37
38serif_thick# = 1.1 linethickness#;
39define_blacker_pixels (serif_thick);
40
41med_thick = round (1.5 linethickness);
42bottom_blot = 1.3 serif_thick;
43
44
45code := 32;
46
47fet_beginchar ("space", "space");
48  set_char_box (0, horizontal_space#, 0, ex#);
49fet_endchar;
50
51
52%
53% Couldn't find many z examples.  This one is losely inspired
54% by a sfz from Mueller Etuden fuer Horn (Edition Hofmeister).
55%
56
57code := 121;
58
59fet_beginchar ("dynamic z", "z");
60  save thin_thick, top_narrow, over_shoot;
61  save bot_thick;
62
63  set_char_box (0, .98 ex#, 0, 0.9 ex#);
64
65  thin_thick = serif_thick;
66  top_narrow = thin_thick;
67  top_overshoot = .8 serif_thick;
68  top_thick = .3 h;
69  bot_thick = .2 ex;
70  bot_overshoot = serif_thick;
71
72  x0 = top_narrow;
73  y0 = .9 [y1r, y1l];
74
75  penpos1 (top_thick, 80);
76  y1l = .72 h;
77  x1r = .34 ex;
78
79  x2 = .66 ex;
80  y2 = y1r - top_overshoot;
81
82  y3 = h - .7 thin_thick;
83  x3 = w - .6 top_narrow - .5 thin_thick;
84  y4 = .5 thin_thick;
85  x4 = .5 thin_thick;
86
87  penpos3 (thin_thick, angle (z3 - z4) + 90);
88  penpos4 (thin_thick, angle (z3 - z4) + 90);
89
90  penpos5 (bot_thick, 70);
91  x5l =.25 ex;
92  y5l = .4 bot_overshoot;
93
94  penpos6 (3/2 bot_thick, 70);
95  y6l = -bot_overshoot;
96  x6 = w - 3 top_narrow;
97
98  x7 = w;
99  y7 = .82 [y8r, y6r];
100
101  penpos8 (thin_thick, 20);
102  x8r = w - .35 top_narrow;
103  y8r = .45 h;
104
105  penlabels (range 0 thru 8);
106
107  % pickup pencircle scaled 1;
108
109  % draw
110  fill z0{down}
111       .. z1l{dir (10)}
112       .. simple_serif (z3l, z3r, 90)
113       .. z2{left}
114       .. z1r{left}
115       ..tension 1.2.. cycle;
116
117  % draw
118  fill z3l
119       -- z3r
120       -- z4r
121       -- z4l
122       -- cycle;
123
124  % draw
125  fill simple_serif (z4r, z4l, 90)
126       .. z5l{right}
127       .. z6l{right}
128       .. z7{up}
129       .. simple_serif (z8r, z8l, 90)
130       .. z6r{left}
131       .. z5r{left}
132       .. cycle;
133fet_endchar;
134
135
136% forte f, grabbed from Ed Breitkopf Mozart horn concerto 3.
137%
138% NOTES:
139%
140% * the bulbs are open
141%
142% * blotting around the serif
143%
144% TODO: insert blots around the serif
145%
146
147slant_angle = 20;
148code := 101;
149
150fet_beginchar ("dynamic f", "f");
151  save left_angle, right_angle;
152  save serif_length, serif_eccentricity;
153  save f_thick;
154  save bulb_thick, bulb_diam, fill_up;
155  save slant;
156  save p;
157  path p;
158
159  set_char_box (0, 1.1 ex#, descender#, ex# + ascender#);
160
161  bulb_diam = 7.5 / 40 ex;
162  bulb_thick = 8.5 / 40 ex;
163  fill_up = 1.5 serif_thick;
164  left_angle = slant_angle - 6;
165  right_angle = slant_angle - 3;
166  f_thick = 7/16 ex;
167  serif_length = 0.96 ex;
168  serif_eccentricity = 0.01 ex;
169
170  % z1 is the `base point'
171  z1 = (0.2 ex, -serif_thick);
172
173  penpos2 (f_thick, 0);
174  y2 = y1 + ex;
175  z2l = z1 + whatever * dir (90 - left_angle);
176
177  penpos3 (med_thick, -90);
178  y3l = y1 + ex + ascender;
179  x3l = x1 + ex;
180
181  penpos4 (bulb_thick, -20);
182  z3r = whatever [z4r, z4l];
183
184  x4l - x3l = 1/10 ex;
185
186  penpos5 (bulb_thick, -45);
187  x5r = 0.1 [x4l, x4r];
188  y5l = y4l - bulb_diam;
189
190  z6 = z2r + whatever * dir (90 - right_angle);
191  y6 = y1 + 3/8 ex;
192
193  penpos7 (med_thick, -90);
194  x7 = x1 - 1/4 ex;
195  y7r = y1 -descender;
196
197  penpos8 (bulb_thick, 160);
198  x8l = x7l - 1/10 ex;
199
200  z7l = whatever [z8r, z8l];
201
202  penpos9 (bulb_thick, 135);
203  x9r = 0.1 [x8l, x8r];
204  y9l = y8l + bulb_diam;
205
206  labels (1, 6, 9);
207  penlabels (2, 3, 4, 5, 7, 8, 9);
208
209  % pickup pencircle scaled 1;
210
211  % draw
212  fill z1
213       -- z2l{z2l - z1}
214       ..tension 1.1.. z3l{right}
215       .. z4r{down}
216       .. z5r{left}
217       .. z5l{up}
218       ..tension 0.8.. z4l{up}
219       .. z3r{left}
220       ..tension 1.1.. z2r{z6 - z2r}
221       -- z6{z6 - z2r}
222       ..tension 1.25.. z7r{left}
223       .. z8r{up}
224       .. z9r{right}
225       .. z9l{down}
226       ..tension 0.8.. z8l{down}
227       .. z7l{right}
228       .. {z2l - z1}cycle;
229
230  x13 - x14 = serif_length;
231  y13 = y14;
232  y14 = y2;
233  0.5 [x13, x14] = x2 + serif_eccentricity;
234
235  draw_rounded_block (z14 - (0, 0.7 serif_thick),
236                      z13 + (0, 0.7 serif_thick),
237                      1.4 serif_thick);
238
239  labels (13, 14);
240fet_endchar;
241
242
243%
244% Notes:
245%
246% - The `s' is trapezoidal (i.e., narrower at the top).
247%
248% - The white space is differently shaped at the top (the bulb's inner
249%   curve is filled up).
250%
251% - Less heavy than the `f' and `p' signs.
252%
253
254code := 114;
255
256fet_beginchar ("dynamic s", "s");
257  save left_angle, right_angle;
258  save s_thick, s_thin;
259  save bulb_diam, bulb_len;
260  save over_shoot;
261  save base_point;
262  pair base_point;
263
264  set_char_box (0, 17/24 ex#, 0, ex#);
265
266  over_shoot = 0;                        % .2 serif_thick;
267  bulb_diam = 11/70 ex;
268  bulb_len = 1.0 bulb_diam;
269  left_angle = slant_angle - 2;
270  right_angle = slant_angle - 11;
271  s_thick = 16/70 ex;
272  s_thin = serif_thick;
273
274  base_point = (0, 0);
275
276  penpos1 (bulb_diam, -45);
277  z1 = 0.35 [z2l, z2r] + bulb_len * dir (45);
278
279  penpos2 (bulb_diam, -25);
280  y2l = 0.845 [y7r, y3r];
281  z2l = base_point + whatever * dir (90 - left_angle);
282
283  penpos3 (s_thin, 100);
284  x3l = 1/2 w;
285  y3l = ypart base_point - over_shoot;
286
287  penpos4 (s_thick, 25);
288  y4l = y1r;
289  z4r = base_point + (w, 0) + whatever * dir (90 - right_angle);
290
291  penpos5 (s_thick, 40);
292  z5 = z3l + whatever * dir (90 - right_angle);
293  y5 = 0.48 [y7r, y3r];
294
295  penpos6 (s_thick, 25);
296  z6l = base_point + whatever * dir (90 - left_angle);
297  y6r = y9l;
298
299  penpos7 (.9 s_thin, 110);
300  z7l = 0.45 [z6r, z8l] + whatever * dir (90 - left_angle);
301  y7r = h + over_shoot;
302
303  penpos8 (.9 bulb_diam, -25);
304  z8 = .6 [z4l, z4r] + whatever * dir (90 - right_angle);
305  y8r = 0.23 [y7r, y3r];
306
307  penpos9 (.9 bulb_diam, -45);
308  z9 = .4 [z8r, z8l] + .9 bulb_len * dir (-135);
309
310  penlabels (range 1 thru 9);
311
312  % pickup pencircle scaled 1;
313
314  % draw
315  fill z2l{down}
316       .. z3l{right}
317       .. z4r{up}
318       .. z5r
319       .. z6r{up}
320       .. z7l{right}
321  %     .. z8l{down}
322       .. z9l{dir (-125)}
323       .. z9r{right}
324       .. z7r{left}
325       .. z6l{down}
326       .. z5l
327       .. z4l{down}
328       .. z3r{left}
329       .. z2r{up}
330       .. z1r{up}
331       .. z1l{left}
332       .. cycle;
333fet_endchar;
334
335
336% for `p' and `m'
337
338save slant;
339slant := ypart (dir (slant_angle));
340
341
342%
343% Piano `p', grabbed from Ed Breitkopf Mozart horn concerto 3.
344%
345% Notes:
346%
347% * There is no dishing in the serif (but we do it anyway).
348%
349% * The cheek is a little fatter than the stem.
350%
351% * The slant is extreme: 20 degrees.
352%
353% * The twiddle (what's-it-called) is a slightly darker than the serif.
354%
355% * The hole in the cheek has a straight right side.
356%
357% * Corners are filled up.
358%
359
360code := 111;
361
362fet_beginchar ("dynamic p", "p")
363  % TODO: w really is 13/12 ex
364  %       but should do kerning
365
366  save twiddle_thick, stem_thick, cheek_thick, cheek_width;
367  save fill_up, straigh_len;
368  save serif, dishing_angle, p, tmp;
369  save cheek_medium, left_serif_protrude, right_serif_protrude;
370  save lower_overshoot;
371  save blot_t, corner_t;
372  path serif, p;
373  pair tmp, updir;
374
375  set_char_box (0, 15/12 ex#, descender#, 1.0 ex#);
376
377  twiddle_thick = med_thick;
378  cheek_medium = 1/6 ex;
379
380  dishing_angle = 5;
381  fill_up = 1.5 serif_thick;
382  straigh_len = 0.5 ex;
383  lower_overshoot = .3 serif_thick;
384
385  stem_thick = 2/6 ex;
386  cheek_thick = 13/32 ex;
387  cheek_width = 0.72 ex;
388  left_serif_protrude = 18/60 ex;
389  right_serif_protrude = 15/60 ex;
390
391  currenttransform := currenttransform slanted slant;
392
393  penpos1 (twiddle_thick, -slant - 5);
394  penpos2 (cheek_medium, 90 - slant);
395  penpos3 (cheek_medium, 90 - slant);
396
397  x4r - x4l = cheek_thick;
398
399  penpos4 (whatever, 0);
400  penpos5 (whatever, -38);
401  penpos6 (stem_thick, 0);
402  penpos17 (straigh_len, 90 - slant);
403
404  whatever [z17l, z17r] =  z4l;
405  y17 = 7/16 ex;
406  x6l = 0;
407  y6l = -descender + serif_thick / 2;
408  z1l = z6l - whatever * dir (110);
409  y1r = 0.5 ex;
410  y2r = ex;
411  z7 = whatever * up + z6l;
412  y7 = 43/60 ex;
413  z2l = whatever * up + 0.3 [z7, z1r];
414  y8 = 0.9 [y7, y2l];
415  z8 = 2/3 [z6l, z6r] + whatever * up;
416  y3r = ex;
417  z3l = 0.58 [(stem_thick, -descender),
418              (stem_thick + cheek_width - cheek_thick, -descender)]
419        + whatever * up;
420  y4r = .38 ex;
421  z4r = whatever * up + (stem_thick + cheek_width, -descender);
422  z5l = whatever * up + z3l;
423  y5r = -lower_overshoot;
424  y5l = y5r + cheek_medium * ypart dir (55);
425  z9 = z6r + whatever * up;
426  y9 = .2 [y5l, y5r];
427
428  p := z2r{right}
429       .. {dir (-60)}z8{dir 60}
430       .. z3r{right}
431       .. z4r{down}
432       ..tension 1.1.. z5r{left}
433       .. {curl 1}z9
434       -- z6r
435       -- z6l
436       -- z7{up}
437       .. z2l{left}
438       ..tension 1.2.. simple_serif (z1r, z1l, -90)
439       .. cycle;
440
441  blot_t := 0.13;
442  corner_t := xpart (p intersectiontimes z9);
443
444  % pickup pencircle scaled 1;
445
446  % draw
447  fill subpath (0, corner_t - 2 blot_t) of p
448       .. subpath (corner_t + blot_t, length p) of p
449       .. cycle;
450
451  y12 = 0.5 ex;
452  z12 = z6r + whatever * up;
453
454  unfill z17l
455         ..tension 1.5.. z17r
456         .. z3l{left}
457         ..tension 1.05.. z12{down}
458         ..tension 1.05.. z5l{right}
459         .. cycle;
460
461  penlabels (1, 2, 3, 4, 5, 6, 17);
462  labels (7, 8, 9);
463
464  pickup pencircle scaled serif_thick;
465
466  lft x11 = -left_serif_protrude;
467  rt x10 = stem_thick + right_serif_protrude;
468  bot y10 = bot y11 = -descender;
469
470  z15 = z6l + up * fill_up;
471  z16 = z6r + up * 1.2 fill_up;
472
473  % Since pens are not affected by currenttransform we directly
474  % transform the necessary points, then simulating the pen with
475  % an outline while using the identity transformation.
476
477  forsuffixes $ = 7, 10, 11, 15, 16:
478    tmp := z$ transformed currenttransform;
479    x$ := xpart tmp;
480    y$ := ypart tmp;
481  endfor;
482
483  currenttransform := identity;
484
485  updir = z7 - z15;
486
487  serif := simple_serif (z10, z11, dishing_angle);
488
489  penpos10 (serif_thick, -dishing_angle - 90);
490  penpos11 (serif_thick, dishing_angle - 90);
491  penpos13 (serif_thick, angle (direction 0.05 of serif) + 90);
492  penpos14 (serif_thick, angle (direction 0.85 of serif) + 90);
493
494  z13 = point 0.05 of serif;
495  z14 = point 0.85 of serif;
496
497  penlabels (10, 11, 13, 14);
498  labels (15, 16);
499
500%        draw
501  fill z15{-updir}
502       .. z14l{direction 0.85 of serif}
503       .. z11l{-dir (dishing_angle)}
504       .. z11r{dir (dishing_angle)}
505       .. z14r{-direction 0.85 of serif}
506       .. z13r{-direction 0.05 of serif}
507       .. z10r{dir (-dishing_angle)}
508       .. z10l{-dir (-dishing_angle)}
509       .. z13l{direction 0.05 of serif}
510       .. z16{updir}
511       -- cycle;
512fet_endchar;
513
514
515%
516% NOTES:
517%
518% * Right stem is fatter and more straight than the left two stems.
519%
520% * The twiddle at the left is similar to the `p' twiddle.
521%
522% * The bottoms of the stems are blotted.
523%
524%
525% This is cut & paste programming.  Somehow three `i' shapes in two
526% characters (`p' and `m') -- doesn't seem worth the trouble of writing
527% a macro.
528%
529
530code := 108;
531
532fet_beginchar ("dynamic m", "m");
533  save i_thick, i_angle, i_twiddle_thick;
534  save i_twiddle_start_angle, i_twiddle_start_y;
535  save i_twiddle_end_angle, i_left_space;
536  save idir, center, right_ending;
537  save overshoot;
538  save p;
539  pair center, idir, right_ending;
540  path p;
541
542  set_char_box (0, 1.5 ex#, 0, 1.0 ex#);
543
544  % should share code with p for twiddle.
545
546  overshoot = .25 serif_thick;
547  i_thick := 21/80 ex;
548  i_twiddle_thick = 1.2 serif_thick;
549  i_twiddle_start_y = 8/16 ex;
550  i_twiddle_start_angle = 0;
551  i_twiddle_end_angle := 35;
552
553  center = (0, 0);
554
555  currenttransform := currenttransform slanted slant;
556
557  i_angle := 0;
558  idir := dir (90 - i_angle);
559  i_left_space = 16/80 ex;
560
561  penpos1 (i_twiddle_thick, -i_twiddle_start_angle);
562  y1 = i_twiddle_start_y;
563  z1r = center - (i_left_space, 0) + whatever * idir;
564
565  y2l = ex + overshoot;
566  z2l = .08 [z3l, z3r] + whatever * idir;
567  z2r = 5/8 [z1r, z3l] + whatever * idir;
568  y2r = y5l + 1/9 ex;
569  z2 = 1/2 [z2l, z2r];
570
571  penpos3 (i_thick, 0);
572  y3 = 0.5 bottom_blot + ypart center;
573  z3l = center + whatever * idir;
574
575  penpos4 (i_thick - bottom_blot, 0);
576  y4 = ypart center;
577  z4 - z3 = whatever * idir;
578
579  penpos5 (i_thick, 0);
580  z5 = z4 + whatever * idir;
581  y5 = 55/80 ex;
582
583  fill simple_serif (z1l, z1r, 90)
584       ..tension 1.2.. z2r{right}
585       .. z5l{z3 - z5}
586       -- z3l{z3 - z5}
587       .. z4l{right}
588       -- z4r{right}
589       .. z3r{z5 - z3}
590       -- z5r{z5 - z3}
591       ..tension 1.2.. z2l{left}
592       .. cycle;
593
594  right_ending := z5r;
595  penlabels (1, 2, 3, 4, 5);
596
597  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
598
599  clearxy;
600
601  i_angle := -3.2;
602  idir := dir (90 - i_angle);
603  i_left_space := 14/80 ex;
604
605  penpos1 (serif_thick, -i_twiddle_start_angle);
606  z1r = right_ending;
607
608  y2l = ex+ overshoot;
609  z2l = .08 [z3l, z3r] + whatever * idir;
610  z2r = 5/8 [z1r, z3l] + whatever * idir;
611  y2r = y5l + 1/9 ex;
612  z2 = 1/2 [z2l, z2r];
613
614  penpos3 (i_thick, 0);
615  y3 = 0.5 bottom_blot + ypart center;
616  z3l = z5l + whatever * idir;
617
618  penpos4 (i_thick - bottom_blot, 0);
619  y4 = ypart center;
620  z4 - z3 = whatever * idir;
621
622  penpos5 (i_thick, 0);
623  z5l = right_ending + (i_left_space, 0);
624
625  fill simple_serif (z1l, z1r, 90)
626       ..tension 1.05.. z2r{right}
627       .. z5l{z3 - z5}
628       -- z3l
629       ..  z4l{right}
630       -- z4r{right}
631       .. z3r{z5 - z3}
632       -- z5r{z5 - z3}
633       ..tension 1.2.. z2l{left}
634       .. cycle;
635
636  right_ending := z5r;
637  penlabels (1, 2, 3, 4, 5);
638
639  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
640
641  clearxy;
642
643  i_thick := 23/80 ex;
644  i_angle := -6;
645  idir := dir (90 - i_angle);
646  i_left_space := 14/80 ex;
647
648  penpos1 (serif_thick, -i_twiddle_start_angle);
649  z1r = right_ending;
650
651  y2l = ex + overshoot;
652  z2l = .08 [z3l, z3r] + whatever * idir;
653  z2r = 5/8 [z1r, z3l] + whatever * idir;
654  y2r = y5l + 1/9 ex;
655  z2 = 1/2 [z2l, z2r];
656
657  penpos3 (whatever, 20);
658  y3l = 1/8 ex + ypart center;
659  z3l = z7l + whatever * idir;
660  z3r = z7r + whatever * idir;
661
662  penpos5 (whatever, 10);
663  z5l = right_ending + (i_left_space, 0);
664  z5r = z7r + whatever * idir;
665
666  penpos6 (serif_thick, -i_twiddle_end_angle);
667  y6l = 23/80 ex + ypart center;
668  z6l = 1.6 [z3l, z3r] + whatever * idir;
669
670  penpos7 (i_thick, 0);
671  y7 = 0;
672  z7l = z5l + whatever * idir;
673
674  z8 = z7 - (0, overshoot);
675
676  fill simple_serif (z1l, z1r, 90)
677       ..tension 1.05.. z2r{right}
678       .. z5l{z3 - z5}
679       -- z3l{z3 - z5}
680       .. z8{right}
681       .. simple_serif (z6r, z6l, 90)
682       ..tension 0.85.. z3r{z5 - z3}
683       -- z5r{z5 - z3}
684       ..tension 1.2.. z2l{left}
685       .. cycle;
686
687  penlabels (range 1 thru 8);
688fet_endchar;
689
690%
691% NOTES:
692%
693% * This is mostly copied from dynamic m (see above)
694%
695
696code := 109;
697
698fet_beginchar ("dynamic n", "n");
699  save i_thick, i_angle, i_twiddle_thick;
700  save i_twiddle_start_angle, i_twiddle_start_y;
701  save i_twiddle_end_angle, i_left_space;
702  save idir, center, right_ending;
703  save overshoot;
704  save p;
705  pair center, idir, right_ending;
706  path p;
707
708  set_char_box (0, 1.11 ex#, 0, 1.0 ex#);
709
710  % should share code with p for twiddle.
711
712  overshoot = .25 serif_thick;
713  i_thick := 21/80 ex;
714  i_twiddle_thick = 1.2 serif_thick;
715  i_twiddle_start_y = 8/16 ex;
716  i_twiddle_start_angle = 0;
717  i_twiddle_end_angle := 35;
718
719  center = (0, 0);
720
721  i_angle := 0;
722  idir := dir (90 - i_angle);
723  i_left_space = 16/80 ex;
724
725  penpos1 (i_twiddle_thick, -i_twiddle_start_angle);
726  y1 = i_twiddle_start_y;
727  z1r = center - (i_left_space, 0) + whatever * idir;
728
729  y2l = ex + overshoot;
730  z2l = .08 [z3l, z3r] + whatever * idir;
731  z2r = 5/8 [z1r, z3l] + whatever * idir;
732  y2r = y5l + 1/9 ex;
733  z2 = 1/2 [z2l, z2r];
734
735  penpos3 (i_thick, 0);
736  y3 = 0.5 bottom_blot + ypart center;
737  z3l = center + whatever * idir;
738
739  penpos4 (i_thick - bottom_blot, 0);
740  y4 = ypart center;
741  z4 - z3 = whatever * idir;
742
743  penpos5 (i_thick, 0);
744  z5 = z4 + whatever * idir;
745  y5 = 55/80 ex;
746
747  fill simple_serif (z1l, z1r, 90)
748       ..tension 1.2.. z2r{right}
749       .. z5l{z3 - z5}
750       -- z3l{z3 - z5}
751       .. z4l{right}
752       -- z4r{right}
753       .. z3r{z5 - z3}
754       -- z5r{z5 - z3}
755       ..tension 1.2.. z2l{left}
756       .. cycle;
757
758  right_ending := z5r;
759  penlabels (1, 2, 3, 4, 5);
760
761  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
762
763  clearxy;
764
765  i_thick := 23/80 ex;
766  i_angle := -6;
767  idir := dir (90 - i_angle);
768  i_left_space := 18/80 ex;
769
770  penpos1 (serif_thick, -i_twiddle_start_angle);
771  z1r = right_ending;
772
773  y2l = ex + overshoot;
774  z2l = .08 [z3l, z3r] + whatever * idir;
775  z2r = 5/8 [z1r, z3l] + whatever * idir;
776  y2r = y5l + 1/9 ex;
777  z2 = 1/2 [z2l, z2r];
778
779  penpos3 (whatever, 20);
780  y3l = 1/8 ex + ypart center;
781  z3l = z7l + whatever * idir;
782  z3r = z7r + whatever * idir;
783
784  penpos5 (whatever, 10);
785  z5l = right_ending + (i_left_space, 0);
786  z5r = z7r + whatever * idir;
787
788  penpos6 (serif_thick, -i_twiddle_end_angle);
789  y6l = 23/80 ex + ypart center;
790  z6l = 1.6 [z3l, z3r] + whatever * idir;
791
792  penpos7 (i_thick, 0);
793  y7 = 0;
794  z7l = z5l + whatever * idir;
795
796  z8 = z7 - (0, overshoot);
797
798  fill simple_serif (z1l, z1r, 90)
799       ..tension 1.05.. z2r{right}
800       .. z5l{z3 - z5}
801       -- z3l{z3 - z5}
802       .. z8{right}
803       .. simple_serif (z6r, z6l, 90)
804       ..tension 0.85.. z3r{z5 - z3}
805       -- z5r{z5 - z3}
806       ..tension 1.2.. z2l{left}
807       .. cycle;
808
809  penlabels (range 1 thru 8);
810fet_endchar;
811
812code := 113;
813
814fet_beginchar ("dynamic r", "r");
815  save base_point, stem_thick, bulb_diam;
816  save twiddle_thick, attach_len, overshoot, taille;
817  pair base_point;
818
819  set_char_box (0, .75 ex#, 0, ex#);
820
821  stem_thick =.26 ex;
822  bulb_diam = .30 ex;
823  twiddle_thick = 1.1 serif_thick;
824  overshoot = .5 serif_thick;
825  taille = -0.3 serif_thick;
826  attach_len + bulb_diam / 2 + stem_thick = w;
827
828
829  base_point = (0, 0);
830
831  currenttransform := identity slanted ypart (dir (15));
832
833  penpos1 (stem_thick, 0);
834  x1l = 0;
835  y1l = .5 bottom_blot;
836
837  penpos2 (stem_thick, 0);
838  x2l = x1l;
839  y2l - y1l = 36/47 ex;
840
841  penpos3 (twiddle_thick, -20);
842  x3r = x2l - .2 ex;
843  y3 = .77  ex;
844
845  x4l = -0.1 [x1l, x1r];
846  y4l = ex + overshoot;
847  x4r = 0.62 [x3r, x2l];
848  y4r = 0.5 [y4l, y2l];
849
850  penpos5 (whatever, -74);
851  y5l - y5r =  bulb_diam;
852  y5l = ex + overshoot;
853  x5 = x2r + attach_len;
854
855  penpos6 (bulb_diam, 0);
856  z6 = z5;
857
858%  z7 = z6l + taille * dir (180);
859  z7 = z6 + .4 * bulb_diam * dir (-125);
860
861  z8 = 9/10 [z1r, z2r];
862
863  x9 = 0.15 [x1r, x1l];
864  y9 = y4l - .12 ex;
865
866  penpos10 (stem_thick - bottom_blot, 0);
867  x10 = x1;
868  y10 = 0;
869
870%  pickup pencircle scaled 1;
871
872%  draw
873  fill z1r{down}
874       .. z10r{left}
875       -- z10l{left}
876       .. z1l{up}
877       -- z2l{up}
878       .. z4r{left}
879       ..tension 1.2.. {down}simple_serif (z3r, z3l,-90){up}
880       ..tension 0.95.. z4l
881       .. {curl 1}z9{curl 1}
882       .. z5l
883       .. z6r{dir (-80)}
884       .. z5r{left}
885       .. z7
886       .. z6l
887       ..tension 1.2.. z8{down}
888       -- cycle;
889
890  penlabels (range 1 thru 10);
891fet_endchar;
892
893
894%%% KERNING
895
896ligtable "m":
897  "p" kern 0.2 ex#,
898  "f" kern -0.1 ex#;
899
900ligtable "n":
901  "p" kern 0.2 ex#,
902  "f" kern -0.1 ex#;
903
904ligtable "f":
905  "f" kern -0.13 ex#;
906
907ligtable "r":
908  "f" kern 0.1 ex#;
909
910
911%% notes from old dyn code.
912
913% `f' obviously has a _lot_ bigger slant than `p' (see Wanske p.239).
914% However; perhaps we need two f symbols:
915%  - a super-slanted one used in `f', `mf', `sfz', `sf'
916%  - a more normal-slanted in `ff', `fff', `fp', `fp' (see Wanske p.241)
917%
918% Looking at professionally typeset music reveals that typesetters
919% are somewhat unsure about slanting in `mf', `fp', `sfz'
920%
921% `f' and `p' (in any combination) are a lot (factor two) fatter than
922% `s', `m', and `z'.  Sometimes the `m' and `z' are a bit fatter than
923% `s'.
924%
925% Chester, Breitkopf suggest smaller sizes of these other glyphs,
926% using the x-height as reference point.
927