1 % Feta (not the Font-En-Tja) music font -- small ties
2 % This file is part of LilyPond, the GNU music typesetter.
4 % Copyright (C) 2011--2012 Bertrand Bordage <bordage.bertrand@gmail.com>
6 % The LilyPond font is free software: you can redistribute it and/or modify
7 % it under the terms of the GNU General Public License as published by
8 % the Free Software Foundation, either version 3 of the License, or
9 % (at your option) any later version, or under the SIL Open Font License.
11 % LilyPond is distributed in the hope that it will be useful,
12 % but WITHOUT ANY WARRANTY; without even the implied warranty of
13 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 % GNU General Public License for more details.
16 % You should have received a copy of the GNU General Public License
17 % along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
19 fet_begingroup ("ties");
21 save min_width, max_width, min_height, max_height, thin, thick;
23 min_width:= .5 staff_space#;
24 max_width:= 5 staff_space#;
25 min_height := .2 staff_space#;
26 max_height := .4 staff_space#;
27 thin := 1.2 linethickness;
28 thick := 2 linethickness;
31 def draw_lyric_tie (expr width_sharp) =
32 save padding, angularity, width, height, depth;
34 padding# := .4 staff_space#;
36 width# := max (min (width_sharp, max_width), min_width);
37 height# := (max (width# - min_width, 0) / (max_width - min_width))
38 [min_height, max_height];
39 depth# := padding# + height#;
41 set_char_box (0, 0, depth#, 0);
43 define_pixels (width, padding);
45 z1 = (-width / 2, -padding);
47 z3 = (width / 2, -padding);
49 penpos1 (thin, angularity * angle (z2 - z1) + 90);
51 penpos3 (thin, angularity * angle (z3 - z2) + 90);
54 .. simple_serif (z3l, z3r, 90)
56 .. simple_serif (z1r, z1l, 90)
63 fet_beginchar ("Short lyric tie", "lyric.short");
64 draw_lyric_tie (1.25 staff_space#);
68 fet_beginchar ("Default lyric tie", "lyric.default");
69 draw_lyric_tie (1.75 staff_space#);
72 fet_endgroup ("ties");