+%
+% Notes about 8th rest:
+%
+% * 8th rest should be no wider than the black note head
+%
+% * The inside corner of the horizontal portion is usually a little blotted.
+%
+% * The top of the crook chops off the vertical brush
+%
+% * The crook widens a little
+%
+% * The bottom of the brush is slightly flat, as it has to align with
+% stafflines if it is inside the staff.
+%
+% * The top of the brush usually is a little lower than the top of bulb.
+%
+% * The bulb can vary. Sometimes it is open (like in the clefs). Sometimes
+% it is closed, or even a flare.
+%
+
+% from an email to Rune Zedeler:
+%
+%
+% For example, the 8th rest was vaguely based on a book with trumpet
+% studies by Duhem, and by Baerenreiters cello suites. I included my
+% findings in a comment in the mf file. One of the things that I tried
+% to do was make the rest a little lighter and narrower than the black
+% note head. I think this looks better in polyphonic music, when the
+% rest is below a head from a different voice.
+%
+%
+
+
+def draw_rest_bulb(expr ycenter, ycut, pat, stretch) =
+begingroup;
+ save x,y,pt;
+ z1l = point 0 of pat;
+ z2l = point 1 of pat;
+ z2r = point 3 of pat;
+ z1r = point 4 of pat;
+ z1 = 0.5[z1l,z1r];
+ z2 = 0.5[z2l,z2r];
+ y10 = ycenter;
+ z10 = whatever[z2, z1] + left*bulb_diam*stretch;
+
+
+ z3 = z10+bulb_diam/2.15*dir(-72) ;
+
+
+ x4 = x10+bulb_diam*.62 ;
+ y4 := ceiling (y10 - 2 stafflinethickness + crook_thin);
+
+ z5 = z10 + up*bulb_diam/2 + right*stafflinethickness/3;
+
+
+ z7 = 0.5 [z4, z5] + (0.45 stafflinethickness,0.4 stafflinethickness);
+ x8 = x10-0.4bulb_diam;
+ y8 = y10 + 0.25 stafflinethickness;
+
+ z6 = whatever [z1l, z2l];
+ z6 = z3+whatever * dir(12);
+
+ (pt,whatever) = pat intersectiontimes ((0,ycut)--(w,ycut));
+
+ fill point pt of pat {-direction pt of pat} .. tension 2
+ .. z4{left} .. tension 0.9 .. z7
+ .. z5{left} .. z8 .. z3{right}
+ .. {curl 0.2} z6 {right} .. tension 10 .. {left} point pt of pat -- cycle;
+
+ labels(3, 4, 5, 6, 7, 8, 9, 10);
+
+endgroup;
+enddef;
+
+def draw_eighth_rest =
+ save width, bulb_diam, thin, thick;
+ save ycenter, crook_thick, crook_thin;
+ save crook_dir, lower_brush, pat;
+ pair crook_dir;
+ path pat;
+
+ width# := 1.0 staff_space#;
+ bulb_diam# := 0.64 staff_space#;
+ thin# := 1.2 stafflinethickness#;
+ thick# := 2.2 stafflinethickness#;
+ crook_thick# := 1.8 stafflinethickness#;
+ crook_thin := 1.3 stafflinethickness;
+
+ lower_brush := 1.5 stafflinethickness;
+
+ define_pixels (width, bulb_diam, thin, thick, crook_thick);
+ set_char_box (0, width#,
+ 1.0 staff_space# + 0.5 stafflinethickness#, 0.5 staff_space# + bulb_diam#/2);
+
+ penpos1 (thick, 0);
+ penpos2 (thin, 10);
+
+ y1 = - staff_space ;
+ y2 = h - lower_brush;
+ x2r = width;
+ z2 = z1 + whatever*dir(72);
+ z9 = z2 + 0.5 stafflinethickness * dir (angle(z2 - z1)- 10);
+ pat = z1l --- z2l .. z9 .. z2r --- simple_serif (z1r, z1l, -40) .. cycle;
+ fill pat;
+
+
+ draw_rest_bulb(0.5 staff_space , y2r , pat , 1.0);
+ penlabels (1, 2);
+ labels(9);
+
+ % draw_staff (-2,2,0.0);
+
+ enddef;
+
+fet_beginchar("Classical quarter rest","2classical","clasquartrest");
+ draw_eighth_rest;
+ currentpicture := currentpicture xscaled -1 shifted (w,0);
+ fet_endchar;
+