]> 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, hair;
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         hair = 1.25 linethickness;
25
26         pickup pencircle scaled thin;
27         z7 = z1 + (thick,0); 
28         z2 = z4r + (thin, 0);
29
30
31         penpos3(thin, 0);
32         penpos4(thin, 90);
33
34         z3 = z4;
35
36         top y3 = 0.5 thick;
37         lft x3 = 0.0;
38         x1 = x3l;
39         y1 = -0.5 thick;
40
41
42         z8 = .5  [z2, z7];
43         top y5 = h;
44         rt x5 = w;
45
46         save leave_angle;
47         leave_angle = 10;
48
49         p := z8{dir(leave_angle)}
50                 .. z5{curl 0};
51         tipdir := (direction 1 of p);
52
53         save tip_angle;
54         tip_angle := 50;
55         penpos5 (hair, tip_angle);
56         penpos6 (hair, 90 + tip_angle);
57
58         z5 = z6;
59
60         pickup pencircle scaled 1;
61
62         %draw p;
63         fill
64         %draw
65         (z1{up} .. z3l{up}
66                 .. z4r{right}
67                 .. z2{right}
68                 .. z6r{tipdir}
69                 .. z5r .. z6l{-tipdir}
70                 .. z7{dir(180 + leave_angle)} & z7 .. z1{left} & cycle)
71                  yscaled updown;
72
73
74         if updown = 1:
75                 penlabels (1,2,3,4,5,6,7);
76         fi;
77
78 endgroup;
79 enddef;
80
81 fet_beginchar ("bracket tip up", "up");
82    draw_bracket (0.45 staff_space#, 2.0 staff_space#, 1);
83 fet_endchar;
84
85 fet_beginchar ("bracket tip down", "down"); 
86    draw_bracket (0.45 staff_space#, 2.0 staff_space#, -1);
87 fet_endchar;
88
89 fet_endgroup ("brackettips");