2 % feta-toevallig.mf -- implement Accidentals
4 % (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 % also show in other configuration wrt staff lines.
11 def draw_shifted_too =
13 fet_beginchar ("shifted too", "");
14 set_char_box (0, 0, 0, 0);
15 currentpicture := remember_pic;
17 draw_staff (-2, 2, 0.5);
24 % Accidentals from various sources, notably
26 % Baerenreiter edition of Schuberts `Auf dem Strom' (sharp, natural)
27 % F Hofmeister edition of Muellers `Etueden fuer Horn' (double sharp, flat)
32 % Naming for accidentals (including microtonal variants):
34 % SHARPBASE[.SLASHES.STEMS]
39 % sharp.slashslash.stem
45 fet_begingroup ("accidentals");
50 % * "stemslant" gives the direction of the stem's left boundary
51 % (needed for brushed stems, equals "up" for straight stems)
52 % * "extend" is used to make the stem longer or shorter (if negative);
53 % different kinds of accidentals need different values here
55 def draw_arrow (expr attach, stemwidth, stemslant, extend, pointingdown) =
57 save htip; % tip height
58 save wwing; % wing "radius"
59 save angle_wing_bot, angle_wing_top, angle_tip;
63 wwing:=0.26 stemwidth;
64 htip:=staff_space*0.85 + stafflinethickness - wwing;
66 % "flip" is used to reflect the arrow vertically if arrow points downward
69 flip=identity reflectedabout (origin, right);
74 z1=attach shifted ((-stemwidth/2),0);
75 upshift:=max(0, wwing + 0.1 staff_space + extend);
76 z2=z1 shifted (((unitvector stemslant) scaled upshift) transformed flip);
78 z7=attach shifted ((stemwidth/2),0);
79 z6=z7 shifted (((unitvector (-xpart stemslant, ypart stemslant))
80 scaled upshift) transformed flip);
81 (z2-z3)= (0.38 staff_space, 0.05 htip) transformed flip;
82 (z6-z5)=(-0.38 staff_space, 0.05 htip) transformed flip;
84 z4 =attach shifted ((-0.2 stemwidth, upshift+htip) transformed flip);
85 z4'=attach shifted (( 0.2 stemwidth, upshift+htip) transformed flip);
87 % angle_wing_bot is the angle at which the arc from z2 to z3a enters z3a
88 % angle_wing_top is the angle at which the arc from z3b to z4 leaves z3b
89 % angle_tip is the angle at which the arc from z4 to z4' leaves z4
94 z3a=z3 shifted ((((dir angle_wing_bot) rotated (-90))
95 scaled wwing) transformed flip);
96 z3b=z3 shifted ((((dir angle_wing_top) rotated 90)
97 scaled wwing) transformed flip);
99 z5a=z5 shifted ((((dir (180-angle_wing_bot)) rotated 90)
100 scaled wwing) transformed flip);
101 z5b=z5 shifted ((((dir (180-angle_wing_top)) rotated (-90))
102 scaled wwing) transformed flip);
105 pickup pencircle scaled 1;
107 -- z2{stemslant transformed flip}
108 .. {(-dir angle_wing_bot) transformed flip}z3a
109 .. z3b{(dir angle_wing_top) transformed flip}
110 .. z4{(dir angle_tip) transformed flip}
111 .. z4'{(dir (-angle_tip)) transformed flip}
112 ..{(dir (-angle_wing_top)) transformed flip}z5b
113 ..z5a{(-dir (-angle_wing_bot)) transformed flip}
114 ..z6{((-stemslant) reflectedabout (origin, up)) transformed flip}
118 labels(range 0 thru 7,4',3a,3b,5a,5b);
123 picture remember_pic;
125 save sharp_beamheight;
126 sharp_beamheight# := 0.3 staff_space# + stafflinethickness#;
129 % The beams of most sharps have horizontal endings (as if drawn with
130 % a square pen). [Wanske] does not mention this, so we'll just ignore
134 def draw_meta_sharp (expr width, offset) =
135 save beamwidth, beamslope;
141 define_whole_vertical_blacker_pixels (sharp_beamheight);
145 beamslope = sharp_beamheight / beamwidth;
147 pickup pencircle scaled 2 blot_diameter;
149 rt x2 - lft x1 = beamwidth;
150 z2 = z1 + whatever * (beamwidth, sharp_beamheight);
151 .5 [z1, z3] = (.5 w, offset);
153 top y2 - bot y3 = sharp_beamheight;
155 top y1 - bot y4 = sharp_beamheight;
157 ne = unitvector (z2 - z1);
158 nw_dist = (ne rotated 90) * blot_diameter;
161 ... (z1 + nw_dist){ne}
162 -- (z2 + nw_dist){ne}
165 ... (z3 - nw_dist){-ne}
166 -- (z4 - nw_dist){-ne}
174 fet_beginchar ("Sharp", "sharp");
175 save stem, stemx, stemwidth;
176 save outer_space, interbeam;
178 stemwidth# := stafflinethickness# + .05 staff_space#;
179 define_whole_blacker_pixels (stemwidth);
181 interbeam := 1.05 staff_space_rounded;
183 set_char_box (0, 1.1 staff_space#,
184 1.5 staff_space#, 1.5 staff_space#);
187 stemx := hround stem;
188 outer_space := hround ((w - stemx - stemwidth) / 2);
190 w := 2 outer_space + stemx + stemwidth;
191 d := d - feta_space_shift;
193 draw_meta_sharp (w, -.5 interbeam);
194 draw_meta_sharp (w, -.5 interbeam + vround interbeam);
196 pickup pencircle scaled stemwidth;
198 lft x5 = lft x6 = outer_space;
199 lft x7 = lft x8 = outer_space + stemx;
201 top y6 = vround (1.5 staff_space - stem * beamslope);
202 bot y7 = -top y6 + feta_space_shift;
207 draw_gridline (z5, z6, stemwidth);
208 draw_gridline (z7, z8, stemwidth);
210 remember_pic := currentpicture;
212 draw_staff (-2, 2, 0);
219 fet_beginchar ("1/2 Sharp", "sharp.slashslash.stem");
220 save stem, stemwidth;
221 save outer_space, interbeam;
223 stemwidth# := stafflinethickness# + .05 staff_space#;
224 define_whole_blacker_pixels (stemwidth);
226 interbeam := 1.05 staff_space_rounded;
228 set_char_box (0, 0.7 staff_space#,
229 1.5 staff_space#, 1.5 staff_space#);
232 outer_space := hround ((w - stemwidth) / 2);
234 w := 2 outer_space + stemwidth;
235 d := d - feta_space_shift;
237 draw_meta_sharp (w, -.5 interbeam);
238 draw_meta_sharp (w, -.5 interbeam + vround interbeam);
240 pickup pencircle scaled stemwidth;
242 lft x5 = lft x6 = outer_space;
243 top y6 = vround (1.5 staff_space - .5 stem);
244 bot y5 = -top y6 + feta_space_shift;
248 draw_gridline (z5, z6, stemwidth);
250 remember_pic := currentpicture;
252 draw_staff (-2, 2, 0);
259 fet_beginchar ("Sharp (3 beams)", "sharp.slashslashslash.stemstem");
260 save stem, stemx, stemwidth;
261 save outer_space, interbeam;
262 save sharp_beamheight;
264 sharp_beamheight# := 0.22 staff_space# + stafflinethickness#;
266 stemwidth# := stafflinethickness# + .05 staff_space#;
267 define_whole_blacker_pixels (stemwidth);
269 interbeam := 1.2 staff_space_rounded;
271 set_char_box (0, 1.1 staff_space#,
272 1.5 staff_space#, 1.5 staff_space#);
275 stemx := hround stem;
276 outer_space := hround ((w - stemx - stemwidth) / 2);
278 w := 2 outer_space + stemx + stemwidth;
279 d := d - feta_space_shift;
281 draw_meta_sharp (.88 w, -.5 interbeam);
282 draw_meta_sharp (.88 w, -.5 interbeam + vround interbeam);
283 sharp_beamheight# := 1/.88 sharp_beamheight#;
284 draw_meta_sharp (w, 0);
286 pickup pencircle scaled stemwidth;
288 lft x5 = lft x6 = outer_space;
289 lft x7 = lft x8 = outer_space + stemx;
291 top y6 = vround (1.5 staff_space - stem * beamslope);
292 bot y7 = -top y6 + feta_space_shift;
297 draw_gridline (z5, z6, stemwidth);
298 draw_gridline (z7, z8, stemwidth);
300 remember_pic := currentpicture;
302 draw_staff (-2, 2, 0);
309 fet_beginchar ("1/2 Sharp (3 beams)", "sharp.slashslashslash.stem");
310 save stem, stemx, stemwidth;
311 save outer_space, interbeam;
312 save sharp_beamheight;
314 sharp_beamheight# := 0.22 staff_space# + stafflinethickness#;
316 stemwidth# := stafflinethickness# + .05 staff_space#;
317 define_whole_blacker_pixels (stemwidth);
319 interbeam := 1.2 staff_space_rounded;
321 set_char_box (0, 0.95 staff_space#,
322 1.3 staff_space#, 1.3 staff_space#);
325 outer_space := hround ((w - stemwidth) / 2);
327 w := 2 outer_space + stemwidth;
328 d := d - feta_space_shift;
330 draw_meta_sharp (.8 w, -.5 interbeam);
331 draw_meta_sharp (.8 w, -.5 interbeam + vround interbeam);
332 sharp_beamheight# := 1/.8 sharp_beamheight#;
333 draw_meta_sharp (w, 0);
335 pickup pencircle scaled stemwidth;
337 lft x5 = lft x6 = outer_space;
338 top y6 = vround (1.5 staff_space - .5 stem);
339 bot y5 = -top y6 + feta_space_shift;
342 draw_gridline (z5, z6, stemwidth);
344 remember_pic := currentpicture;
346 draw_staff (-2, 2, 0);
353 fet_beginchar ("3/4 Sharp", "sharp.slashslash.stemstemstem");
354 save stem, stemx, stemwidth;
355 save outer_space, interbeam;
357 stemwidth# := stafflinethickness# + .05 staff_space#;
358 define_whole_blacker_pixels (stemwidth);
360 interbeam := 1.05 staff_space_rounded;
362 set_char_box (0, 1.6 staff_space#,
363 1.5 staff_space#, 1.5 staff_space#);
366 stemx := hround stem;
367 outer_space := hround ((w - 2 stemx - stemwidth) / 2);
369 w := 2 outer_space + 2 stemx + stemwidth;
370 d := d - feta_space_shift;
372 draw_meta_sharp (w, -.5 interbeam);
373 draw_meta_sharp (w, -.5 interbeam + vround interbeam);
375 pickup pencircle scaled stemwidth;
377 lft x5 = lft x6 = outer_space;
378 lft x7 = lft x8 = outer_space + stemx;
379 lft x9 = lft x10 = outer_space + 2 stemx;
381 top y6 = vround (1.5 staff_space - 2 stem * beamslope);
382 bot y9 = -top y6 + feta_space_shift;
387 labels (5, 6, 7, 8, 9, 10);
389 draw_gridline (z5, z6, stemwidth);
390 draw_gridline (z7, z8, stemwidth);
391 draw_gridline (z9, z10, stemwidth);
393 remember_pic := currentpicture;
395 draw_staff (-2, 2, 0);
403 % The stems of the natural are brushed (at least, in Barenreiter SCS)
406 fet_beginchar ("Natural", "natural");
407 save stemwidth, top_stem_thick;
408 save ne, pat_top, pat_bottom;
410 path pat_top, pat_bottom;
412 top_stem_thick# = stafflinethickness# + .10 staff_space#;
413 stemwidth# = 0.09 staff_space# + .5 stafflinethickness#;
414 define_whole_blacker_pixels (top_stem_thick, stemwidth);
416 set_char_box (0, 2/3 staff_space#,
417 1.5 staff_space#, 1.5 staff_space#);
419 d := d - feta_space_shift;
421 pickup pencircle scaled stemwidth;
423 penpos1 (top_stem_thick, 0);
424 penpos3 (top_stem_thick, 0);
425 penpos2 (stemwidth, 0);
426 penpos4 (stemwidth, 0);
435 top y2 = vround (staff_space - 3/2 stafflinethickness);
436 y4 = -y2 + feta_space_shift;
438 pat_bottom := z4r{z4r - z1r}
441 fill simple_serif (z1l, z1r, -30)
445 pat_top := z2r{z2r - z3r}
448 fill simple_serif (z3l, z3r, 30)
452 ne = (x2 - x4, stafflinethickness);
454 z11' = z3l + whatever * (z2l - z3l);
455 y11' = vround (.5 (staff_space - stafflinethickness));
456 z11 = z11' + whatever * ne;
458 z12 = directionpoint -ne of pat_top;
459 z13 = z12 + whatever * ne;
461 z14 = z11 + whatever * ne;
464 z21' = z4r + whatever * (z1r - z4r);
465 y21' = -y11' + feta_space_shift;
466 z21 = z21' + whatever * ne;
468 z22 = directionpoint -ne of pat_bottom;
469 z23 = z22 + whatever * ne;
471 z24 = z21 + whatever * ne;
485 penlabels (1, 2, 3, 4);
486 labels (11, 11', 12, 13, 14, 21, 21', 22, 23, 24);
488 remember_pic := currentpicture;
490 draw_staff (-2, 2, 0);
498 % Dedicated to my mom. (3/10/97)
500 % Mamma, ik hou van je; kom je alsjeblieft terug?
504 % TODO: remove crook_fatness
505 % TODO: document, simplify!
508 def draw_meta_flat (expr xcenter, w, crook_fatness) =
510 save bottom_overshoot, bot_crook_dir;
511 save top_stem_thick, bottom_stem_thick, hair, smaller_hole;
512 save top_crook_thinness;
515 pair center, bot_crook_dir;
520 % the stem shouldn't reach the top staff line.
521 %% TODO: should take from height.
523 % TODO: parameterize this
525 if w >= 0.75 staff_space:
526 smaller_hole = 0.35 stafflinethickness;
530 clearing = 1.7 stafflinethickness;
531 crook_thinness = .7 stafflinethickness + .06 staff_space;
532 top_crook_thinness = 1 stafflinethickness + .065 staff_space;
533 bottom_overshoot = stafflinethickness;
535 bottom_stem_thick# = 0.06 staff_space# + 0.6 stafflinethickness#;
536 top_stem_thick# = 0.1 staff_space# + 1.2 stafflinethickness#;
537 define_whole_blacker_pixels (bottom_stem_thick, top_stem_thick);
539 if odd (top_stem_thick - bottom_stem_thick):
540 top_stem_thick := top_stem_thick - 1;
543 center = (xcenter, 0);
545 x1l = hround (xcenter - .5 top_stem_thick);
546 y1 = vround (2 staff_space - clearing);
547 x2l = hround (xcenter - .5 bottom_stem_thick);
548 y2 = -.5 staff_space - .5 stafflinethickness;
550 penpos1 (top_stem_thick, 0);
551 penpos2 (bottom_stem_thick, 0);
553 y3l = vfloor ((staff_space - stafflinethickness) / 2);
554 z3l = whatever [z2r, z1r];
555 z3r = .3 [z2r, z1r] + (smaller_hole, 0);
558 % we insert z3l to get better conversion with mf2pt1
559 fill simple_serif (z1r, z1l, 30)
565 z10 = whatever [z2r, z1r] + (smaller_hole, 0);
566 y10 = -1/10 staff_space;
569 x11 = xcenter + bottom_overshoot / 3;
570 y11 = -vround (.5 (staff_space + stafflinethickness)
573 penpos4 (whatever, 53);
575 y4l - y4r = top_crook_thinness;
576 y5r = .15 staff_space;
577 x5l = hround (w + xcenter);
578 y4 = staff_space / 2;
579 x4r = .45 [x5r, x3r];
582 penpos5 (crook_fatness, -175);
584 bot_crook_dir = unitvector ((x5l, 0) - z11);
585 z8 = z11 + whatever * bot_crook_dir;
586 y8 = -staff_space / 2;
589 + whatever * bot_crook_dir
590 + crook_thinness * (bot_crook_dir rotated 90);
593 unfill z3r{z3r - z10}
596 .. z7{-bot_crook_dir}
612 % unfortunately, 600dpi is not enough to show the brush of the stem.
615 fet_beginchar ("Flat", "flat");
616 set_char_box (1.2 stafflinethickness#, .8 staff_space#,
617 0.6 staff_space#, 1.9 staff_space#);
619 draw_meta_flat (0, w, 0.31 staff_space);
620 penlabels (range 0 thru 11);
622 remember_pic := currentpicture;
624 draw_staff (-2, 2, 0);
631 fet_beginchar ("Flat (slashed)", "flat.slash");
632 set_char_box (.4 staff_space#, .8 staff_space#,
633 0.6 staff_space#, 1.9 staff_space#);
635 draw_meta_flat (0, w, 0.31 staff_space);
639 save slope, slash_width;
644 z12 = z11 - (slash_width, slash_width * slope) / 2;
645 z13 = z11 + (slash_width, slash_width * slope) / 2;
646 penpos12 (1.5 stafflinethickness, angle (z13 - z12) - 90);
647 penpos13 (1.5 stafflinethickness, angle (z13 - z12) - 90);
649 z14 = z12 - .75 stafflinethickness * unitvector (z13 - z12);
650 z15 = z13 + .75 stafflinethickness * unitvector (z13 - z12);
664 remember_pic := currentpicture;
666 draw_staff (-2, 2, 0);
670 fet_beginchar ("Flat (slashed twice)", "flat.slashslash");
671 set_char_box (.4 staff_space#, .8 staff_space#,
672 0.6 staff_space#, 1.9 staff_space#);
674 draw_meta_flat (0, w, 0.31 staff_space);
678 save slope, slash_width;
683 z12 = z11 - (slash_width, slash_width * slope) / 2;
684 z13 = z11 + (slash_width, slash_width * slope) / 2;
685 penpos12 (1.5 stafflinethickness, angle (z13 - z12) - 90);
686 penpos13 (1.5 stafflinethickness, angle (z13 - z12) - 90);
688 z14 = z12 - .75 stafflinethickness * unitvector (z13 - z12);
689 z15 = z13 + .75 stafflinethickness * unitvector (z13 - z12);
704 z22 = z21 - (slash_width, slash_width * slope) / 2;
705 z23 = z21 + (slash_width, slash_width * slope) / 2;
706 penpos22 (1.5 stafflinethickness, angle (z23 - z22) - 90);
707 penpos23 (1.5 stafflinethickness, angle (z23 - z22) - 90);
709 z24 = z22 - .75 stafflinethickness * unitvector (z23 - z22);
710 z25 = z23 + .75 stafflinethickness * unitvector (z23 - z22);
724 remember_pic := currentpicture;
726 draw_staff (-2, 2, 0);
730 fet_beginchar ("Flatflat (mirrored)", "mirroredflat.flat");
731 set_char_box (0, 1.6 staff_space#,
732 0.6 staff_space#, 1.9 staff_space#);
734 % This is a modified version of `draw_meta_flat'.
736 save crook_thinness, crook_fatness;
737 save bottom_overshoot, bot_crook_dir;
738 save top_stem_thick, bottom_stem_thick, hair, smaller_hole;
739 save top_crook_thinness;
742 pair center, bot_crook_dir;
751 % the stem shouldn't reach the top staff line.
752 %% TODO: should take from height.
754 % TODO: parameterize this
756 if wid >= 0.75 staff_space:
757 smaller_hole = 0.35 stafflinethickness;
761 clearing = 1.7 stafflinethickness;
762 crook_thinness = .7 stafflinethickness + .06 staff_space;
763 crook_fatness = 0.31 staff_space;
764 top_crook_thinness = 1 stafflinethickness + .065 staff_space;
765 bottom_overshoot = stafflinethickness;
767 bottom_stem_thick# = 0.06 staff_space# + 0.6 stafflinethickness#;
768 top_stem_thick# = 0.1 staff_space# + 1.2 stafflinethickness#;
769 define_whole_blacker_pixels (bottom_stem_thick, top_stem_thick);
771 if odd (top_stem_thick - bottom_stem_thick):
772 top_stem_thick := top_stem_thick - 1;
777 x1l = hround (-.5 top_stem_thick);
778 y1 = vround (2 staff_space - clearing);
779 x2l = hround (-.5 bottom_stem_thick);
780 y2 = -.5 staff_space - .5 stafflinethickness;
782 penpos1 (top_stem_thick, 0);
783 penpos2 (bottom_stem_thick, 0);
785 y3l = vfloor ((staff_space - stafflinethickness) / 2);
786 z3l = whatever [z2r, z1r];
787 z3r = .3 [z2r, z1r] + (smaller_hole, 0);
790 z10 = whatever [z2r, z1r] + (smaller_hole, 0);
791 y10 = -1/10 staff_space;
794 x11 = bottom_overshoot / 3;
795 y11 = -vround (.5 (staff_space + stafflinethickness)
798 penpos4 (whatever, 53);
800 y4l - y4r = top_crook_thinness;
801 y5r = .15 staff_space;
803 y4 = staff_space / 2;
804 x4r = .45 [x5r, x3r];
807 penpos5 (crook_fatness, -175);
809 bot_crook_dir = unitvector ((x5l, 0) - z11);
810 z8 = z11 + whatever * bot_crook_dir;
811 y8 = -staff_space / 2;
814 + whatever * bot_crook_dir
815 + crook_thinness * (bot_crook_dir rotated 90);
818 pat := z3r{z3r - z10}
821 .. z7{-bot_crook_dir}
826 unfill pat xscaled -1;
834 -- simple_serif (z1r, z1l, 30)
835 -- reverse pat xscaled -1 shifted (-feta_eps, 0)
838 currentpicture := currentpicture shifted (w/2, 0);
840 remember_pic := currentpicture;
842 draw_staff (-2, 2, 0);
849 fet_beginchar ("Semi flat", "mirroredflat");
850 set_char_box (1.2 stafflinethickness#, .8 staff_space#,
851 0.6 staff_space#, 1.9 staff_space#);
853 draw_meta_flat (0, w, 0.31 staff_space);
854 currentpicture := currentpicture xscaled -1 shifted (w - b, 0);
858 fet_beginchar ("Semi flat", "mirroredflat.backslash");
859 set_char_box (.4 staff_space#, .8 staff_space#,
860 0.6 staff_space#, 1.9 staff_space#);
862 draw_meta_flat (0, w, 0.31 staff_space);
866 save slope, slash_width;
871 z12 = z11 - (slash_width, slash_width * slope) / 2;
872 z13 = z11 + (slash_width, slash_width * slope) / 2;
873 penpos12 (1.5 stafflinethickness, angle (z13 - z12) - 90);
874 penpos13 (1.5 stafflinethickness, angle (z13 - z12) - 90);
876 z14 = z12 - .75 stafflinethickness * unitvector (z13 - z12);
877 z15 = z13 + .75 stafflinethickness * unitvector (z13 - z12);
888 currentpicture := currentpicture xscaled -1 shifted (w - b, 0);
894 fet_beginchar ("Double Flat", "flatflat");
895 save left_wid, overlap, right_wid;
901 set_char_box (1.2 stafflinethickness#,
902 (left_wid + right_wid - overlap) * staff_space#,
903 .6 staff_space#, 1.9 staff_space#);
904 draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space);
905 draw_meta_flat (hround ((left_wid - overlap) * staff_space),
906 right_wid * staff_space, 1/3 staff_space);
910 fet_beginchar ("3/4 Flat", "flatflat.slash");
911 save left_wid, overlap, right_wid;
917 set_char_box (1.2 stafflinethickness#,
918 (left_wid + right_wid - overlap) * staff_space#,
919 .6 staff_space#, 1.9 staff_space#);
920 draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space);
921 draw_meta_flat (hround ((left_wid - overlap) * staff_space),
922 right_wid * staff_space, 1/3 staff_space);
924 %% maybe we should clip part of the stems?
925 %% or make the 1st flat smaller?
927 pickup pencircle scaled 2 stafflinethickness;
929 z12 = round (-.25 w - b, .55 staff_space) + feta_offset;
930 z13 = round (.75 w, 1.45 staff_space) + feta_offset;
931 penpos12 (2 stafflinethickness, angle (z13 - z12) - 90);
932 penpos13 (2 stafflinethickness, angle (z13 - z12) - 90);
934 z14 = z12 - stafflinethickness * unitvector (z13 - z12);
935 z15 = z13 + stafflinethickness * unitvector (z13 - z12);
949 remember_pic := currentpicture;
951 draw_staff (-2, 2, 0);
958 fet_beginchar ("Double Sharp", "doublesharp");
959 save klaverblad, klaversteel;
963 klaversteel = 1/15 staff_space;
964 klaverblad = .4 staff_space - .5 stafflinethickness;
966 set_char_box (0, staff_space#, .5 staff_space#, .5 staff_space#);
968 z1 = (klaversteel, 0);
969 z2 = (w / 2 - klaverblad / 10, h - klaverblad);
971 z4 = z2 reflectedabout ((0, 0), (1, 1));
972 z5 = z1 reflectedabout ((0, 0), (1, 1));
974 labels (1, 2, 3, 4, 5);
976 pickup pencircle scaled blot_diameter;
978 x2 := hfloor (rt x2) - blot_diameter / 2;
979 x3 := hfloor (rt x3) - blot_diameter / 2;
980 y3 := vfloor (top y3) - blot_diameter / 2;
981 y4 := vfloor (top y4) - blot_diameter / 2;
990 .. {dir 225}(top z5);
992 -- reverse pat xscaled -1 shifted (-feta_eps, 0);
994 % assure symmetry -- it's more important to center the glyph on the
995 % staff line than centering it between staff lines, so we use
996 % feta_shift, not feta_space_shift.
999 fill pat shifted (0, feta_shift)
1000 -- reverse pat yscaled -1 shifted (0, -feta_eps)
1004 currentpicture := currentpicture shifted (hround (w / 2), 0);
1006 remember_pic := currentpicture;
1008 draw_staff (-2, 2, 0);
1018 leftindent := .2 staff_space;
1020 set_char_box (0, .5 staff_space# + stafflinethickness#,
1021 staff_space#, staff_space#);
1023 d := d - feta_shift;
1025 z1 = (leftindent, h);
1026 z2 = (w - stafflinethickness, .5 (h - d));
1027 z3 = (leftindent, -d);
1029 penpos1 (stafflinethickness, 35);
1030 penpos2 (.1 staff_space + stafflinethickness, 0);
1031 penpos3 (stafflinethickness, -35);
1034 .. simple_serif (z3l, z3r, 90)
1036 .. simple_serif (z1r, z1l, 90)
1042 fet_beginchar ("Right Parenthesis", "rightparen");
1044 penlabels (1, 2, 3);
1046 remember_pic := currentpicture;
1048 draw_staff (-2, 2, 0);
1055 fet_beginchar ("Left Parenthesis", "leftparen");
1058 currentpicture := currentpicture xscaled -1;
1060 set_char_box (charwd, charbp, chardp, charht);
1063 fet_endgroup ("accidentals");