]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-haak.mf
* lily/system-start-delimiter.cc (staff_bracket): use glyphs.
[lilypond.git] / mf / feta-haak.mf
1
2 fet_begingroup ("brackettips");
3
4 def draw_bracket(expr thick_sharp, width_sharp, updown) =
5 begingroup;
6         save p, thin, thick, flattening, width;
7         path p;
8         pair tipdir;
9
10         flattening = 0.70;
11         thick# := thick_sharp;
12         width# := width_sharp;
13
14         define_pixels (thick, width);
15         if updown = 1:
16                 set_char_box (0, width#,
17                               .5 thick# , flattening * width#);
18         else:
19                 set_char_box (0, width#,
20                                 flattening * width#, .5 thick#);
21         fi;
22
23         thin = 2 linethickness;
24         
25         pickup pencircle scaled thin;
26
27
28         penpos3(thin, 0);
29         penpos4(thin, 90);
30
31         z3 = z4;
32
33         top y3 = 0.5 thick;
34         lft x3 = 0.0;
35         x1 = x3l;
36         y1 = -0.5 thick;
37         
38         z5 = .5 [z1, z3] + (width - thin, flattening * width - .5 thin);
39         p := .5 [z1, z3]{right} .. z5;
40         tipdir := (direction 1 of p);
41
42         penpos5 (thin, angle (tipdir));
43         penpos6 (thin, 90 + angle (tipdir));
44
45         z5 = z6;
46
47         z7 = z1 + (thick,0); 
48
49
50         pickup pencircle scaled 1;
51
52         % draw p;
53         fill (z1{up} .. z3l{up}
54                 .. z4r{right} .. z6r{tipdir}
55                 .. z5r .. z6l{-tipdir}
56                 .. z7{left} .. z1{left} & cycle)
57                  yscaled updown;
58
59
60         if updown = 1:
61                 penlabels (1,2,3,4,5,6,7);
62         fi;
63
64 endgroup;
65 enddef;
66
67 fet_beginchar ("bracket tip up", "up");
68    draw_bracket (0.45 staff_space#, 2.0 staff_space#, 1);
69 fet_endchar;
70
71 fet_beginchar ("bracket tip down", "down"); 
72    draw_bracket (0.45 staff_space#, 2.0 staff_space#, -1);
73 fet_endchar;
74
75 fet_endgroup ("brackettips");