+
+fet_beginchar ("Flageolet", "flageolet");
+ save height, width, thickness, superness;
+
+ height# = 4/15 staffsize#;
+ width# = height#;
+ thickness# = blot_diameter#;
+ define_pixels (height, width);
+ define_whole_blacker_pixels (thickness);
+
+ set_char_box (width# / 2, width# / 2, height# / 2, height# / 2);
+
+ penpos1 (thickness, 90);
+ penpos2 (thickness, 180);
+ penpos3 (thickness, 270);
+ penpos4 (thickness, 0);
+
+ x1 = 0;
+ y1r = h;
+ x4r = w;
+ x2r = -x4r;
+ y2 = 0;
+ y4 = y2;
+ x3 = x1;
+ y3r = -y1r;
+
+ penlabels (1, 2, 3, 4);
+
+ % mf doesn't handle pixel dropouts in outline objects, so we use
+ % `draw' if not called by mpost
+ if known miterlimit:
+ penstroke z1e
+ .. z2e
+ .. z3e
+ .. z4e
+ .. cycle;
+ else:
+ pickup pencircle scaled thickness;
+ draw z1
+ .. z2
+ .. z3
+ .. z4
+ .. cycle;
+ fi;
+fet_endchar;
+
+
+%
+% TODO: ARGRGHGH code dup.
+%
+
+fet_beginchar ("Segno", "segno");
+ save thin, thick, ball_diam, darkness, pointheight;
+ save wd, ht, thick_nibangle, ball_nib_thick;
+ save turndir;
+ pair turndir;
+
+ ht# = 3 staff_space#;
+ wd# = 2 staff_space#;
+ darkness = .08 staff_space + 0.4 linethickness;
+
+ set_char_box (wd# / 2, wd# / 2, ht# / 2, ht# / 2);
+
+ thick_nibangle = 30;
+ thick = 3 darkness;
+ thin = darkness;
+ ball_nib_thick = 2.7 darkness;
+ ball_diam = ball_nib_thick + (w - ball_nib_thick) / 10;
+ pointheight = 2 linethickness;
+
+ y3l = h;
+ 2 x3 = x2 + x4;
+ x4 = 0;
+ y4 = y2;
+ y2l = .6 h;
+ x2l = -b;
+ z1 = (0, 0);
+
+ penpos1 (thick, 2 thick_nibangle);
+ penpos2 (thick, thick_nibangle);
+ penpos3 (thin, -90);
+ penpos4 (ball_nib_thick, 180 - thick_nibangle);
+
+ save swoosh, ploop;
+ path swoosh, ploop;
+
+ swoosh := z1l{curl 0}
+ .. z2l
+ .. z3l{right}
+ .. {down}z4l
+ -- z4r
+ .. z3r{left}
+ .. z2r{down};
+ fill swoosh
+ .. (swoosh scaled -1)
+ .. cycle;
+
+ y5r = y4;
+ x5r = x4l - ball_diam / 2;
+ z6r = z5r;
+
+ penpos5 (1.6 ball_diam / 2, 100);
+ penpos6 (ball_diam / 2, 240);
+
+ ploop := z4l{down}
+ .. z5l
+ .. z6l
+ -- cycle;
+ fill ploop;
+ fill ploop scaled -1;
+
+ penpos7 (2 thin, 0);
+ z7l = (-b, -d);
+ penpos8 (2 thin, 0);
+ z8r = (w, h);
+
+ penstroke z7e
+ -- z8e;
+
+ pickup pencircle scaled 2 thin;
+ drawdot (-x2r, pointheight);
+ drawdot (x2r, -pointheight);
+
+ penlabels (range 1 thru 8);
+fet_endchar;
+
+
+fet_beginchar ("Coda", "coda");
+ save stickout, thin, thick, codawidth, codaheight;
+
+ stickout# = 0.35 staff_space#;
+ codawidth# = 2/3 staff_space#;
+ codaheight# = staff_space#;
+ define_pixels (codawidth, codaheight);
+
+ set_char_box (codawidth# + stickout#, codawidth# + stickout#,
+ codaheight# + stickout#, codaheight# + stickout#);
+
+ thin = 1.2 linethickness;
+ 0.1 (codaheight - 2 thin) = (codawidth - 2 thick);
+
+ penpos1 (thick, 0);
+ penpos2 (thin, -90);
+ penpos3 (thick, -180);
+ penpos4 (thin, -270);
+
+ x1l = -codawidth;
+ y2l = codaheight;
+ y1 = 0;
+ x2 = 0;
+ z3 = -z1;
+ z4 = -z2;
+
+ penlabels (1, 2, 3, 4);
+
+ fill z1l{up}
+ .. z2l{right}
+ .. z3l{down}
+ .. z4l{left}
+ .. cycle;
+ unfill z1r{up}
+ .. z2r{right}
+ .. z3r{down}
+ .. z4r{left}
+ .. cycle;
+
+ draw_gridline ((0, -h), (0, h), thin);
+ draw_gridline ((-w, 0), (w, 0), thin);
+fet_endchar;
+
+
+fet_beginchar ("Varied Coda", "varcoda");
+ save thin, thick, codawidth, codaheight;
+ thin# = 1.2 linethickness#;
+ thick# = 1.0 linethickness# + 0.25 staff_space#;
+ codawidth# = 2/3 staff_space#;
+ codaheight# = staff_space#;
+ define_pixels (thin, thick, codawidth, codaheight);
+
+ set_char_box (codawidth# + thick#, codawidth# + thick#,
+ codaheight# + thick#, codaheight# + thick#);
+
+ x1 = -codawidth + thick - .5 blot_diameter;
+ y1 = y2 - thin;
+ x2 = codawidth - thick + .5 blot_diameter;
+ y2 = codaheight;
+ draw_square_block (z1, z2);
+
+ x3 = -codawidth;
+ y3 = -codaheight;
+ x4 = x3 + thick;
+ y4 = y2;
+ draw_block (z3, z4);
+
+ labels (1, 2, 3, 4);
+
+ addto currentpicture also currentpicture scaled -1;
+
+ draw_gridline ((0, -h), (0, h), thin);
+ draw_gridline ((-w, 0), (w, 0), thin);
+fet_endchar;
+
+
+def draw_comma =
+ save alpha, thick, thin, ht;
+
+ alpha := 35;
+ thin# = 1.2 linethickness#;
+ thick# = 3 linethickness#;
+ ht# = .6 staff_space#;
+ define_pixels (thin, thick, ht);
+
+ set_char_box (0, .5 staff_space#, ht#, ht#);
+
+ penpos1 (thick, alpha);
+ penpos2 (thick, alpha + 90);
+ penpos3 (thin, 180 - alpha);
+ penpos4 (thin, 90 - alpha);
+
+ x3r = 0;
+ x1l = x3l;
+ y2r = -y4l = h;
+ z1 = z2;
+ z3 = z4;
+
+ fill z1l{dir (alpha + 90)}
+ .. z2r{dir alpha}
+ .. z1r{dir (alpha - 90)}
+ .. z3l{dir (270 - alpha)}
+ .. z4l{dir (180 - alpha)}
+ .. z3r{dir (90-alpha)}
+ .. cycle;
+enddef;
+
+
+fet_beginchar ("Right Comma", "rcomma");
+ draw_comma;
+ penlabels (1, 2, 3, 4);
+fet_endchar;
+
+
+fet_beginchar ("Left Comma", "lcomma");
+ draw_comma;
+ xy_mirror_char;
+fet_endchar;
+
+
+def draw_varcomma =
+ save thick, thin, ht, wd, alpha;
+
+ alpha := 35;
+ thin# = 1.2 linethickness#;
+ thick# = 3 linethickness#;
+ ht# = .6 staff_space#;
+ wd# = .25 staff_space#;
+ define_pixels (thin, thick, ht, alpha);
+
+ set_char_box (wd#, wd#, ht#, ht#);
+
+ z1 = (-b, -d);
+ z2 = (w, h);
+
+ draw_brush (z1, thin, z2, thick);
+enddef;
+
+
+fet_beginchar ("Right Varied Comma", "rvarcomma");
+ draw_varcomma;
+ labels (1, 2);
+fet_endchar;
+
+
+fet_beginchar ("Left Varied Comma", "lvarcomma");
+ draw_varcomma;
+ xy_mirror_char;
+fet_endchar;
+
+
+thick# := 1/24 designsize;
+define_blacker_pixels (thick);
+
+rthin := 0.075 * staff_space + 0.5 linethickness;
+rthick := 2 thick + rthin;
+
+
+def draw_arpeggio =
+ save alpha;
+ save ne, nw, se, sw;
+ save x, y;
+ pair ne, nw, se, sw;
+
+ alpha := -40;
+
+ nw = dir (alpha + 180);
+ ne = dir (alpha + 90);
+ se = dir alpha;
+ sw = dir (alpha - 90);
+
+ penpos1 (rthin, alpha + 90);
+ penpos2 (5/4 rthick, alpha);
+ penpos3 (3/4 rthick, alpha);
+ penpos4 (5/4 rthick, alpha);
+ penpos5 (rthin, alpha + 90);
+
+ z1 = (width / 2, height) - overshoot * se;
+ z2 = 2 [z4, (width / 2, height / 2)];
+ z3 = 1/2 [z2, z4];
+ x4 = 2/8 staff_space;
+ y4 = rthin;
+
+ z5 = 2 [z1, (width / 2, height / 2)];
+ z6 = z2l + 1/2 rthin * sw;
+ z7 = z4l + 1/2 rthin * sw + 1/2 rthin * se;
+ z8 = 2 [z6, (width / 2, height / 2)];
+ z9 = 2 [z7, (width / 2, height / 2)];
+
+ fill z1l{se}
+ -- z6
+ .. z3l
+ .. z7{se}
+ -- z5l
+ .. z5r{nw}
+ -- z8
+ .. z3r
+ .. z9{nw}
+ -- z1r
+ .. cycle;
+enddef;
+
+
+fet_beginchar ("Arpeggio", "arpeggio");
+ save height, overshoot, width;
+ height# = staff_space#;
+ width# = 0.8 height#;
+ overshoot# = 0.25 staff_space#;
+ define_pixels (height, overshoot, width);
+
+ set_char_box (0, width#, 0, height#);
+ draw_arpeggio;
+ penlabels (range 1 thru 9);
+
+ draw_staff (-2, 2, 0.0);