4 % TODO: blot diameter should be fixed, not scalable.
10 serif_thick# = 1.1 linethickness#;
11 define_blacker_pixels (serif_thick);
12 med_thick = round (1.5 linethickness);
13 bottom_blot = 1.3 serif_thick;
17 fet_beginchar("Space", "space", "space")
18 set_char_box(0, horizontal_space#, 0, ex#);
23 % Couldn't find many z examples. This one is losely inspired
24 % by a sfz from Mueller etuden fuer Horn (Edition Hofmeister.)
28 fet_beginchar ("dynamic z", "z", "dynz");
29 set_char_box (0, .98 ex#, 0, 0.9 ex#);
31 save thin_thick, top_narrow, over_shoot;
34 thin_thick = serif_thick;
35 top_narrow = thin_thick;
36 top_overshoot = .8 serif_thick;
39 bot_overshoot = serif_thick;
46 y2 = y1r - top_overshoot;
49 y3 = h - .7 thin_thick;
50 x3 = w - .6 top_narrow - .5 thin_thick;
56 y5l = .4 bot_overshoot;
58 x6 = w - 3 top_narrow;
61 x8r = w - .35 top_narrow;
65 penpos1(top_thick, 80);
66 penpos3 (thin_thick, angle(z3-z4) + 90);
67 penpos4(thin_thick, angle (z3-z4) + 90);
68 penpos5(bot_thick, 70);
69 penpos6(3/2 bot_thick, 70);
70 penpos8 (thin_thick, 20);
72 penlabels(range 0 thru 9);
80 .. simple_serif (z3l, z3r, 90) .. z2{left} .. z1r{left}
83 q := z3l -- z3r -- z4r -- z4l -- cycle;
84 r := simple_serif (z4r, z4l, 90) .. z5l{right}
87 .. simple_serif (z8r, z8l, 90)
88 .. z6r{left} .. z5r{left} .. cycle;
89 pickup pencircle scaled 1;
90 % draw p ; draw q ; draw r ;
92 fill p; fill q; fill r;
97 % forte f, grabbed from Ed Breitkopf Mozart horn concerto 3.
101 % * the bulbs are open.
103 % * blotting around the serif
107 % TODO: insert blots around the serif
115 fet_beginchar("dynamic f", "f", "dynf");
116 set_char_box (0, 1.1 ex#, descender#, ex# + ascender#);
118 save left_angle, right_angle;
119 save serif_length, serif_excentricity;
121 save bulb_thick, bulb_diam, fill_up;
124 bulb_diam = 7.5 / 40 ex;
125 bulb_thick = 8.5/40 ex;
126 fill_up = 1.5 serif_thick;
128 left_angle = slant_angle - 6;
129 right_angle = slant_angle - 3;
131 serif_length = 0.96 ex;
132 serif_excentricity = 0.01 ex;
135 % z1 is the "base point"
136 z1 = (0.2 ex, - serif_thick);
138 z2l = z1 + whatever*dir (90 - left_angle);
139 penpos2 (f_thick, 0);
141 y3l = y1 + ex + ascender;
143 penpos3 (med_thick, -90);
144 penpos4 (bulb_thick, -20);
145 z3r = whatever [z4r,z4l];
149 penpos5(bulb_thick, -45);
150 x5r = 0.1 [x4l, x4r];
151 y5l = y4l - bulb_diam;
153 z6 = z2r + whatever* dir (90 - right_angle);
158 penpos7(med_thick, -90);
160 penpos8 (bulb_thick, 160);
162 z7l = whatever [z8r,z8l];
164 penpos9 (bulb_thick, 135);
165 x9r = 0.1 [x8l, x8r];
166 y9l = y8l + bulb_diam;
168 penlabels(2, 3,4,5, 7, 8,9);
172 .. z3l{right} .. z4r{down}
173 .. z5r{left} .. z5l{up}
175 .. z4l{up} .. z3r{left}
177 .. z2r --- z6 .. tension 1.25 .. z7r{left}
178 .. z8r{up} .. z9r{right} .. z9l{down} .. tension 0.8
179 .. z8l{down} .. z7l{right} .. cycle;
180 pickup pencircle scaled 1;
185 % todo round for pixels...
187 pickup pencircle scaled round (1.4 serif_thick);
188 (rt x13) - (lft x14) = serif_length;
191 0.5 [x13, x14] = x2 + serif_excentricity;
203 % - The S is trapezoidal (i.e. narrower at the top)
205 % - The white space is differently shaped at the top (the bulb's inner
206 % curve is filled up.)
208 % - less heavy than the f and p signs.
213 fet_beginchar("dynamic s", "s", "dyns");
214 set_char_box (0, 17/24 ex#, 0, 1 ex#);
216 save left_angle, right_angle;
217 save s_thick, s_thin;
219 save bulb_diam, bulb_len;
221 over_shoot = 0; % .2 serif_thick;
224 bulb_diam = 11/70 ex;
225 bulb_len = 1.0 bulb_diam;
226 left_angle = slant_angle - 2;
227 right_angle = slant_angle -11;
230 s_thin = serif_thick;
234 penpos1 (bulb_diam, -45);
235 z1 = 0.35 [z2l,z2r] + bulb_len * dir(45);
236 penpos2 (bulb_diam, -25);
237 y2l = 0.845 [y7r, y3r];
239 z2l = base_point + whatever * dir (90-left_angle);
240 penpos3 (s_thin, 100);
242 y3l = ypart base_point - over_shoot ;
244 penpos4 (s_thick, 25);
245 ypart z4l = ypart z1r;
246 z4r = base_point + (w,0) + whatever *dir(90-right_angle);
247 penpos5 (s_thick, 40);
248 z5 = z3l + whatever * dir (90-right_angle);
249 y5 = ypart (0.48 [z7r, z3r]);
252 penpos6 (s_thick, 25);
253 z6l = base_point + whatever *dir(90-left_angle);
256 penpos7 (.9 s_thin, 110);
257 z7l = 0.45 [z6r, z8l] + whatever * dir (90-left_angle);
258 y7r = h + over_shoot;
260 penpos8 (.9 bulb_diam, -25);
261 z8 = .6 [z4l,z4r] + whatever *dir(90-right_angle);
263 y8r = ypart (0.23 [z7r, z3r]);
265 penpos9 (.9 bulb_diam, -45);
266 z9 = .4 [z8r,z8l] + .9 bulb_len * dir (-135);
268 penlabels(1,2,3,4,5,6,7,8,9);
273 p := z2l{down} .. z3l{right} .. z4r{up}
279 .. z9r{right} .. z7r{left}
284 .. z2r{up} .. z1r{up}
285 .. z1l{left} .. cycle;
286 pickup pencircle scaled 1;
294 % piano p, grabbed from Ed Breitkopf Mozart horn concerto 3.
298 % * there is no dishing in the serif (but we do it anyway)
300 % * The cheek is a little fatter than the stem
302 % * The slant is extreme: 20 degrees
304 % * the twiddle (what'sitcalled) is a slightly darker than the serif
306 % * The hole in the cheek has a straight right side.
308 % * Corners are filled up.
313 slant := ypart (dir(slant_angle));
314 currenttransform := currenttransform slanted slant;
319 fet_beginchar("dynamic p", "p", "dynp")
321 % TODO w really is 13/12 ex
322 % but should do kerning
323 set_char_box (0, 15/12 ex#, descender#, 1.0 ex#);
325 save twiddle_thick, stem_thick, cheek_thick;
327 save serif, dishing_angle, p, q;
328 save cheek_medium, left_serif_protude, right_serif_protude;
329 save lower_overshoot;
335 updir := dir (90 - my_slant_angle );
336 twiddle_thick = med_thick;
337 cheek_medium = 1/6 ex;
340 fill_up := 1.5 serif_thick;
341 straigh_len = 0.5 ex;
342 lower_overshoot := .3 serif_thick;
345 cheek_thick = 13/32 ex;
346 cheek_width = 0.72 ex;
347 left_serif_protude = 18/60 ex;
348 right_serif_protude= 15/60 ex;
350 penpos1 (twiddle_thick, -slant - 5);
351 penpos2 (cheek_medium, 90 - slant );
352 penpos3 (cheek_medium, 90 - slant);
354 x4r - x4l = cheek_thick;
355 penpos4 (whatever, 0);
356 penpos5 (whatever, -38);
357 penpos6 (stem_thick, 0);
358 penpos17 (straigh_len, 90 -slant);
359 whatever [z17l, z17r] = z4l;
363 y6l = - descender + serif_thick/2;
364 z1l = z6l - whatever *dir (90 - my_slant_angle + 20 );
367 z7 = whatever * updir + z6l;
370 z2l = whatever *updir + 0.3 [z7, z1r];
371 y8 = ypart (0.9 [z7, z2l]);
372 z8 = 2/3 [z6l, z6r] + whatever * updir;
376 z3l = 0.58 [(stem_thick, -descender), (stem_thick + cheek_width - cheek_thick, -descender)] + whatever * updir;
378 z4r = whatever*updir + (stem_thick+ cheek_width, -descender);
380 z5l = whatever*updir + z3l;
381 y5r = -lower_overshoot;
382 y5l = y5r + cheek_medium * ypart dir(55);
384 z9 = z6r + whatever*updir;
388 z2r{right} .. {dir( -60)}z8 & z8{dir 35} .. z3r{right}
392 & z9 -- z6r -- z6l -- z7{updir}
393 .. z2l{left} .. tension 1.2 ..
394 % z1r & z1r -- z1l & z1l
395 simple_serif (z1r, z1l, -90)
399 save blot_t, corner_t;
402 corner_t := xpart (p intersectiontimes z9);
404 z19 = point corner_t - 2 blot_t of p;
405 z20 = point corner_t + blot_t of p;
411 pickup pencircle scaled 1;
413 fill z19{up} .. {right}z20{updir} .. z19{-(direction corner_t - 2 blot_t of p)} .. cycle;
415 pickup pencircle scaled 1;
419 z12 = z6r + whatever*updir;
424 z17l .. tension 1.5 .. z17r .. z3l{left}.. tension 1.05 .. z12{-updir} .. tension 1.05 .. z5l{right} .. cycle;
426 penlabels (1, 2, 3, 4, 5, 6, 17);
431 pickup pencircle scaled serif_thick;
432 lft x11 = -left_serif_protude;
433 rt x10 = stem_thick+ right_serif_protude;
434 bot y10 = bot y11 = -descender;
437 serif := simple_serif (z10, z11, dishing_angle);
440 labels(7,8, 9, 10, 11,12);
443 z13 = point 0.05 of serif;
444 z14 = point 0.85 of serif;
445 z15 = z6l + updir * fill_up +( serif_thick/2, 0);
446 z16 = z6r + updir * 1.2fill_up- +( serif_thick/2, 0);
447 labels(13,14, 15, 16);
449 % pickup pencircle scaled 1;
450 draw z13{direction 0.05 of serif} .. z16{updir};
451 draw z14{-(direction 0.85 of serif)} .. z15{updir};
457 % * right stem is fatter and more straight than the left 2 two stems.
459 % * The twiddle at the left is similar to the p twiddle
461 % * The bottoms of the stems are blotted.
466 % This is cut & paste programming. Somehow 3 i shapes in two chars (p and m)
467 % Doesn't seem worth the trouble of writing a macro.
471 fet_beginchar("dynamic m", "m", "dynm");
472 set_char_box (0, 1.5 ex#, 0, 1.0 ex#);
474 % should share code with p for twiddle.
476 save i_thick, i_angle, i_twiddle_thick,
477 i_twiddle_start_angle, i_twiddle_start_y,
480 save idir, center, right_ending;
482 pair center, idir, right_ending;
486 overshoot = .25 serif_thick;
487 i_thick := 21 / 80 ex;
489 idir := dir(90- i_angle);
491 i_left_space = 16/80 ex;
492 i_twiddle_thick = 1.2 serif_thick;
493 i_twiddle_start_y = 8/16 ex;
494 i_twiddle_start_angle = 0;
497 penpos1 (i_twiddle_thick, -i_twiddle_start_angle);
498 y1 = i_twiddle_start_y;
499 z1r = center - (i_left_space,0) + whatever * idir;
501 y3 = 0.5 bottom_blot + ypart center;
503 z3l = center + whatever * idir;
505 penpos4 (i_thick - bottom_blot, 0);
506 z4 - z3 = whatever * idir;
508 y2l = 1 ex + overshoot;
509 z2l = .08 [z3l, z3r] + whatever * idir;
510 z2r = 5/8 [z1r, z3l] + whatever * idir;
512 z2 = 1/2 [z2l, z2r] ;
514 z5 = z4 + whatever * idir;
517 p := simple_serif (z1l, z1r, 90) .. tension 1.2 .. z2r{right} .. z5l --- z3l
518 .. z4l --- z4r .. z3r --- z5r .. tension 1.2 .. z2l{left} .. cycle;
522 penlabels (1, 2, 3 , 4,5);
524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
528 idir := dir(90 - i_angle);
529 i_left_space := 14/80 ex;
533 z5l = right_ending + (i_left_space,0);
534 penpos1(serif_thick, - i_twiddle_start_angle);
536 y3 = .5 bottom_blot + ypart center;
538 z3l = z5l + whatever * idir;
540 penpos4(i_thick - bottom_blot, 0);
541 z4 - z3 = whatever * idir;
543 y2l = 1 ex+ overshoot;
545 z2l = .08 [z3l, z3r] + whatever * idir;
546 z2r = 5/8 [z1r, z3l] + whatever * idir;
548 z2 = 1/2 [z2l, z2r] ;
551 p := simple_serif (z1l, z1r, 90) .. tension 1.05 .. z2r{right} .. z5l --- z3l
552 .. z4l --- z4r .. z3r --- z5r .. tension 1.2 .. z2l{left} .. cycle;
556 penlabels (1, 2, 3 , 4,5);
558 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
560 i_thick := 23 / 80 ex;
562 i_left_space := 14/80 ex;
565 idir := dir(90- i_angle);
567 z5l = right_ending + (i_left_space,0);
568 penpos5 (whatever, 10);
569 penpos3 (whatever, 20);
574 penpos1(serif_thick, - i_twiddle_start_angle);
576 z3l = z7l + whatever * idir;
577 z3r = z7r + whatever * idir;
578 z5l = z7l + whatever * idir;
579 z5r = z7r + whatever * idir;
581 save end_twiddle_angle;
582 end_twiddle_angle := 35;
583 penpos6(serif_thick, - end_twiddle_angle);
584 y6l = 23/80 ex + ypart center;
585 z6l = 1.6 [z3l, z3r] + whatever * idir;
589 y3l = 1/8 ex + ypart center;
590 y2l = 1 ex+ overshoot;
591 z2l = .08 [z3l, z3r] + whatever * idir;
592 z2r = 5/8 [z1r, z3l] + whatever * idir;
594 z2 = 1/2 [z2l, z2r] ;
595 z8 = z7 - (0, 1 overshoot);
597 p := simple_serif (z1l, z1r, 90) .. tension 1.05
598 .. z2r{right} .. z5l --- z3l
600 .. simple_serif(z6r, z6l, 90)
604 .. z2l{left} .. cycle;
606 % pickup pencircle scaled 1;
610 penlabels (1, 2, 3 , 4,5,6,7, 8);
619 currenttransform := identity slanted ypart(dir(15));
620 fet_beginchar("dynamic r", "r", "dynr");
621 set_char_box (0, .75 ex#, 0, 1ex#);
624 save base_point, stem_thick, bulb_diam;
625 save twiddle_thick, attach_len, overshoot, taille;
628 twiddle_thick= 1.1 serif_thick;
629 overshoot = .5 serif_thick;
631 taille = -0.3 serif_thick;
637 y1l = .5 bottom_blot;
639 penpos10(stem_thick - bottom_blot, 0);
643 penpos1 (stem_thick, 0);
644 y2l - y1l = 36/47 ex;
646 penpos2 (stem_thick, 0);
650 penpos3(twiddle_thick, -20);
652 x9 = 0.15 [x1r, x1l] ;
655 x4l = -0.1 [x1l, x1r];
656 y4l = ex + overshoot;
658 x4r = 0.62 [x3r, x2l];
659 y4r = 0.5 [y4l, y2l];
661 penpos5(whatever, -74);
662 y5l - y5r = bulb_diam;
663 y5l = ex + overshoot;
664 x5 = x2r + attach_len;
665 attach_len + bulb_diam/2 + stem_thick = w;
668 penpos6 (bulb_diam, 0);
669 % z7 = z6l + taille* dir(180);
673 z7 = z6 + .4 * bulb_diam * dir (-90 -alpha);
674 z8 = 9/10 [z1r, z2r];
680 p := z1r .. z10r --- z10l .. z1l
684 .. {down}simple_serif(z3r, z3l,-90){up}
696 pickup pencircle scaled 1;
699 penlabels (1,2,3, 4,5,6,7,8, 9, 10);
708 ligtable "m" : "p" kern 0.2 ex#, "f" kern -0.1 ex#;
709 ligtable "f" : "f" kern -0.13 ex#;
710 ligtable "r" : "f" kern 0.1 ex#;
721 %% notes from old dyn code.
723 % "f" obviously has a _lot_ bigger slant than "p" (see Wanske p.239)
724 % however; perhaps we need two f symbols:
725 % - a super-slanted one used in "f" "mf" "sfz" "sf", and
726 % - a more normal-slanted in "ff" "fff" "fp" "fp" (see Wanske p.241)
728 % looking at professionally typeset music reveals that typesetters
729 % are somewhat unsure about slanting in "mf", "fp", "sfz"
731 % "f" and "p" (in any combination) are a lot (factor two) fatter than
732 % "s", "m", and "z". sometimes the "m" and "z" are a bit fatter than
736 % Chester, Breitkopf suggest smaller sizes of these other chars,
737 % using the x-height as reference point.