Minor regtest correction.
[lilypond.git] / mf / feta-haak.mf
blobddc01c0847015bfc2bd7724520d43744598541d4
1 % feta-haak.mf -- implement bracket tips -*-Fundamental-*-
3 % part of LilyPond's pretty-but-neat music font
5 % source file of the Feta (not the Font-En-Tja) music font
7 % (c) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 fet_begingroup ("brackettips");
11 def draw_bracket (expr thick_sharp, width_sharp, updown) =
12 begingroup;
13         save p, thin, thick, flattening, width, hair, flare;
14         path p;
15         pair tipdir;
17         flattening = 0.72;
18         thick# = thick_sharp;
19         flare# = flattening * width#;
20         width# = width_sharp;
22         define_pixels (thick, width, flare);
23         if updown = 1:
24                 set_char_box (0, width#,
25                               .5 thick#, flare#);
26         else:
27                 set_char_box (0, width#,
28                               flare#, .5 thick#);
29         fi;
31         thin = 2 linethickness;
32         hair = 1.25 linethickness;
34         pickup pencircle scaled thin;
35         y7 = y1;
36         x7 = x2;
37         z2 = z4r + (thin, 0);
39         penpos3 (thin, 0);
40         penpos4 (thin, 90);
42         z3 = z4;
44         top y3 = 0.5 thick;
45         lft x3 = 0.0;
46         x1 = x3l;
47         y1 = -0.5 thick;
49         z8 = .5 [z2, z7];
50         top y5 = flare;
51         rt x5 = width;
53         p := z8{right}
54              ..tension 1.2.. z5{curl 0};
55         tipdir := direction 1 of p;
57         penpos5 (hair, angle tipdir);
58         penpos6 (hair, 90 + angle tipdir);
60         z5 = z6;
62         pickup pencircle scaled 1;
64         fill (z1
65               -- z3l{up}
66               .. z4r{right}
67               -- z2{right}
68               .. z6r{tipdir}
69               .. z5r
70               .. z6l{-tipdir}
71               ..tension 1.1.. z7{left}
72               & z7
73               -- z1
74               & cycle) yscaled updown;
76         if updown = 1:
77                 penlabels (1, 2, 3, 4, 5, 6, 7, 8);
78         fi;
79 endgroup;
80 enddef;
83 fet_beginchar ("bracket tip up", "up");
84         draw_bracket (0.45 staff_space#, 1.9 staff_space#, 1);
85 fet_endchar;
88 fet_beginchar ("bracket tip down", "down");
89         draw_bracket (0.45 staff_space#, 1.9 staff_space#, -1);
90 fet_endchar;
92 fet_endgroup ("brackettips");