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--2012 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 define_pixels (linethickness, staff_space);
49 T := identity xscaled 1.00 linethickness
50 yscaled 0.22 staff_space
52 pickup pencircle transformed T;
53 ellipse := fullcircle transformed T;
55 z11 = (+0.00 staff_space, -0.00 staff_space);
56 z12 = (+0.15 staff_space, -0.00 staff_space);
58 if staffline_adjustment = between_staff_lines:
59 z13 = (+0.45 staff_space, -0.35 staff_space);
60 z14 = (+0.45 staff_space, -0.85 staff_space);
61 z15 = (+0.00 staff_space, -2.00 staff_space);
62 elseif staffline_adjustment = on_staff_line:
63 z13 = (+0.20 staff_space, -0.05 staff_space);
64 z14 = (+0.20 staff_space, -1.15 staff_space);
65 z15 = (+0.00 staff_space, -1.40 staff_space);
66 else: % staffline_adjustment = anywhere
67 z13 = (+0.33 staff_space, -0.20 staff_space);
68 z14 = (+0.33 staff_space, -1.00 staff_space);
69 z15 = (+0.00 staff_space, -1.70 staff_space);
75 fill get_subpath (ellipse, z11 - z12, z12 - z11, z11)
76 -- get_subpoint (ellipse, z12 - z11, z12)
77 -- get_subpoint (ellipse, z13 - z12, z12)
78 -- get_subpoint (ellipse, direction 0 of pat, z13)
80 .. {direction 1 of pat}
81 get_subpoint (ellipse, direction 1 of pat, z14)
82 -- get_subpath (ellipse, z15 - z14, z14 - z15, z15)
83 -- get_subpoint (ellipse, -direction 1 of pat, z14)
85 .. {-direction 0 of pat}
86 get_subpoint (ellipse, -direction 0 of pat, z13)
87 -- get_subpath (ellipse, z12 - z13, z11 - z12, z12)
91 labels (11, 12, 13, 14, 15);
96 def draw_mensural_inner_flare (expr il_shift, idx, d_) =
97 define_pixels (linethickness, staff_space);
103 T := identity xscaled 1.00 linethickness
104 yscaled 0.22 staff_space
106 pickup pencircle transformed T;
107 ellipse := fullcircle transformed T;
118 z[i0] = (0, -il_shift * staff_space);
119 z[i1] = z[i0] + (+0.00 staff_space, -0.10 staff_space);
120 z[i2] = z[i0] + (+0.33 staff_space, -0.30 staff_space);
121 z[i3] = z[i0] + (+0.33 staff_space, -0.70 staff_space);
122 z[i4] = z[i0] + (+0.00 staff_space, -0.90 staff_space);
129 % we avoid cusps originally present in `draw pat'
130 fill get_subpath (ellipse,
131 -direction 0 of pat, direction 0 of pat, z[i1])
132 .. get_subpoint (ellipse, direction 1 of pat, z[i2])
134 .. get_subpoint (ellipse, direction 2 of pat, z[i3])
136 .. get_subpath (ellipse,
137 direction 3 of pat, -direction 3 of pat, z[i4])
138 .. get_subpoint (ellipse, -direction 2 of pat, z[i3])
139 {-direction 2 of pat}
140 .. get_subpoint (ellipse, -direction 1 of pat, z[i2])
141 {-direction 1 of pat}
145 labels ([i0], [i1], [i2], [i3], [i4]);
150 def draw_mensural_flag (expr staffline_adjustment, flares, d_) =
151 save char_box_adjust, flare_shift;
153 if staffline_adjustment = between_staff_lines:
155 elseif staffline_adjustment = on_staff_line:
157 else: % staffline_adjustment = anywhere
161 char_box_adjust := flare_shift + 0.5;
166 (flares + char_box_adjust) * staff_space#,
168 else: % d_ = dir_down
169 set_char_box (0.60 staff_space#,
172 (flares + char_box_adjust) * staff_space#);
175 draw_mensural_outermost_flare (staffline_adjustment, d_);
177 for flare_count := 2 step 1 until 4:
178 if flares >= flare_count:
179 draw_mensural_inner_flare (flare_shift
186 currentpicture := currentpicture xscaled -1
192 % 8th mensural flag, upwards, between staff lines
193 fet_beginchar ("8th Mensural Flag (up)", "mensuralu03");
194 draw_mensural_flag (between_staff_lines, 1, dir_up);
198 % 8th mensural flag, upwards, on staff line
199 fet_beginchar ("8th Mensural Flag (up)", "mensuralu13");
200 draw_mensural_flag (on_staff_line, 1, dir_up);
204 % 8th mensural flag, upwards, anywhere
205 fet_beginchar ("8th Mensural Flag (up)", "mensuralu23");
206 draw_mensural_flag (anywhere, 1, dir_up);
210 % 8th mensural flag, downwards, between staff lines
211 fet_beginchar ("8th Mensural Flag (down)", "mensurald03");
212 draw_mensural_flag (between_staff_lines, 1, dir_down);
216 % 8th mensural flag, downwards, on staff line
217 fet_beginchar ("8th Mensural Flag (down)", "mensurald13");
218 draw_mensural_flag (on_staff_line, 1, dir_down);
222 % 8th mensural flag, downwards, anywhere
223 fet_beginchar ("8th Mensural Flag (down)", "mensurald23");
224 draw_mensural_flag (anywhere, 1, dir_down);
228 % 16th mensural flag, upwards, between staff lines
229 fet_beginchar ("16th Mensural Flag (up)", "mensuralu04");
230 draw_mensural_flag (between_staff_lines, 2, dir_up);
234 % 16th mensural flag, upwards, on staff line
235 fet_beginchar ("16th Mensural Flag (up)", "mensuralu14");
236 draw_mensural_flag (on_staff_line, 2, dir_up);
240 % 16th mensural flag, upwards, anywhere
241 fet_beginchar ("16th Mensural Flag (up)", "mensuralu24");
242 draw_mensural_flag (anywhere, 2, dir_up);
246 % 16th mensural flag, downwards, between staff lines
247 fet_beginchar ("16th Mensural Flag (down)", "mensurald04");
248 draw_mensural_flag (between_staff_lines, 2, dir_down);
252 % 16th mensural flag, downwards, on staff line
253 fet_beginchar ("16th Mensural Flag (down)", "mensurald14");
254 draw_mensural_flag (on_staff_line, 2, dir_down);
258 % 16th mensural flag, downwards, anywhere
259 fet_beginchar ("16th Mensural Flag (down)", "mensurald24");
260 draw_mensural_flag (anywhere, 2, dir_down);
264 % 32th mensural flag, upwards, between staff lines
265 fet_beginchar ("32th Mensural Flag (up)", "mensuralu05");
266 draw_mensural_flag (between_staff_lines, 3, dir_up);
270 % 32th mensural flag, upwards, on staff line
271 fet_beginchar ("32th Mensural Flag (up)", "mensuralu15");
272 draw_mensural_flag (on_staff_line, 3, dir_up);
276 % 32th mensural flag, upwards, anywhere
277 fet_beginchar ("32th Mensural Flag (up)", "mensuralu25");
278 draw_mensural_flag (anywhere, 3, dir_up);
282 % 32th mensural flag, downwards, between staff lines
283 fet_beginchar ("32th Mensural Flag (down)", "mensurald05");
284 draw_mensural_flag (between_staff_lines, 3, dir_down);
288 % 32th mensural flag, downwards, on staff line
289 fet_beginchar ("32th Mensural Flag (down)", "mensurald15");
290 draw_mensural_flag (on_staff_line, 3, dir_down);
294 % 32th mensural flag, downwards, anywhere
295 fet_beginchar ("32th Mensural Flag (down)", "mensurald25");
296 draw_mensural_flag (anywhere, 3, dir_down);
300 % 64th mensural flag, upwards, between staff lines
301 fet_beginchar ("64th Mensural Flag (up)", "mensuralu06");
302 draw_mensural_flag (between_staff_lines, 4, dir_up);
306 % 64th mensural flag, upwards, on staff line
307 fet_beginchar ("64th Mensural Flag (up)", "mensuralu16");
308 draw_mensural_flag (on_staff_line, 4, dir_up);
312 % 64th mensural flag, upwards, anywhere
313 fet_beginchar ("64th Mensural Flag (up)", "mensuralu26");
314 draw_mensural_flag (anywhere, 4, dir_up);
318 % 64th mensural flag, downwards, between staff lines
319 fet_beginchar ("64th Mensural Flag (down)", "mensurald06");
320 draw_mensural_flag (between_staff_lines, 4, dir_down);
324 % 64th mensural flag, downwards, on staff line
325 fet_beginchar ("64th Mensural Flag (down)", "mensurald16");
326 draw_mensural_flag (on_staff_line, 4, dir_down);
330 % 64th mensural flag, downwards, anywhere
331 fet_beginchar ("64th Mensural Flag (down)", "mensurald26");
332 draw_mensural_flag (anywhere, 4, dir_down);
336 fet_endgroup ("flags");