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