2 fet_begingroup ("brackettips");
4 def draw_bracket(expr thick_sharp, width_sharp, updown) =
6 save p, thin, thick, flattening, width;
11 thick# := thick_sharp;
12 width# := width_sharp;
14 define_pixels (thick, width);
16 set_char_box (0, width#,
17 .5 thick# , flattening * width#);
19 set_char_box (0, width#,
20 flattening * width#, .5 thick#);
23 thin = 2 linethickness;
25 pickup pencircle scaled thin;
38 z5 = .5 [z1, z3] + (width - thin, flattening * width - .5 thin);
39 p := .5 [z1, z3]{right} .. z5;
40 tipdir := (direction 1 of p);
42 penpos5 (thin, angle (tipdir));
43 penpos6 (thin, 90 + angle (tipdir));
50 pickup pencircle scaled 1;
53 fill (z1{up} .. z3l{up}
54 .. z4r{right} .. z6r{tipdir}
55 .. z5r .. z6l{-tipdir}
56 .. z7{left} .. z1{left} & cycle)
61 penlabels (1,2,3,4,5,6,7);
67 fet_beginchar ("bracket tip up", "up");
68 draw_bracket (0.45 staff_space#, 2.0 staff_space#, 1);
71 fet_beginchar ("bracket tip down", "down");
72 draw_bracket (0.45 staff_space#, 2.0 staff_space#, -1);
75 fet_endgroup ("brackettips");