6 staffsize# := 20 pt#; %% arbitrary.
12 def abc_encode_int (expr i) =
14 abc_encode_int(i div 26)&char(65 + i mod 26)
20 % we must let the design increase for each
21 % font to make sure that mftrace doesn't jack up the resolution too highly
22 % for the longer braces.
23 fet_beginfont("feta-braces-" &char(97 + font_count), (font_count + 1)* 15,
34 def draw_brace (expr height_sharp, width_sharp, slt_sharp) =
36 save pendir, height, width, thin, thick, slt;
38 height# := height_sharp;
39 width# := width_sharp;
42 %% +1 is needed because fet_beginchar increments after dumping the strings.
43 fet_beginchar("brace number "&(decimal (code + 1)), "brace"&abc_encode_int(code+1),
44 "brace"&abc_encode_int (code+1))
46 set_char_box (0, width#, height#/2, height#/2);
48 define_pixels (height, width, slt);
59 pendir = unitvector(x3 - x1, y3l/6 - y1);
60 penangle = angle pendir - 90;
61 penpos3(thin, penangle);
62 penpos2(thick, angle(z3 -z1) -90 );
63 penpos1(2/3 thin, penangle);
66 fill z2r .. simple_serif (z3r, z3l, 90)
67 .. z2l .. simple_serif (z1l, z1r, 90) ..cycle;
69 addto currentpicture also currentpicture yscaled -1;
75 save stafflinethickness;
78 linethickness := 0.5pt#;
84 for i := 0 step 1 until font_count:
86 %% We can't store more than 64 (65?) height dimensions in a TFM
87 %% file, so we make small files.
89 for j := 0 step 1 until 63:
90 % message "l: "&decimal l;
91 % note: define_pixels (x) multiplies x by hppp,
92 % must never get bigger than infinity
96 message "Resolution and/or magnification is too high";
97 error please report: <bug-lilypond@gnu.org>;
100 % x should be about one staff space, taking brace to have
101 % default height of 3 staffs, this yields height / 3 / 4 = 12
102 % but 15 looks better
106 linethickness := min (0.5pt#, y/150);
108 draw_brace (y, x, linethickness);
113 fet_endfont("feta-braces");