5 font_coding_scheme "feta braces";
8 fet_beginfont("feta-braces", 16);
17 def abc_encode_int (expr i) =
19 abc_encode_int(i div 26)&char(65 + i mod 26)
25 def draw_brace (expr height_sharp, width_sharp, slt_sharp) =
27 save pendir, height, width, thin, thick, slt;
29 height# := height_sharp;
30 width# := width_sharp;
33 fet_beginchar("brace number "&(decimal code), "brace"&abc_encode_int(code),
34 "brace"&abc_encode_int (code))
36 set_char_box (0, width#, height#/2, height#/2);
38 define_pixels (height, width, slt);
49 pendir = unitvector(x3 - x1, y3l/6 - y1);
50 penangle = angle pendir - 90;
51 penpos3(thin, penangle);
52 penpos2(thick, angle(z3 -z1) -90 );
53 penpos1(2/3 thin, penangle);
56 fill z2r .. simple_serif (z3r, z3l, 90)
57 .. z2l .. simple_serif (z1l, z1r, 90) ..cycle;
59 addto currentpicture also currentpicture yscaled -1;
65 save stafflinethickness;
68 stafflinethickness := 0.5pt#;
74 for i := 0 step 1 until font_count:
76 %% We can't store more than 64 (65?) height dimensions in a TFM
77 %% file, so we make small files.
79 for j := 0 step 1 until 63:
80 % message "l: "&decimal l;
81 % note: define_pixels (x) multiplies x by hppp,
82 % must never get bigger than infinity
83 y := min (y + increment, infinity/hppp - 1);
85 % x should be about one staff space, taking brace to have
86 % default height of 3 staffs, this yields height / 3 / 4 = 12
91 stafflinethickness := min (0.5pt#, y/150);
93 draw_brace (y, x, stafflinethickness);
98 fet_endfont("feta-braces");