1 % -%-Fundamental-%- -*-Metafont-*-
2 % parmesan-flags.mf -- implement ancient flags
4 % source file of LilyPond's pretty-but-neat music font
6 % (c) 2001--2006 Juergen Reuter <reuter@ipd.uka.de>
9 fet_begingroup ("flags");
11 save between_staff_lines, on_staff_line, anywhere;
13 between_staff_lines := 0;
17 save dir_up, dir_down;
32 def draw_mensural_outermost_flare (expr staffline_adjustment, d_) =
33 define_pixels (linethickness, staff_space);
38 pickup pencircle xscaled 1.00 linethickness
39 yscaled 0.22 staff_space
42 ellipse := fullcircle xscaled 1.00 linethickness
43 yscaled 0.22 staff_space
46 z11 = (+0.00 staff_space, -0.00 staff_space);
47 z12 = (+0.15 staff_space, -0.00 staff_space);
49 if staffline_adjustment = between_staff_lines:
50 z13 = (+0.45 staff_space, -0.35 staff_space);
51 z14 = (+0.45 staff_space, -0.85 staff_space);
52 z15 = (+0.00 staff_space, -2.00 staff_space);
53 elseif staffline_adjustment = on_staff_line:
54 z13 = (+0.20 staff_space, -0.05 staff_space);
55 z14 = (+0.20 staff_space, -1.15 staff_space);
56 z15 = (+0.00 staff_space, -1.40 staff_space);
57 else: % staffline_adjustment = anywhere
58 z13 = (+0.33 staff_space, -0.20 staff_space);
59 z14 = (+0.33 staff_space, -1.00 staff_space);
60 z15 = (+0.00 staff_space, -1.70 staff_space);
66 fill get_subpath (ellipse, z11 - z12, z12 - z11, z11)
67 -- get_subpoint (ellipse, z12 - z11, z12)
68 -- get_subpoint (ellipse, z13 - z12, z12)
69 -- get_subpoint (ellipse, direction 0 of pat, z13)
71 .. {direction 1 of pat}
72 get_subpoint (ellipse, direction 1 of pat, z14)
73 -- get_subpath (ellipse, z15 - z14, z14 - z15, z15)
74 -- get_subpoint (ellipse, -direction 1 of pat, z14)
76 .. {-direction 0 of pat}
77 get_subpoint (ellipse, -direction 0 of pat, z13)
78 -- get_subpath (ellipse, z12 - z13, z11 - z12, z12)
82 labels (11, 12, 13, 14, 15);
87 def draw_mensural_inner_flare (expr il_shift, idx, d_) =
88 define_pixels (linethickness, staff_space);
93 pickup pencircle xscaled 1.00 linethickness
94 yscaled 0.22 staff_space
97 ellipse := fullcircle xscaled 1.00 linethickness
98 yscaled 0.22 staff_space
110 z[i0] = (0, -il_shift * staff_space);
111 z[i1] = z[i0] + (+0.00 staff_space, -0.10 staff_space);
112 z[i2] = z[i0] + (+0.33 staff_space, -0.30 staff_space);
113 z[i3] = z[i0] + (+0.33 staff_space, -0.70 staff_space);
114 z[i4] = z[i0] + (+0.00 staff_space, -0.90 staff_space);
121 % we avoid cusps originally present in `draw pat'
122 fill get_subpath (ellipse,
123 -direction 0 of pat, direction 0 of pat, z[i1])
124 .. get_subpoint (ellipse, direction 1 of pat, z[i2])
126 .. get_subpoint (ellipse, direction 2 of pat, z[i3])
128 .. get_subpath (ellipse,
129 direction 3 of pat, -direction 3 of pat, z[i4])
130 .. get_subpoint (ellipse, -direction 2 of pat, z[i3])
131 {-direction 2 of pat}
132 .. get_subpoint (ellipse, -direction 1 of pat, z[i2])
133 {-direction 1 of pat}
137 labels ([i0], [i1], [i2], [i3], [i4]);
142 def draw_mensural_flag (expr staffline_adjustment, flares, d_) =
143 save char_box_adjust, flare_shift;
145 if staffline_adjustment = between_staff_lines:
147 elseif staffline_adjustment = on_staff_line:
149 else: % staffline_adjustment = anywhere
153 char_box_adjust := flare_shift + 0.5;
158 (flares + char_box_adjust) * staff_space#,
160 else: % d_ = dir_down
161 set_char_box (0.60 staff_space#,
164 (flares + char_box_adjust) * staff_space#);
167 draw_mensural_outermost_flare (staffline_adjustment, d_);
169 for flare_count := 2 step 1 until 4:
170 if flares >= flare_count:
171 draw_mensural_inner_flare (flare_shift
178 currentpicture := currentpicture xscaled -1
184 % 8th mensural flag, upwards, between staff lines
185 fet_beginchar ("8th Mensural Flag (up)", "mensuralu03");
186 draw_mensural_flag (between_staff_lines, 1, dir_up);
190 % 8th mensural flag, upwards, on staff line
191 fet_beginchar ("8th Mensural Flag (up)", "mensuralu13");
192 draw_mensural_flag (on_staff_line, 1, dir_up);
196 % 8th mensural flag, upwards, anywhere
197 fet_beginchar ("8th Mensural Flag (up)", "mensuralu23");
198 draw_mensural_flag (anywhere, 1, dir_up);
202 % 8th mensural flag, downwards, between staff lines
203 fet_beginchar ("8th Mensural Flag (down)", "mensurald03");
204 draw_mensural_flag (between_staff_lines, 1, dir_down);
208 % 8th mensural flag, downwards, on staff line
209 fet_beginchar ("8th Mensural Flag (down)", "mensurald13");
210 draw_mensural_flag (on_staff_line, 1, dir_down);
214 % 8th mensural flag, downwards, anywhere
215 fet_beginchar ("8th Mensural Flag (down)", "mensurald23");
216 draw_mensural_flag (anywhere, 1, dir_down);
220 % 16th mensural flag, upwards, between staff lines
221 fet_beginchar ("16th Mensural Flag (up)", "mensuralu04");
222 draw_mensural_flag (between_staff_lines, 2, dir_up);
226 % 16th mensural flag, upwards, on staff line
227 fet_beginchar ("16th Mensural Flag (up)", "mensuralu14");
228 draw_mensural_flag (on_staff_line, 2, dir_up);
232 % 16th mensural flag, upwards, anywhere
233 fet_beginchar ("16th Mensural Flag (up)", "mensuralu24");
234 draw_mensural_flag (anywhere, 2, dir_up);
238 % 16th mensural flag, downwards, between staff lines
239 fet_beginchar ("16th Mensural Flag (down)", "mensurald04");
240 draw_mensural_flag (between_staff_lines, 2, dir_down);
244 % 16th mensural flag, downwards, on staff line
245 fet_beginchar ("16th Mensural Flag (down)", "mensurald14");
246 draw_mensural_flag (on_staff_line, 2, dir_down);
250 % 16th mensural flag, downwards, anywhere
251 fet_beginchar ("16th Mensural Flag (down)", "mensurald24");
252 draw_mensural_flag (anywhere, 2, dir_down);
256 % 32th mensural flag, upwards, between staff lines
257 fet_beginchar ("32th Mensural Flag (up)", "mensuralu05");
258 draw_mensural_flag (between_staff_lines, 3, dir_up);
262 % 32th mensural flag, upwards, on staff line
263 fet_beginchar ("32th Mensural Flag (up)", "mensuralu15");
264 draw_mensural_flag (on_staff_line, 3, dir_up);
268 % 32th mensural flag, upwards, anywhere
269 fet_beginchar ("32th Mensural Flag (up)", "mensuralu25");
270 draw_mensural_flag (anywhere, 3, dir_up);
274 % 32th mensural flag, downwards, between staff lines
275 fet_beginchar ("32th Mensural Flag (down)", "mensurald05");
276 draw_mensural_flag (between_staff_lines, 3, dir_down);
280 % 32th mensural flag, downwards, on staff line
281 fet_beginchar ("32th Mensural Flag (down)", "mensurald15");
282 draw_mensural_flag (on_staff_line, 3, dir_down);
286 % 32th mensural flag, downwards, anywhere
287 fet_beginchar ("32th Mensural Flag (down)", "mensurald25");
288 draw_mensural_flag (anywhere, 3, dir_down);
292 % 64th mensural flag, upwards, between staff lines
293 fet_beginchar ("64th Mensural Flag (up)", "mensuralu06");
294 draw_mensural_flag (between_staff_lines, 4, dir_up);
298 % 64th mensural flag, upwards, on staff line
299 fet_beginchar ("64th Mensural Flag (up)", "mensuralu16");
300 draw_mensural_flag (on_staff_line, 4, dir_up);
304 % 64th mensural flag, upwards, anywhere
305 fet_beginchar ("64th Mensural Flag (up)", "mensuralu26");
306 draw_mensural_flag (anywhere, 4, dir_up);
310 % 64th mensural flag, downwards, between staff lines
311 fet_beginchar ("64th Mensural Flag (down)", "mensurald06");
312 draw_mensural_flag (between_staff_lines, 4, dir_down);
316 % 64th mensural flag, downwards, on staff line
317 fet_beginchar ("64th Mensural Flag (down)", "mensurald16");
318 draw_mensural_flag (on_staff_line, 4, dir_down);
322 % 64th mensural flag, downwards, anywhere
323 fet_beginchar ("64th Mensural Flag (down)", "mensurald26");
324 draw_mensural_flag (anywhere, 4, dir_down);
328 fet_endgroup ("flags");