]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-haak.mf
* mf/feta-haak.mf: further tweaks.
[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, flare;
7         path p;
8         pair tipdir;
9
10         flattening = 0.72;
11         thick# = thick_sharp;
12         flare# = flattening * width#;
13         width# = width_sharp;
14
15         define_pixels (thick, width, flare);
16         if updown = 1:
17                 set_char_box (0, width#,
18                               .5 thick# , flare#);
19         else:
20                 set_char_box (0, width#,
21                                 flare#, .5 thick#);
22         fi;
23
24         thin = 2 linethickness;
25         hair = 1.25 linethickness;
26
27         pickup pencircle scaled thin;
28         z7 = z1 + (3/4 thick,0); 
29         z2 = z4r + (thin, 0);
30
31
32         penpos3(thin, 0);
33         penpos4(thin, 90);
34
35         z3 = z4;
36
37         top y3 = 0.5 thick;
38         lft x3 = 0.0;
39         x1 = x3l;
40         y1 = -0.5 thick;
41
42
43         z8 = .5  [z2, z7];
44         top y5 = flare;
45         rt x5 = width;
46
47         save leave_angle;
48         leave_angle = 10;
49
50         p := z8{dir(leave_angle)}
51                 .. z5{curl 0};
52         tipdir := (direction 1 of p);
53
54         save tip_angle;
55         tip_angle := 50;
56         penpos5 (hair, tip_angle);
57         penpos6 (hair, 90 + tip_angle);
58
59         z5 = z6;
60
61         pickup pencircle scaled 1;
62
63         %draw p;
64         fill
65         %draw
66         (z1{up} .. z3l{up}
67                 .. z4r{right}
68                 .. z2{right}
69                 .. z6r{tipdir}
70                 .. z5r .. z6l{-tipdir}
71                 .. z7{dir(180 + leave_angle)} & z7 .. z1{left} & cycle)
72                  yscaled updown;
73
74
75         if updown = 1:
76                 penlabels (1,2,3,4,5,6,7);
77         fi;
78
79 endgroup;
80 enddef;
81
82 fet_beginchar ("bracket tip up", "up");
83    draw_bracket (0.45 staff_space#, 1.9 staff_space#, 1);
84 fet_endchar;
85
86 fet_beginchar ("bracket tip down", "down"); 
87    draw_bracket (0.45 staff_space#, 1.9 staff_space#, -1);
88 fet_endchar;
89
90 fet_endgroup ("brackettips");