]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-ties.mf
Add '-dcrop' option to ps and svg backends
[lilypond.git] / mf / feta-ties.mf
1 % Feta (not the Font-En-Tja) music font -- small ties
2 % This file is part of LilyPond, the GNU music typesetter.
3 %
4 % Copyright (C) 2011--2015 Bertrand Bordage <bordage.bertrand@gmail.com>
5 %
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.
10 %
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.
15 %
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/>.
18
19 fet_begingroup ("ties");
20
21 save min_width, max_width, min_height, max_height, thin, thick;
22
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;
29
30
31 def draw_lyric_tie (expr width_sharp) =
32         save padding, angularity, width, height, depth;
33
34         padding# := .4 staff_space#;
35         angularity := 2.5;
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#;
40
41         set_char_box (0, 0, depth#, 0);
42
43         define_pixels (width, padding);
44
45         z1 = (-width / 2, -padding);
46         z2 = (0, -d);
47         z3 = (width / 2, -padding);
48
49         penpos1 (thin, angularity * angle (z2 - z1) + 90);
50         penpos2 (thick, 90);
51         penpos3 (thin, angularity * angle (z3 - z2) + 90);
52
53         fill z2l
54              .. simple_serif (z3l, z3r, 90)
55              .. z2r
56              .. simple_serif (z1r, z1l, 90)
57              .. cycle;
58
59         penlabels (1, 2, 3);
60 enddef;
61
62
63 fet_beginchar ("Short lyric tie", "lyric.short");
64         draw_lyric_tie (1.25 staff_space#);
65 fet_endchar;
66
67
68 fet_beginchar ("Default lyric tie", "lyric.default");
69         draw_lyric_tie (1.75 staff_space#);
70 fet_endchar;
71
72 fet_endgroup ("ties");