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