- save thinness, height, width, overshoot, se, sw, ne, nw, alpha;
- pair ne, nw, se, sw;
- height# = staff_space#;
- width# = 0.8height#;
- overshoot# = 0.25 staff_space#;
- define_pixels (height,overshoot,width);
- set_char_box(0, width#, 0, height#);
- alpha := -40;
- nw = dir (alpha+180);
- sw = dir (alpha-90); se = dir alpha;
-
- penpos1(rthin, alpha+90);
- penpos2(5/4 rthick, alpha);
- penpos3(5/4 rthick, 0);
-
- z1 = (width/2, height) - overshoot*se; % numbering is consistent with the arpeggio symbol
- z2 = 2[z4,(width/2,height/2)];
- z3 = (0.5 width, 0.5 height);
- z4 = (0.25 staff_space, rthin);
- z6 = z2l + 1/2rthin*sw;
- z9 = (width/2, height) + overshoot*se;
- fill z1l {se}..{se} z6 .. z3l .. z3r.. z9{nw} ..{nw} z1r.. cycle;
-
- bot z10 = ( 0.5w, 0 );
- lft z11 = (-0.3w, 0.8h);
- rt z12 = ( 1.3w, 0.8h);
- pickup pencircle scaled 0.5 rthin;
- filldraw z3 -- z12 {dir -130} .. {dir -110} z10 {dir 110} .. {dir 130} z11 -- cycle;
+ save thinness, height, width, overshoot;
+ save nw, ne, se, sw;
+ save alpha;
+ save before_left, before_right, after_left, after_right;
+ save u_left, v_left, u_right, v_right;
+ pair nw, ne, se, sw;
+ path before_left, before_right, after_left, after_right;
+
+ height# = staff_space#;
+ width# = 0.8 height#;
+ overshoot# = 0.25 staff_space#;
+ define_pixels (height, overshoot, width);
+
+ set_char_box (0, width#, 0, height#);
+
+ 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 (5/4 rthick, 0);
+
+ z1 = (width / 2, height) - overshoot * se; % numbering is consistent
+ % with the arpeggio symbol
+ z2 = 2 [z4, (width / 2, height / 2)];
+ z3 = (0.5 width, 0.5 height);
+ z4 = (0.25 staff_space, rthin);
+ z6 = z2l + 1/2 rthin * sw;
+ z9 = (width / 2, height) + overshoot * se;
+
+ pickup pencircle scaled vround (0.5 rthin);
+
+ bot z10 = (0.5 w, 0);
+ lft z11 = (0.5 w - hround (0.8 w), 0.8 h);
+ rt z12 = (0.5 w + hround (0.8 w), 0.8 h);
+
+ before_left := z1l
+ -- z6{z6 - z1l}
+ .. {down}z3l;
+ after_left := (z3 + (0, -0.25 rthin / cosd (angle (nw))))
+ -- (z11 + 0.25 rthin * ne);
+ (u_left, v_left) = before_left intersectiontimes after_left;
+
+ before_right := (z12 + 0.25 rthin * nw)
+ -- (z3 + (0, -0.25 rthin / cosd (angle (nw))));
+ after_right := z3r{up}
+ .. z9{z1r - z9}
+ -- z1r;
+ (u_right, v_right) = before_right intersectiontimes after_right;
+
+ fill subpath (0, u_left) of before_left
+ .. subpath (v_left, infinity) of after_left
+ .. top z11
+ .. lft z11
+ .. {dir -50}(z11 + 0.25 rthin * sw)
+ .. (z10 + 0.25 rthin * sw){dir -70}
+ .. bot z10
+ .. {dir 70}(z10 + 0.25 rthin * se)
+ .. (z12 + 0.25 rthin * se){dir 50}
+ .. rt z12
+ .. top z12
+ .. subpath (0, u_right) of before_right
+ .. subpath (v_right, infinity) of after_right
+ .. cycle;
+
+ % mf doesn't handle pixel dropouts in outline objects, so we use
+ % `draw' if not called by mpost
+ if not known miterlimit:
+ pickup pencircle scaled 0.7 rthin;
+ draw z1
+ -- (z9 + 0.5 rthin * dir (alpha - 90));
+ fi;