]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-beugel.mf
patch::: 1.3.153.uu1
[lilypond.git] / mf / feta-beugel.mf
1 input feta-autometric;
2 input feta-macros;
3 input feta-params;
4
5 fet_beginfont("feta-braces", 16);
6 mode_setup;
7
8 staffsize#:=16pt#;
9
10 save code;
11 code := 0;
12
13
14 def draw_brace (expr height_sharp, width_sharp, slt_sharp) =
15
16         save pendir, height, width, thin, thick, slt;
17         save penangle;
18         height# := height_sharp;
19         width# := width_sharp;
20         slt# := slt_sharp;
21
22         beginchar(code, width#, height#/2, height#/2);
23         code := incr code;
24           
25         define_pixels (height, width, slt);
26         thin = 2 slt;
27         thick = .5 width;
28         
29         z2 = .5 [z1, z3];
30         y3l = y1 + height/2;
31         x3 = x1 + width;
32         y1 =0;
33         x3 = - width / 2;
34
35         pair pendir;
36         pendir = unitvector(x3 - x1, y3l/6 - y1);
37         penangle = angle pendir - 90;
38         penpos3(thin, penangle);
39         penpos2(thick, angle(z3 -z1) -90 );
40         penpos1(2/3 thin, penangle);
41         
42         penlabels(1,2,3);
43         fill z2r ..  simple_serif (z3r, z3l, 90)
44                 .. z2l .. simple_serif (z1l, z1r, 90) ..cycle;
45
46         addto currentpicture also currentpicture yscaled -1;
47 endchar;
48 enddef;
49
50
51
52 % l is the increment.
53 l := 0.2pt#;
54 y := 10pt#;
55
56
57
58 for i := 0 step 1 until font_count:
59
60   %% We can't store more than 64 (65?) height dimensions in a TFM
61   %% file, so we make small files.
62
63   for j := 0 step 1 until 65:
64     % message "l: "&decimal l;
65     % note: define_pixels (x) multiplies x by hppp,
66     % must never get bigger than infinity
67     y := min (y + l / 2, infinity/hppp - 1);
68     % x should be about one staff space, taking brace to have
69     % default height of 3 staffs, this yields height / 3 / 4
70     x := y / 12;
71     % l should be about one stafflinethickness
72     l := x / 10;
73     if i = font_count:
74       draw_brace (y, x, l);
75     fi
76   endfor;
77 endfor
78   
79 fet_endfont("feta-braces");