2 ex# := (dynamic_design_size / 2.4) * pt#;
5 staffspace# := 1.75 / 2.0 * ex#;
6 horizontal_space# := .66 ex#;
9 font_normal_space horizontal_space#;
11 define_pixels (staffspace, linethickness, ex, descender, ascender);
15 % TODO: blot diameter should be fixed, not scalable.
18 save serif_thick, med_thick, bottom_blot;
20 serif_thick# = 1.1 linethickness#;
21 define_blacker_pixels (serif_thick);
23 med_thick = round (1.5 linethickness);
24 bottom_blot = 1.3 serif_thick;
29 fet_beginchar ("Space", "space");
30 set_char_box (0, horizontal_space#, 0, ex#);
35 % Couldn't find many z examples. This one is losely inspired
36 % by a sfz from Mueller Etuden fuer Horn (Edition Hofmeister).
41 fet_beginchar ("dynamic z", "z");
42 save thin_thick, top_narrow, over_shoot;
45 set_char_box (0, .98 ex#, 0, 0.9 ex#);
47 thin_thick = serif_thick;
48 top_narrow = thin_thick;
49 top_overshoot = .8 serif_thick;
52 bot_overshoot = serif_thick;
57 penpos1 (top_thick, 80);
62 y2 = y1r - top_overshoot;
64 y3 = h - .7 thin_thick;
65 x3 = w - .6 top_narrow - .5 thin_thick;
69 penpos3 (thin_thick, angle (z3 - z4) + 90);
70 penpos4 (thin_thick, angle (z3 - z4) + 90);
72 penpos5 (bot_thick, 70);
74 y5l = .4 bot_overshoot;
76 penpos6 (3/2 bot_thick, 70);
78 x6 = w - 3 top_narrow;
83 penpos8 (thin_thick, 20);
84 x8r = w - .35 top_narrow;
87 penlabels (range 0 thru 8);
89 % pickup pencircle scaled 1;
94 .. simple_serif (z3l, z3r, 90)
97 .. tension 1.2.. cycle;
107 fill simple_serif (z4r, z4l, 90)
111 .. simple_serif (z8r, z8l, 90)
118 % forte f, grabbed from Ed Breitkopf Mozart horn concerto 3.
122 % * the bulbs are open.
124 % * blotting around the serif
128 % TODO: insert blots around the serif
136 fet_beginchar ("dynamic f", "f");
137 save left_angle, right_angle;
138 save serif_length, serif_excentricity;
140 save bulb_thick, bulb_diam, fill_up;
145 set_char_box (0, 1.1 ex#, descender#, ex# + ascender#);
147 bulb_diam = 7.5 / 40 ex;
148 bulb_thick = 8.5/40 ex;
149 fill_up = 1.5 serif_thick;
150 left_angle = slant_angle - 6;
151 right_angle = slant_angle - 3;
153 serif_length = 0.96 ex;
154 serif_excentricity = 0.01 ex;
156 % z1 is the `base point'
157 z1 = (0.2 ex, -serif_thick);
159 penpos2 (f_thick, 0);
161 z2l = z1 + whatever * dir (90 - left_angle);
163 penpos3 (med_thick, -90);
164 y3l = y1 + ex + ascender;
167 penpos4 (bulb_thick, -20);
168 z3r = whatever [z4r, z4l];
172 penpos5 (bulb_thick, -45);
173 x5r = 0.1 [x4l, x4r];
174 y5l = y4l - bulb_diam;
176 z6 = z2r + whatever * dir (90 - right_angle);
179 penpos7 (med_thick, -90);
183 penpos8 (bulb_thick, 160);
186 z7l = whatever [z8r,z8l];
188 penpos9 (bulb_thick, 135);
189 x9r = 0.1 [x8l, x8r];
190 y9l = y8l + bulb_diam;
193 penlabels (2, 3, 4, 5, 7, 8, 9);
195 % pickup pencircle scaled 1;
200 ..tension 1.1.. z3l{right}
204 ..tension 0.8.. z4l{up}
206 ..tension 1.1.. z2r{z6 - z2r}
208 ..tension 1.25 .. z7r{left}
212 ..tension 0.8.. z8l{down}
216 x13 - x14 = serif_length;
219 0.5 [x13, x14] = x2 + serif_excentricity;
221 draw_rounded_block (z14 - (0, 0.7 serif_thick),
222 z13 + (0, 0.7 serif_thick),
232 % - The `s' is trapezoidal (i.e., narrower at the top).
234 % - The white space is differently shaped at the top (the bulb's inner
235 % curve is filled up).
237 % - Less heavy than the `f' and `p' signs.
242 fet_beginchar ("dynamic s", "s");
243 save left_angle, right_angle;
244 save s_thick, s_thin;
245 save bulb_diam, bulb_len;
250 set_char_box (0, 17/24 ex#, 0, ex#);
252 over_shoot = 0; % .2 serif_thick;
253 bulb_diam = 11/70 ex;
254 bulb_len = 1.0 bulb_diam;
255 left_angle = slant_angle - 2;
256 right_angle = slant_angle - 11;
258 s_thin = serif_thick;
262 penpos1 (bulb_diam, -45);
263 z1 = 0.35 [z2l, z2r] + bulb_len * dir (45);
265 penpos2 (bulb_diam, -25);
266 y2l = 0.845 [y7r, y3r];
267 z2l = base_point + whatever * dir (90 - left_angle);
269 penpos3 (s_thin, 100);
271 y3l = ypart base_point - over_shoot;
273 penpos4 (s_thick, 25);
275 z4r = base_point + (w, 0) + whatever * dir (90 - right_angle);
277 penpos5 (s_thick, 40);
278 z5 = z3l + whatever * dir (90 - right_angle);
279 y5 = 0.48 [y7r, y3r];
281 penpos6 (s_thick, 25);
282 z6l = base_point + whatever * dir (90 - left_angle);
285 penpos7 (.9 s_thin, 110);
286 z7l = 0.45 [z6r, z8l] + whatever * dir (90 - left_angle);
287 y7r = h + over_shoot;
289 penpos8 (.9 bulb_diam, -25);
290 z8 = .6 [z4l, z4r] + whatever * dir (90 - right_angle);
291 y8r = 0.23 [y7r, y3r];
293 penpos9 (.9 bulb_diam, -45);
294 z9 = .4 [z8r, z8l] + .9 bulb_len * dir (-135);
296 penlabels (range 1 thru 9);
298 % pickup pencircle scaled 1;
325 slant := ypart (dir (slant_angle));
329 % Piano `p', grabbed from Ed Breitkopf Mozart horn concerto 3.
333 % * There is no dishing in the serif (but we do it anyway).
335 % * The cheek is a little fatter than the stem.
337 % * The slant is extreme: 20 degrees.
339 % * The twiddle (what'sitcalled) is a slightly darker than the serif.
341 % * The hole in the cheek has a straight right side.
343 % * Corners are filled up.
348 fet_beginchar("dynamic p", "p")
349 % TODO: w really is 13/12 ex
350 % but should do kerning
352 save twiddle_thick, stem_thick, cheek_thick, cheek_width;
353 save fill_up, straigh_len;
354 save serif, dishing_angle, p, tmp;
355 save cheek_medium, left_serif_protude, right_serif_protude;
356 save lower_overshoot;
357 save blot_t, corner_t;
361 set_char_box (0, 15/12 ex#, descender#, 1.0 ex#);
363 twiddle_thick = med_thick;
364 cheek_medium = 1/6 ex;
367 fill_up = 1.5 serif_thick;
368 straigh_len = 0.5 ex;
369 lower_overshoot = .3 serif_thick;
372 cheek_thick = 13/32 ex;
373 cheek_width = 0.72 ex;
374 left_serif_protude = 18/60 ex;
375 right_serif_protude= 15/60 ex;
377 currenttransform := currenttransform slanted slant;
379 penpos1 (twiddle_thick, -slant - 5);
380 penpos2 (cheek_medium, 90 - slant);
381 penpos3 (cheek_medium, 90 - slant);
383 x4r - x4l = cheek_thick;
385 penpos4 (whatever, 0);
386 penpos5 (whatever, -38);
387 penpos6 (stem_thick, 0);
388 penpos17 (straigh_len, 90 - slant);
390 whatever [z17l, z17r] = z4l;
393 y6l = -descender + serif_thick / 2;
394 z1l = z6l - whatever * dir (110);
397 z7 = whatever * up + z6l;
399 z2l = whatever * up + 0.3 [z7, z1r];
401 z8 = 2/3 [z6l, z6r] + whatever * up;
403 z3l = 0.58 [(stem_thick, -descender),
404 (stem_thick + cheek_width - cheek_thick, -descender)]
407 z4r = whatever * up + (stem_thick + cheek_width, -descender);
408 z5l = whatever * up + z3l;
409 y5r = -lower_overshoot;
410 y5l = y5r + cheek_medium * ypart dir (55);
411 z9 = z6r + whatever * up;
415 .. {dir (-60)}z8{dir 60}
418 ..tension 1.1.. z5r{left}
424 ..tension 1.2.. simple_serif (z1r, z1l, -90)
428 corner_t := xpart (p intersectiontimes z9);
430 % pickup pencircle scaled 1;
433 fill subpath (0, corner_t - 2 blot_t) of p
434 .. subpath (corner_t + blot_t, length p) of p
438 z12 = z6r + whatever * up;
443 ..tension 1.05.. z12{down}
444 ..tension 1.05.. z5l{right}
447 penlabels (1, 2, 3, 4, 5, 6, 17);
450 pickup pencircle scaled serif_thick;
452 lft x11 = -left_serif_protude;
453 rt x10 = stem_thick + right_serif_protude;
454 bot y10 = bot y11 = -descender;
456 z15 = z6l + up * fill_up;
457 z16 = z6r + up * 1.2 fill_up;
459 % Since pens are not affected by currenttransform we directly
460 % transform the necessary points, then simulating the pen with
461 % an outline while using the identity transformation.
463 forsuffixes $ = 7, 10, 11, 15, 16:
464 tmp := z$ transformed currenttransform;
469 currenttransform := identity;
473 serif := simple_serif (z10, z11, dishing_angle);
475 penpos10 (serif_thick, -dishing_angle - 90);
476 penpos11 (serif_thick, dishing_angle - 90);
477 penpos13 (serif_thick, angle (direction 0.05 of serif) + 90);
478 penpos14 (serif_thick, angle (direction 0.85 of serif) + 90);
480 z13 = point 0.05 of serif;
481 z14 = point 0.85 of serif;
483 penlabels (10, 11, 13, 14);
488 .. z14l{direction 0.85 of serif}
489 .. z11l{-dir (dishing_angle)}
490 .. z11r{dir (dishing_angle)}
491 .. z14r{-direction 0.85 of serif}
492 .. z13r{-direction 0.05 of serif}
493 .. z10r{dir (-dishing_angle)}
494 .. z10l{-dir (-dishing_angle)}
495 .. z13l{direction 0.05 of serif}
504 % * Right stem is fatter and more straight than the left two stems.
506 % * The twiddle at the left is similar to the `p' twiddle.
508 % * The bottoms of the stems are blotted.
511 % This is cut & paste programming. Somehow three `i' shapes in two
512 % characters (`p' and `m') -- doesn't seem worth the trouble of writing
518 fet_beginchar ("dynamic m", "m");
519 save i_thick, i_angle, i_twiddle_thick;
520 save i_twiddle_start_angle, i_twiddle_start_y;
521 save i_twiddle_end_angle, i_left_space;
522 save idir, center, right_ending;
525 pair center, idir, right_ending;
528 set_char_box (0, 1.5 ex#, 0, 1.0 ex#);
530 % should share code with p for twiddle.
532 overshoot = .25 serif_thick;
534 i_twiddle_thick = 1.2 serif_thick;
535 i_twiddle_start_y = 8/16 ex;
536 i_twiddle_start_angle = 0;
537 i_twiddle_end_angle := 35;
541 currenttransform := currenttransform slanted slant;
544 idir := dir (90 - i_angle);
545 i_left_space = 16/80 ex;
547 penpos1 (i_twiddle_thick, -i_twiddle_start_angle);
548 y1 = i_twiddle_start_y;
549 z1r = center - (i_left_space, 0) + whatever * idir;
551 y2l = ex + overshoot;
552 z2l = .08 [z3l, z3r] + whatever * idir;
553 z2r = 5/8 [z1r, z3l] + whatever * idir;
557 penpos3 (i_thick, 0);
558 y3 = 0.5 bottom_blot + ypart center;
559 z3l = center + whatever * idir;
561 penpos4 (i_thick - bottom_blot, 0);
563 z4 - z3 = whatever * idir;
565 penpos5 (i_thick, 0);
566 z5 = z4 + whatever * idir;
569 fill simple_serif (z1l, z1r, 90)
570 ..tension 1.2.. z2r{right}
577 ..tension 1.2.. z2l{left}
581 penlabels (1, 2, 3, 4, 5);
583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
588 idir := dir (90 - i_angle);
589 i_left_space := 14/80 ex;
591 penpos1 (serif_thick, -i_twiddle_start_angle);
595 z2l = .08 [z3l, z3r] + whatever * idir;
596 z2r = 5/8 [z1r, z3l] + whatever * idir;
600 penpos3 (i_thick, 0);
601 y3 = 0.5 bottom_blot + ypart center;
602 z3l = z5l + whatever * idir;
604 penpos4 (i_thick - bottom_blot, 0);
606 z4 - z3 = whatever * idir;
608 penpos5 (i_thick, 0);
609 z5l = right_ending + (i_left_space, 0);
611 fill simple_serif (z1l, z1r, 90)
612 ..tension 1.05.. z2r{right}
619 ..tension 1.2.. z2l{left}
623 penlabels (1, 2, 3, 4, 5);
625 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
631 idir := dir (90 - i_angle);
632 i_left_space := 14/80 ex;
634 penpos1 (serif_thick, -i_twiddle_start_angle);
637 y2l = ex + overshoot;
638 z2l = .08 [z3l, z3r] + whatever * idir;
639 z2r = 5/8 [z1r, z3l] + whatever * idir;
643 penpos3 (whatever, 20);
644 y3l = 1/8 ex + ypart center;
645 z3l = z7l + whatever * idir;
646 z3r = z7r + whatever * idir;
648 penpos5 (whatever, 10);
649 z5l = right_ending + (i_left_space, 0);
650 z5r = z7r + whatever * idir;
652 penpos6 (serif_thick, -i_twiddle_end_angle);
653 y6l = 23/80 ex + ypart center;
654 z6l = 1.6 [z3l, z3r] + whatever * idir;
656 penpos7 (i_thick ,0);
658 z7l = z5l + whatever * idir;
660 z8 = z7 - (0, overshoot);
662 fill simple_serif (z1l, z1r, 90)
663 ..tension 1.05.. z2r{right}
667 .. simple_serif (z6r, z6l, 90)
668 ..tension 0.85.. z3r{z5 - z3}
670 ..tension 1.2.. z2l{left}
673 penlabels (range 1 thru 8);
679 fet_beginchar ("dynamic r", "r");
680 save base_point, stem_thick, bulb_diam;
681 save twiddle_thick, attach_len, overshoot, taille;
684 set_char_box (0, .75 ex#, 0, 1ex#);
688 twiddle_thick= 1.1 serif_thick;
689 overshoot = .5 serif_thick;
690 taille = -0.3 serif_thick;
691 attach_len + bulb_diam / 2 + stem_thick = w;
696 currenttransform := identity slanted ypart (dir (15));
698 penpos1 (stem_thick, 0);
700 y1l = .5 bottom_blot;
702 penpos2 (stem_thick, 0);
704 y2l - y1l = 36/47 ex;
706 penpos3 (twiddle_thick, -20);
710 x4l = -0.1 [x1l, x1r];
711 y4l = ex + overshoot;
712 x4r = 0.62 [x3r, x2l];
713 y4r = 0.5 [y4l, y2l];
715 penpos5 (whatever, -74);
716 y5l - y5r = bulb_diam;
717 y5l = ex + overshoot;
718 x5 = x2r + attach_len;
720 penpos6 (bulb_diam, 0);
723 % z7 = z6l + taille * dir (180);
724 z7 = z6 + .4 * bulb_diam * dir (-125);
726 z8 = 9/10 [z1r, z2r];
728 x9 = 0.15 [x1r, x1l];
731 penpos10 (stem_thick - bottom_blot, 0);
735 % pickup pencircle scaled 1;
744 ..tension 1.2.. {down}simple_serif (z3r, z3l,-90){up}
746 .. {curl 1}z9{curl 1}
752 ..tension 1.2.. z8{down}
755 penlabels (range 1 thru 10);
772 %% notes from old dyn code.
774 % `f' obviously has a _lot_ bigger slant than `p' (see Wanske p.239).
775 % However; perhaps we need two f symbols:
776 % - a super-slanted one used in `f', `mf', `sfz', `sf'
777 % - a more normal-slanted in `ff', `fff', `fp', `fp' (see Wanske p.241)
779 % Looking at professionally typeset music reveals that typesetters
780 % are somewhat unsure about slanting in `mf', `fp', `sfz'
782 % `f' and `p' (in any combination) are a lot (factor two) fatter than
783 % `s', `m', and `z'. Sometimes the `m' and `z' are a bit fatter than
786 % Chester, Breitkopf suggest smaller sizes of these other glyphs,
787 % using the x-height as reference point.