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--2011 Juergen Reuter <reuter@ipd.uka.de>
7 % LilyPond 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.
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.
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/>.
20 fet_begingroup ("flags");
22 save between_staff_lines, on_staff_line, anywhere;
24 between_staff_lines := 0;
28 save dir_up, dir_down;
43 def draw_mensural_outermost_flare (expr staffline_adjustment, d_) =
44 define_pixels (linethickness, staff_space);
50 T := identity xscaled 1.00 linethickness
51 yscaled 0.22 staff_space
53 pickup pencircle transformed T;
54 ellipse := fullcircle transformed T;
56 z11 = (+0.00 staff_space, -0.00 staff_space);
57 z12 = (+0.15 staff_space, -0.00 staff_space);
59 if staffline_adjustment = between_staff_lines:
60 z13 = (+0.45 staff_space, -0.35 staff_space);
61 z14 = (+0.45 staff_space, -0.85 staff_space);
62 z15 = (+0.00 staff_space, -2.00 staff_space);
63 elseif staffline_adjustment = on_staff_line:
64 z13 = (+0.20 staff_space, -0.05 staff_space);
65 z14 = (+0.20 staff_space, -1.15 staff_space);
66 z15 = (+0.00 staff_space, -1.40 staff_space);
67 else: % staffline_adjustment = anywhere
68 z13 = (+0.33 staff_space, -0.20 staff_space);
69 z14 = (+0.33 staff_space, -1.00 staff_space);
70 z15 = (+0.00 staff_space, -1.70 staff_space);
76 fill get_subpath (ellipse, z11 - z12, z12 - z11, z11)
77 -- get_subpoint (ellipse, z12 - z11, z12)
78 -- get_subpoint (ellipse, z13 - z12, z12)
79 -- get_subpoint (ellipse, direction 0 of pat, z13)
81 .. {direction 1 of pat}
82 get_subpoint (ellipse, direction 1 of pat, z14)
83 -- get_subpath (ellipse, z15 - z14, z14 - z15, z15)
84 -- get_subpoint (ellipse, -direction 1 of pat, z14)
86 .. {-direction 0 of pat}
87 get_subpoint (ellipse, -direction 0 of pat, z13)
88 -- get_subpath (ellipse, z12 - z13, z11 - z12, z12)
92 labels (11, 12, 13, 14, 15);
97 def draw_mensural_inner_flare (expr il_shift, idx, d_) =
98 define_pixels (linethickness, staff_space);
100 save ellipse, pat, T;
104 T := identity xscaled 1.00 linethickness
105 yscaled 0.22 staff_space
107 pickup pencircle transformed T;
108 ellipse := fullcircle transformed T;
119 z[i0] = (0, -il_shift * staff_space);
120 z[i1] = z[i0] + (+0.00 staff_space, -0.10 staff_space);
121 z[i2] = z[i0] + (+0.33 staff_space, -0.30 staff_space);
122 z[i3] = z[i0] + (+0.33 staff_space, -0.70 staff_space);
123 z[i4] = z[i0] + (+0.00 staff_space, -0.90 staff_space);
130 % we avoid cusps originally present in `draw pat'
131 fill get_subpath (ellipse,
132 -direction 0 of pat, direction 0 of pat, z[i1])
133 .. get_subpoint (ellipse, direction 1 of pat, z[i2])
135 .. get_subpoint (ellipse, direction 2 of pat, z[i3])
137 .. get_subpath (ellipse,
138 direction 3 of pat, -direction 3 of pat, z[i4])
139 .. get_subpoint (ellipse, -direction 2 of pat, z[i3])
140 {-direction 2 of pat}
141 .. get_subpoint (ellipse, -direction 1 of pat, z[i2])
142 {-direction 1 of pat}
146 labels ([i0], [i1], [i2], [i3], [i4]);
151 def draw_mensural_flag (expr staffline_adjustment, flares, d_) =
152 save char_box_adjust, flare_shift;
154 if staffline_adjustment = between_staff_lines:
156 elseif staffline_adjustment = on_staff_line:
158 else: % staffline_adjustment = anywhere
162 char_box_adjust := flare_shift + 0.5;
167 (flares + char_box_adjust) * staff_space#,
169 else: % d_ = dir_down
170 set_char_box (0.60 staff_space#,
173 (flares + char_box_adjust) * staff_space#);
176 draw_mensural_outermost_flare (staffline_adjustment, d_);
178 for flare_count := 2 step 1 until 4:
179 if flares >= flare_count:
180 draw_mensural_inner_flare (flare_shift
187 currentpicture := currentpicture xscaled -1
193 % 8th mensural flag, upwards, between staff lines
194 fet_beginchar ("8th Mensural Flag (up)", "mensuralu03");
195 draw_mensural_flag (between_staff_lines, 1, dir_up);
199 % 8th mensural flag, upwards, on staff line
200 fet_beginchar ("8th Mensural Flag (up)", "mensuralu13");
201 draw_mensural_flag (on_staff_line, 1, dir_up);
205 % 8th mensural flag, upwards, anywhere
206 fet_beginchar ("8th Mensural Flag (up)", "mensuralu23");
207 draw_mensural_flag (anywhere, 1, dir_up);
211 % 8th mensural flag, downwards, between staff lines
212 fet_beginchar ("8th Mensural Flag (down)", "mensurald03");
213 draw_mensural_flag (between_staff_lines, 1, dir_down);
217 % 8th mensural flag, downwards, on staff line
218 fet_beginchar ("8th Mensural Flag (down)", "mensurald13");
219 draw_mensural_flag (on_staff_line, 1, dir_down);
223 % 8th mensural flag, downwards, anywhere
224 fet_beginchar ("8th Mensural Flag (down)", "mensurald23");
225 draw_mensural_flag (anywhere, 1, dir_down);
229 % 16th mensural flag, upwards, between staff lines
230 fet_beginchar ("16th Mensural Flag (up)", "mensuralu04");
231 draw_mensural_flag (between_staff_lines, 2, dir_up);
235 % 16th mensural flag, upwards, on staff line
236 fet_beginchar ("16th Mensural Flag (up)", "mensuralu14");
237 draw_mensural_flag (on_staff_line, 2, dir_up);
241 % 16th mensural flag, upwards, anywhere
242 fet_beginchar ("16th Mensural Flag (up)", "mensuralu24");
243 draw_mensural_flag (anywhere, 2, dir_up);
247 % 16th mensural flag, downwards, between staff lines
248 fet_beginchar ("16th Mensural Flag (down)", "mensurald04");
249 draw_mensural_flag (between_staff_lines, 2, dir_down);
253 % 16th mensural flag, downwards, on staff line
254 fet_beginchar ("16th Mensural Flag (down)", "mensurald14");
255 draw_mensural_flag (on_staff_line, 2, dir_down);
259 % 16th mensural flag, downwards, anywhere
260 fet_beginchar ("16th Mensural Flag (down)", "mensurald24");
261 draw_mensural_flag (anywhere, 2, dir_down);
265 % 32th mensural flag, upwards, between staff lines
266 fet_beginchar ("32th Mensural Flag (up)", "mensuralu05");
267 draw_mensural_flag (between_staff_lines, 3, dir_up);
271 % 32th mensural flag, upwards, on staff line
272 fet_beginchar ("32th Mensural Flag (up)", "mensuralu15");
273 draw_mensural_flag (on_staff_line, 3, dir_up);
277 % 32th mensural flag, upwards, anywhere
278 fet_beginchar ("32th Mensural Flag (up)", "mensuralu25");
279 draw_mensural_flag (anywhere, 3, dir_up);
283 % 32th mensural flag, downwards, between staff lines
284 fet_beginchar ("32th Mensural Flag (down)", "mensurald05");
285 draw_mensural_flag (between_staff_lines, 3, dir_down);
289 % 32th mensural flag, downwards, on staff line
290 fet_beginchar ("32th Mensural Flag (down)", "mensurald15");
291 draw_mensural_flag (on_staff_line, 3, dir_down);
295 % 32th mensural flag, downwards, anywhere
296 fet_beginchar ("32th Mensural Flag (down)", "mensurald25");
297 draw_mensural_flag (anywhere, 3, dir_down);
301 % 64th mensural flag, upwards, between staff lines
302 fet_beginchar ("64th Mensural Flag (up)", "mensuralu06");
303 draw_mensural_flag (between_staff_lines, 4, dir_up);
307 % 64th mensural flag, upwards, on staff line
308 fet_beginchar ("64th Mensural Flag (up)", "mensuralu16");
309 draw_mensural_flag (on_staff_line, 4, dir_up);
313 % 64th mensural flag, upwards, anywhere
314 fet_beginchar ("64th Mensural Flag (up)", "mensuralu26");
315 draw_mensural_flag (anywhere, 4, dir_up);
319 % 64th mensural flag, downwards, between staff lines
320 fet_beginchar ("64th Mensural Flag (down)", "mensurald06");
321 draw_mensural_flag (between_staff_lines, 4, dir_down);
325 % 64th mensural flag, downwards, on staff line
326 fet_beginchar ("64th Mensural Flag (down)", "mensurald16");
327 draw_mensural_flag (on_staff_line, 4, dir_down);
331 % 64th mensural flag, downwards, anywhere
332 fet_beginchar ("64th Mensural Flag (down)", "mensurald26");
333 draw_mensural_flag (anywhere, 4, dir_down);
337 fet_endgroup ("flags");