]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-haak.mf
release: 0.1.59
[lilypond.git] / mf / feta-haak.mf
1 input feta-macros;
2 input feta-params;
3 input feta-autometric;
4
5 save code;
6 code :=0;
7
8
9 def draw_bracket( expr height_sharp, width_sharp) = 
10         save alpha, height, p, width, thin, thick;
11         height# := height_sharp;
12         width#  := width_sharp;
13
14         beginchar(incr code, width#, height#/2, height#/2);
15  
16         define_pixels (height, width);
17         thin = 2 stafflinethickness;
18         thick = .5 interline;
19         
20         pickup pencircle scaled thin;
21         lft x1 = 0;
22         top y1 = height/2 + thick + thin;
23
24         x2 = x1;
25         z2 = (x1, 0);
26         rt x3 = thick;
27         y3 = y2;
28
29         x4 = x3;
30         bot y4 = y1 - thick + thin/2;
31
32         alpha = 50;
33         z5 = z1 + (width, 3/4interline);
34
35         % need silly z6?
36         % strange turning path when invoked via MakeTeXTFM...?
37         % mf "\\mode:=ljfour; mag:=1; scrollmode; input feta-brackets16"
38         z6 = z5 - (0, thin/16);
39
40         filldraw z5{dir(180+alpha)}..{left}z1--z2--z3..{up}z4{right}
41                 ..{dir(alpha)}z6..cycle;
42
43 %       % try control points to do this in ps
44 %       currentpicture:=currentpicture shifted (-x5/2,(x5-x4)/2);
45 %
46 %       s7 := 0.4*(x5-x1);
47 %       x7 = x1 + s7 * cosd(0);
48 %       y7 = y1 + s7 * sind(0);
49 %
50 %       s8 := -0.25*(x5-x1);
51 %       x8 := x5 + s8 * cosd(alpha);
52 %       y8 := y5 + s8 * sind(alpha);
53 %
54 %       s9 := 0.5*(x5-x4);
55 %       x9 := x4 + s9 * cosd(0);
56 %       y9 := y4 + s9 * sind(0);
57 %
58 %       s10 := -0.15*(x5-x4);
59 %       x10 := x5 + s10 * cosd(alpha);
60 %       y10 := y5 + s10 * sind(alpha);
61 %
62 %       draw z5..controls z8 and z7..z1--z2--z3..{up}z4
63 %               ..controls z9 and z10..z6..cycle;
64 %
65 %       labels(1,2,3,4,5,6,7,8,9,10);
66         addto currentpicture also currentpicture yscaled -1;
67 endchar;
68 enddef;
69
70 % for h :=  staffsize# step 1 pt# until (1.1 * staffsize#):
71 for h :=  staffsize# step 1 pt# until (7 * staffsize#):
72         draw_bracket(h, 2interline# );
73 endfor
74