2 fet_begingroup ("brackettips");
4 def draw_bracket(expr thick_sharp, width_sharp, updown) =
6 save p, thin, thick, flattening, width, hair, flare;
12 flare# = flattening * width#;
15 define_pixels (thick, width, flare);
17 set_char_box (0, width#,
20 set_char_box (0, width#,
24 thin = 2 linethickness;
25 hair = 1.25 linethickness;
27 pickup pencircle scaled thin;
28 z7 = z1 + (3/4 thick,0);
50 p := z8{dir(leave_angle)}
52 tipdir := (direction 1 of p);
56 penpos5 (hair, tip_angle);
57 penpos6 (hair, 90 + tip_angle);
61 pickup pencircle scaled 1;
70 .. z5r .. z6l{-tipdir}
71 .. z7{dir(180 + leave_angle)} & z7 .. z1{left} & cycle)
76 penlabels (1,2,3,4,5,6,7);
82 fet_beginchar ("bracket tip up", "up");
83 draw_bracket (0.45 staff_space#, 1.9 staff_space#, 1);
86 fet_beginchar ("bracket tip down", "down");
87 draw_bracket (0.45 staff_space#, 1.9 staff_space#, -1);
90 fet_endgroup ("brackettips");