1 % Feta (not the Font-En-Tja) music font -- ancient flags
2 % This file is part of LilyPond, the GNU music typesetter.
4 % Copyright (C) 2001--2014 Juergen Reuter <reuter@ipd.uka.de>
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 ("flags");
21 save between_staff_lines, on_staff_line, anywhere;
23 between_staff_lines := 0;
27 save dir_up, dir_down;
42 def draw_mensural_outermost_flare (expr staffline_adjustment, d_) =
43 save flag_end, flag_right;
45 if staffline_adjustment = between_staff_lines:
48 elseif staffline_adjustment = on_staff_line:
51 else: % staffline_adjustment = anywhere
56 penpos1 (0.25 staff_space, 90);
57 penpos2 (0.2 staff_space, 0);
58 penpos3 (0.1 staff_space, -35);
60 z2r = (flag_right * staff_space, -0.4 staff_space);
61 z3l = (0, -1.0 * flag_end * staff_space);
66 .. { dir -125 }z3l{ dir -125 }
67 .. { dir 55 }z3r{dir 55 }
73 draw_square_block ((-0.5 stemthickness_rounded, 0),
74 (0, -0.25 staff_space));
79 def draw_mensural_inner_flare (expr il_shift, idx, d_) =
80 define_pixels (linethickness, staff_space);
86 T := identity xscaled 1.00 linethickness
87 yscaled 0.22 staff_space
89 pickup pencircle transformed T;
90 ellipse := fullcircle transformed T;
101 z[i0] = (0, -il_shift * staff_space);
102 z[i1] = z[i0] + (+0.00 staff_space, -0.10 staff_space);
103 z[i2] = z[i0] + (+0.33 staff_space, -0.30 staff_space);
104 z[i3] = z[i0] + (+0.33 staff_space, -0.70 staff_space);
105 z[i4] = z[i0] + (+0.00 staff_space, -0.90 staff_space);
112 % we avoid cusps originally present in `draw pat'
113 fill get_subpath (ellipse,
114 -direction 0 of pat, direction 0 of pat, z[i1])
115 .. get_subpoint (ellipse, direction 1 of pat, z[i2])
117 .. get_subpoint (ellipse, direction 2 of pat, z[i3])
119 .. get_subpath (ellipse,
120 direction 3 of pat, -direction 3 of pat, z[i4])
121 .. get_subpoint (ellipse, -direction 2 of pat, z[i3])
122 {-direction 2 of pat}
123 .. get_subpoint (ellipse, -direction 1 of pat, z[i2])
124 {-direction 1 of pat}
128 labels ([i0], [i1], [i2], [i3], [i4]);
133 def draw_mensural_flag (expr staffline_adjustment, flares, d_) =
134 save char_box_adjust, flare_shift;
136 if staffline_adjustment = between_staff_lines:
138 elseif staffline_adjustment = on_staff_line:
140 else: % staffline_adjustment = anywhere
144 char_box_adjust := flare_shift + 0.5;
149 (flares + char_box_adjust) * staff_space#,
151 else: % d_ = dir_down
152 set_char_box (0.60 staff_space#,
155 (flares + char_box_adjust) * staff_space#);
158 draw_mensural_outermost_flare (staffline_adjustment, d_);
160 for flare_count := 2 step 1 until 4:
161 if flares >= flare_count:
162 draw_mensural_inner_flare (flare_shift
169 currentpicture := currentpicture xscaled -1
171 shifted (-0.5 stemthickness_rounded, 0);
176 % 8th mensural flag, upwards, between staff lines
177 fet_beginchar ("8th Mensural Flag (up)", "mensuralu03");
178 draw_mensural_flag (between_staff_lines, 1, dir_up);
182 % 8th mensural flag, upwards, on staff line
183 fet_beginchar ("8th Mensural Flag (up)", "mensuralu13");
184 draw_mensural_flag (on_staff_line, 1, dir_up);
188 % 8th mensural flag, upwards, anywhere
189 fet_beginchar ("8th Mensural Flag (up)", "mensuralu23");
190 draw_mensural_flag (anywhere, 1, dir_up);
194 % 8th mensural flag, downwards, between staff lines
195 fet_beginchar ("8th Mensural Flag (down)", "mensurald03");
196 draw_mensural_flag (between_staff_lines, 1, dir_down);
200 % 8th mensural flag, downwards, on staff line
201 fet_beginchar ("8th Mensural Flag (down)", "mensurald13");
202 draw_mensural_flag (on_staff_line, 1, dir_down);
206 % 8th mensural flag, downwards, anywhere
207 fet_beginchar ("8th Mensural Flag (down)", "mensurald23");
208 draw_mensural_flag (anywhere, 1, dir_down);
212 % 16th mensural flag, upwards, between staff lines
213 fet_beginchar ("16th Mensural Flag (up)", "mensuralu04");
214 draw_mensural_flag (between_staff_lines, 2, dir_up);
218 % 16th mensural flag, upwards, on staff line
219 fet_beginchar ("16th Mensural Flag (up)", "mensuralu14");
220 draw_mensural_flag (on_staff_line, 2, dir_up);
224 % 16th mensural flag, upwards, anywhere
225 fet_beginchar ("16th Mensural Flag (up)", "mensuralu24");
226 draw_mensural_flag (anywhere, 2, dir_up);
230 % 16th mensural flag, downwards, between staff lines
231 fet_beginchar ("16th Mensural Flag (down)", "mensurald04");
232 draw_mensural_flag (between_staff_lines, 2, dir_down);
236 % 16th mensural flag, downwards, on staff line
237 fet_beginchar ("16th Mensural Flag (down)", "mensurald14");
238 draw_mensural_flag (on_staff_line, 2, dir_down);
242 % 16th mensural flag, downwards, anywhere
243 fet_beginchar ("16th Mensural Flag (down)", "mensurald24");
244 draw_mensural_flag (anywhere, 2, dir_down);
248 % 32th mensural flag, upwards, between staff lines
249 fet_beginchar ("32th Mensural Flag (up)", "mensuralu05");
250 draw_mensural_flag (between_staff_lines, 3, dir_up);
254 % 32th mensural flag, upwards, on staff line
255 fet_beginchar ("32th Mensural Flag (up)", "mensuralu15");
256 draw_mensural_flag (on_staff_line, 3, dir_up);
260 % 32th mensural flag, upwards, anywhere
261 fet_beginchar ("32th Mensural Flag (up)", "mensuralu25");
262 draw_mensural_flag (anywhere, 3, dir_up);
266 % 32th mensural flag, downwards, between staff lines
267 fet_beginchar ("32th Mensural Flag (down)", "mensurald05");
268 draw_mensural_flag (between_staff_lines, 3, dir_down);
272 % 32th mensural flag, downwards, on staff line
273 fet_beginchar ("32th Mensural Flag (down)", "mensurald15");
274 draw_mensural_flag (on_staff_line, 3, dir_down);
278 % 32th mensural flag, downwards, anywhere
279 fet_beginchar ("32th Mensural Flag (down)", "mensurald25");
280 draw_mensural_flag (anywhere, 3, dir_down);
284 % 64th mensural flag, upwards, between staff lines
285 fet_beginchar ("64th Mensural Flag (up)", "mensuralu06");
286 draw_mensural_flag (between_staff_lines, 4, dir_up);
290 % 64th mensural flag, upwards, on staff line
291 fet_beginchar ("64th Mensural Flag (up)", "mensuralu16");
292 draw_mensural_flag (on_staff_line, 4, dir_up);
296 % 64th mensural flag, upwards, anywhere
297 fet_beginchar ("64th Mensural Flag (up)", "mensuralu26");
298 draw_mensural_flag (anywhere, 4, dir_up);
302 % 64th mensural flag, downwards, between staff lines
303 fet_beginchar ("64th Mensural Flag (down)", "mensurald06");
304 draw_mensural_flag (between_staff_lines, 4, dir_down);
308 % 64th mensural flag, downwards, on staff line
309 fet_beginchar ("64th Mensural Flag (down)", "mensurald16");
310 draw_mensural_flag (on_staff_line, 4, dir_down);
314 % 64th mensural flag, downwards, anywhere
315 fet_beginchar ("64th Mensural Flag (down)", "mensurald26");
316 draw_mensural_flag (anywhere, 4, dir_down);
320 fet_endgroup ("flags");