2 % feta-beugel.mf -- Staff braces
4 % source file of the Feta (not an acronym for Font-En-Tja)
5 % pretty-but-neat music font
7 % (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 % Jan Nieuwenhuizen <janneke@gnu.org>
10 input feta-autometric;
13 staffsize# := 20 pt#; %% arbitrary.
18 % we must let the design increase for each
19 % font to make sure that mftrace doesn't jack up the resolution too highly
20 % for the longer braces.
21 fet_beginfont ("feta-braces-" & char (97 + font_count), (font_count + 1) * 20,
28 save code, braces_per_font;
30 braces_per_font := 64;
32 def draw_brace (expr height_sharp, width_sharp, slt_sharp, brace_number) =
34 save pendir, height, width, thin, thick, slt;
36 height# := height_sharp;
37 width# := width_sharp;
40 %% +1 is needed because fet_beginchar increments after dumping the strings.
41 fet_beginchar ("brace number " & (decimal (brace_number)),
42 "brace" & decimal(brace_number))
44 set_char_box (width#, 0, height#/2, height#/2);
46 define_pixels (height, width, slt);
57 pendir = unitvector(x3 - x1, y3l/6 - y1);
58 penangle = angle pendir - 90;
59 penpos3(thin, penangle);
60 penpos2(thick, angle(z3 -z1) -90 );
61 penpos1(2/3 thin, penangle);
64 fill z2r .. simple_serif (z3r, z3l, 90)
65 .. z2l .. simple_serif (z1l, z1r, 90) ..cycle;
67 addto currentpicture also currentpicture yscaled -1;
73 save stafflinethickness;
76 linethickness := 0.5pt#;
80 for i := 0 step 1 until font_count:
83 number := braces_per_font * i;
85 for j := 0 step 1 until (braces_per_font -1):
86 % message "l: "&decimal l;
87 % note: define_pixels (x) multiplies x by hppp,
88 % must never get bigger than infinity
91 message "Resolution and/or magnification is too high";
92 message "HPP: "& decimal hpp &" Y: " & y;
93 error "please report to <bug-lilypond@gnu.org>";
96 % x should be about one staff space, taking brace to have
97 % default height of 3 staffs, this yields height / 3 / 4 = 12
102 linethickness := min (0.5pt#, y/150);
104 draw_brace (y, x, linethickness, number);
106 number := number + 1;
110 fet_endfont("feta-braces");