]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-timesignatures.mf
Add '-dcrop' option to ps and svg backends
[lilypond.git] / mf / feta-timesignatures.mf
1 % Feta (not the Font-En-Tja) music font --  implement Time Signatures
2 % This file is part of LilyPond, the GNU music typesetter.
3 %
4 % Copyright (C) 1998--2015 Mats Bengtsson <matsb@s3.kth.se>,
5 %                Christian Mondrup <scancm@biobase.dk>
6 %
7 % The LilyPond font is free software: you can redistribute it and/or modify
8 % it under the terms of the GNU General Public License as published by
9 % the Free Software Foundation, either version 3 of the License, or
10 % (at your option) any later version, or under the SIL Open Font License.
11 %
12 % LilyPond is distributed in the hope that it will be useful,
13 % but WITHOUT ANY WARRANTY; without even the implied warranty of
14 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 % GNU General Public License for more details.
16 %
17 % You should have received a copy of the GNU General Public License
18 % along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
19
20 fet_begingroup ("timesig");
21
22
23 %
24 % Originally by Mats B. nuked by Han-Wen, inspired by
25 % Baerenreiter BA320 (Bach Cello Suites, Suite III).
26 %
27 % Notes:
28 %
29 %  * The inside curve of the C is rather straight.
30 %  * The outside curve of the C is rather round.
31 %  * Right tips of the C point slightly outward.
32 %  * Lower tip protrudes to the right very slightly.
33 %
34
35 def draw_C =
36         save hair, bulb_rad, left_fatness;
37         save left_width, right_width;
38         save width, lower_offset;
39
40         width# := 1.8 staff_space# - stafflinethickness#;
41
42         left_width := 1.0 staff_space;
43         right_width := 0.8 staff_space;
44
45         hair := stafflinethickness;
46
47         bulb_rad := 0.40 staff_space - .6 stafflinethickness;
48         left_fatness := 0.55 * staff_space;
49         lower_offset := 0.3 stafflinethickness;
50
51         set_char_box (0, width#, staff_space#, staff_space#);
52
53         d := d - feta_shift;
54
55         x1r = w;
56         x3r = 0;
57         y1r = .45 h;
58         y2r = h + vround (.5 stafflinethickness_rounded);
59         y4r = -d - vround (.5 stafflinethickness_rounded);
60         x2 = x4;
61         x2 = x3r + h;
62         y3r = .5 (h - d);
63
64         x5r = x1r + lower_offset;
65         y5r = -0.37 h;
66
67         penpos1 (hair, 10);
68         penpos2 (stafflinethickness_rounded, 90);
69         penpos3 (left_fatness, 180);
70         penpos4 (stafflinethickness_rounded, -90);
71         penpos5 (hair, -13);
72
73         draw_bulb (-1, z1l, z1r, bulb_rad, .8);
74
75         save s;
76         s := 0.735;
77
78         fill z1l{dir (100)}
79              .. z2l{left}
80              ..tension 0.8.. z3l{down}
81              ..tension 0.8.. z4l{right}
82              .. simple_serif (z5l, z5r, -90)
83              .. z4r{left}
84              .. super_curvelet (z4r, z3r, s, -1)
85              .. z3r{up}
86              .. super_curvelet (z3r, z2r, s, 1)
87              .. z2r{right}
88              .. {dir (-80)}z1r
89              -- cycle;
90
91         penlabels (1, 2, 3, 4, 5);
92
93         draw_staff_if_debugging (-2, 2);
94 enddef;
95
96
97 fet_beginchar ("4/4 meter", "C44");
98         draw_C;
99 fet_endchar;
100
101
102 fet_beginchar ("2/2 meter", "C22");
103         save eccentricity, top_stemlen, bottom_stemlen, thick, left_pos;
104
105         draw_C;
106
107         eccentricity = -1.75 stafflinethickness - 0.025 staff_space;
108         top_stemlen# = bottom_stemlen# = 1.4 staff_space#;
109         thick# = stafflinethickness# + 0.05 staff_space#;
110         define_whole_pixels (top_stemlen, bottom_stemlen);
111         define_whole_blacker_pixels (thick);
112
113         bottom_stemlen := bottom_stemlen - feta_shift;
114
115         draw_block ((x2 + eccentricity, -bottom_stemlen),
116                     (x2 + eccentricity + thick, top_stemlen));
117 fet_endchar;
118
119 fet_endgroup ("timesig");