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