1 % -%-Fundamental-%- -*-Metafont-*-
2 % parmesan-flags.mf -- implement ancient flags
4 % source file of LilyPond's pretty-but-neat music font
6 % (c) 2001--2007 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);
39 T := identity xscaled 1.00 linethickness
40 yscaled 0.22 staff_space
42 pickup pencircle transformed T;
43 ellipse := fullcircle transformed T;
45 z11 = (+0.00 staff_space, -0.00 staff_space);
46 z12 = (+0.15 staff_space, -0.00 staff_space);
48 if staffline_adjustment = between_staff_lines:
49 z13 = (+0.45 staff_space, -0.35 staff_space);
50 z14 = (+0.45 staff_space, -0.85 staff_space);
51 z15 = (+0.00 staff_space, -2.00 staff_space);
52 elseif staffline_adjustment = on_staff_line:
53 z13 = (+0.20 staff_space, -0.05 staff_space);
54 z14 = (+0.20 staff_space, -1.15 staff_space);
55 z15 = (+0.00 staff_space, -1.40 staff_space);
56 else: % staffline_adjustment = anywhere
57 z13 = (+0.33 staff_space, -0.20 staff_space);
58 z14 = (+0.33 staff_space, -1.00 staff_space);
59 z15 = (+0.00 staff_space, -1.70 staff_space);
65 fill get_subpath (ellipse, z11 - z12, z12 - z11, z11)
66 -- get_subpoint (ellipse, z12 - z11, z12)
67 -- get_subpoint (ellipse, z13 - z12, z12)
68 -- get_subpoint (ellipse, direction 0 of pat, z13)
70 .. {direction 1 of pat}
71 get_subpoint (ellipse, direction 1 of pat, z14)
72 -- get_subpath (ellipse, z15 - z14, z14 - z15, z15)
73 -- get_subpoint (ellipse, -direction 1 of pat, z14)
75 .. {-direction 0 of pat}
76 get_subpoint (ellipse, -direction 0 of pat, z13)
77 -- get_subpath (ellipse, z12 - z13, z11 - z12, z12)
81 labels (11, 12, 13, 14, 15);
86 def draw_mensural_inner_flare (expr il_shift, idx, d_) =
87 define_pixels (linethickness, staff_space);
93 T := identity xscaled 1.00 linethickness
94 yscaled 0.22 staff_space
96 pickup pencircle transformed T;
97 ellipse := fullcircle transformed T;
108 z[i0] = (0, -il_shift * staff_space);
109 z[i1] = z[i0] + (+0.00 staff_space, -0.10 staff_space);
110 z[i2] = z[i0] + (+0.33 staff_space, -0.30 staff_space);
111 z[i3] = z[i0] + (+0.33 staff_space, -0.70 staff_space);
112 z[i4] = z[i0] + (+0.00 staff_space, -0.90 staff_space);
119 % we avoid cusps originally present in `draw pat'
120 fill get_subpath (ellipse,
121 -direction 0 of pat, direction 0 of pat, z[i1])
122 .. get_subpoint (ellipse, direction 1 of pat, z[i2])
124 .. get_subpoint (ellipse, direction 2 of pat, z[i3])
126 .. get_subpath (ellipse,
127 direction 3 of pat, -direction 3 of pat, z[i4])
128 .. get_subpoint (ellipse, -direction 2 of pat, z[i3])
129 {-direction 2 of pat}
130 .. get_subpoint (ellipse, -direction 1 of pat, z[i2])
131 {-direction 1 of pat}
135 labels ([i0], [i1], [i2], [i3], [i4]);
140 def draw_mensural_flag (expr staffline_adjustment, flares, d_) =
141 save char_box_adjust, flare_shift;
143 if staffline_adjustment = between_staff_lines:
145 elseif staffline_adjustment = on_staff_line:
147 else: % staffline_adjustment = anywhere
151 char_box_adjust := flare_shift + 0.5;
156 (flares + char_box_adjust) * staff_space#,
158 else: % d_ = dir_down
159 set_char_box (0.60 staff_space#,
162 (flares + char_box_adjust) * staff_space#);
165 draw_mensural_outermost_flare (staffline_adjustment, d_);
167 for flare_count := 2 step 1 until 4:
168 if flares >= flare_count:
169 draw_mensural_inner_flare (flare_shift
176 currentpicture := currentpicture xscaled -1
182 % 8th mensural flag, upwards, between staff lines
183 fet_beginchar ("8th Mensural Flag (up)", "mensuralu03");
184 draw_mensural_flag (between_staff_lines, 1, dir_up);
188 % 8th mensural flag, upwards, on staff line
189 fet_beginchar ("8th Mensural Flag (up)", "mensuralu13");
190 draw_mensural_flag (on_staff_line, 1, dir_up);
194 % 8th mensural flag, upwards, anywhere
195 fet_beginchar ("8th Mensural Flag (up)", "mensuralu23");
196 draw_mensural_flag (anywhere, 1, dir_up);
200 % 8th mensural flag, downwards, between staff lines
201 fet_beginchar ("8th Mensural Flag (down)", "mensurald03");
202 draw_mensural_flag (between_staff_lines, 1, dir_down);
206 % 8th mensural flag, downwards, on staff line
207 fet_beginchar ("8th Mensural Flag (down)", "mensurald13");
208 draw_mensural_flag (on_staff_line, 1, dir_down);
212 % 8th mensural flag, downwards, anywhere
213 fet_beginchar ("8th Mensural Flag (down)", "mensurald23");
214 draw_mensural_flag (anywhere, 1, dir_down);
218 % 16th mensural flag, upwards, between staff lines
219 fet_beginchar ("16th Mensural Flag (up)", "mensuralu04");
220 draw_mensural_flag (between_staff_lines, 2, dir_up);
224 % 16th mensural flag, upwards, on staff line
225 fet_beginchar ("16th Mensural Flag (up)", "mensuralu14");
226 draw_mensural_flag (on_staff_line, 2, dir_up);
230 % 16th mensural flag, upwards, anywhere
231 fet_beginchar ("16th Mensural Flag (up)", "mensuralu24");
232 draw_mensural_flag (anywhere, 2, dir_up);
236 % 16th mensural flag, downwards, between staff lines
237 fet_beginchar ("16th Mensural Flag (down)", "mensurald04");
238 draw_mensural_flag (between_staff_lines, 2, dir_down);
242 % 16th mensural flag, downwards, on staff line
243 fet_beginchar ("16th Mensural Flag (down)", "mensurald14");
244 draw_mensural_flag (on_staff_line, 2, dir_down);
248 % 16th mensural flag, downwards, anywhere
249 fet_beginchar ("16th Mensural Flag (down)", "mensurald24");
250 draw_mensural_flag (anywhere, 2, dir_down);
254 % 32th mensural flag, upwards, between staff lines
255 fet_beginchar ("32th Mensural Flag (up)", "mensuralu05");
256 draw_mensural_flag (between_staff_lines, 3, dir_up);
260 % 32th mensural flag, upwards, on staff line
261 fet_beginchar ("32th Mensural Flag (up)", "mensuralu15");
262 draw_mensural_flag (on_staff_line, 3, dir_up);
266 % 32th mensural flag, upwards, anywhere
267 fet_beginchar ("32th Mensural Flag (up)", "mensuralu25");
268 draw_mensural_flag (anywhere, 3, dir_up);
272 % 32th mensural flag, downwards, between staff lines
273 fet_beginchar ("32th Mensural Flag (down)", "mensurald05");
274 draw_mensural_flag (between_staff_lines, 3, dir_down);
278 % 32th mensural flag, downwards, on staff line
279 fet_beginchar ("32th Mensural Flag (down)", "mensurald15");
280 draw_mensural_flag (on_staff_line, 3, dir_down);
284 % 32th mensural flag, downwards, anywhere
285 fet_beginchar ("32th Mensural Flag (down)", "mensurald25");
286 draw_mensural_flag (anywhere, 3, dir_down);
290 % 64th mensural flag, upwards, between staff lines
291 fet_beginchar ("64th Mensural Flag (up)", "mensuralu06");
292 draw_mensural_flag (between_staff_lines, 4, dir_up);
296 % 64th mensural flag, upwards, on staff line
297 fet_beginchar ("64th Mensural Flag (up)", "mensuralu16");
298 draw_mensural_flag (on_staff_line, 4, dir_up);
302 % 64th mensural flag, upwards, anywhere
303 fet_beginchar ("64th Mensural Flag (up)", "mensuralu26");
304 draw_mensural_flag (anywhere, 4, dir_up);
308 % 64th mensural flag, downwards, between staff lines
309 fet_beginchar ("64th Mensural Flag (down)", "mensurald06");
310 draw_mensural_flag (between_staff_lines, 4, dir_down);
314 % 64th mensural flag, downwards, on staff line
315 fet_beginchar ("64th Mensural Flag (down)", "mensurald16");
316 draw_mensural_flag (on_staff_line, 4, dir_down);
320 % 64th mensural flag, downwards, anywhere
321 fet_beginchar ("64th Mensural Flag (down)", "mensurald26");
322 draw_mensural_flag (anywhere, 4, dir_down);
326 fet_endgroup ("flags");