2 % parmesan-flags.mf -- implement ancient flags
4 % source file of LilyPond's pretty-but-neat music font
6 % (c) 2001--2004 Juergen Reuter <reuter@ipd.uka.de>
9 fet_begingroup ("flags")
11 save between_staff_lines, on_staff_line, anywhere;
12 between_staff_lines = 0;
16 save dir_up, dir_down;
30 def draw_mensural_outermost_flare (expr staffline_adjustment) =
31 define_pixels(linethickness, staff_space)
34 xscaled 1.00 linethickness
35 yscaled 0.22 staff_space
38 save za, zb, zc, zd, ze;
39 pair za, zb, zc, zd, ze;
41 za = (+0.00 staff_space, -0.00 staff_space);
42 zb = (+0.15 staff_space, -0.00 staff_space);
44 if staffline_adjustment = between_staff_lines:
45 zc = (+0.45 staff_space, -0.35 staff_space);
46 zd = (+0.45 staff_space, -0.85 staff_space);
47 ze = (+0.00 staff_space, -2.00 staff_space);
48 elseif staffline_adjustment = on_staff_line:
49 zc = (+0.20 staff_space, -0.05 staff_space);
50 zd = (+0.20 staff_space, -1.15 staff_space);
51 ze = (+0.00 staff_space, -1.40 staff_space);
52 else: % staffline_adjustment = anywhere
53 zc = (+0.33 staff_space, -0.20 staff_space);
54 zd = (+0.33 staff_space, -1.00 staff_space);
55 ze = (+0.00 staff_space, -1.70 staff_space);
58 draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
61 def draw_mensural_inner_flare(expr il_shift) =
62 define_pixels(linethickness, staff_space)
65 xscaled 1.00 linethickness
66 yscaled 0.22 staff_space
69 save zs, za, zb, zc, zd;
70 pair zs, za, zb, zc, zd;
72 zs = (0, -il_shift * staff_space);
73 za = zs + (+0.00 staff_space, -0.10 staff_space);
74 zb = zs + (+0.33 staff_space, -0.30 staff_space);
75 zc = zs + (+0.33 staff_space, -0.70 staff_space);
76 zd = zs + (+0.00 staff_space, -0.90 staff_space);
78 draw za{2,1} .. zb .. zc .. {-2,-1}zd;
81 def draw_mensural_flag (expr staffline_adjustment, flares, direction) =
82 save char_box_adjust, flare_shift;
83 if staffline_adjustment = between_staff_lines:
85 elseif staffline_adjustment = on_staff_line:
87 else: % staffline_adjustment = anywhere
90 char_box_adjust = flare_shift+0.5;
91 if direction = dir_up:
94 (flares+char_box_adjust)*staff_space#,
96 else: % direction = dir_down
97 set_char_box(0.60 staff_space#,
100 (flares+char_box_adjust)*staff_space#)
102 draw_mensural_outermost_flare (staffline_adjustment)
103 for flare_count := 2 step 1 until 4:
104 if flares >= flare_count:
105 draw_mensural_inner_flare(flare_shift+flare_count-0.5)
108 if direction = dir_down:
109 currentpicture := currentpicture xscaled -1 yscaled -1;
113 % 8th mensural flag, upwards, between staff lines
114 fet_beginchar("8th Mensural Flag (up)", "mensuralu03", "menseighthflag")
115 draw_mensural_flag (between_staff_lines, 1, dir_up)
118 % 8th mensural flag, upwards, on staff line
119 fet_beginchar("8th Mensural Flag (up)", "mensuralu13", "mens1eighthflag")
120 draw_mensural_flag (on_staff_line, 1, dir_up)
123 % 8th mensural flag, upwards, anywhere
124 fet_beginchar("8th Mensural Flag (up)", "mensuralu23", "mens1eighthflag")
125 draw_mensural_flag (anywhere, 1, dir_up)
128 % 8th mensural flag, downwards, between staff lines
129 fet_beginchar("8th Mensural Flag (down)", "mensurald03", "mensdeighthflag")
130 draw_mensural_flag (between_staff_lines, 1, dir_down)
133 % 8th mensural flag, downwards, on staff line
134 fet_beginchar("8th Mensural Flag (down)", "mensurald13", "mensd1eighthflag")
135 draw_mensural_flag (on_staff_line, 1, dir_down)
138 % 8th mensural flag, downwards, anywhere
139 fet_beginchar("8th Mensural Flag (down)", "mensurald23", "mensd1eighthflag")
140 draw_mensural_flag (anywhere, 1, dir_down)
143 % 16th mensural flag, upwards, between staff lines
144 fet_beginchar("16th Mensural Flag (up)", "mensuralu04", "menssixteenthflag")
145 draw_mensural_flag (between_staff_lines, 2, dir_up)
148 % 16th mensural flag, upwards, on staff line
149 fet_beginchar("16th Mensural Flag (up)", "mensuralu14", "mens1sixteenthflag")
150 draw_mensural_flag (on_staff_line, 2, dir_up)
153 % 16th mensural flag, upwards, anywhere
154 fet_beginchar("16th Mensural Flag (up)", "mensuralu24", "mens1sixteenthflag")
155 draw_mensural_flag (anywhere, 2, dir_up)
158 % 16th mensural flag, downwards, between staff lines
159 fet_beginchar("16th Mensural Flag (down)", "mensurald04", "mensdsixteenthflag")
160 draw_mensural_flag (between_staff_lines, 2, dir_down)
163 % 16th mensural flag, downwards, on staff line
164 fet_beginchar("16th Mensural Flag (down)", "mensurald14", "mensd1sixteenthflag")
165 draw_mensural_flag (on_staff_line, 2, dir_down)
168 % 16th mensural flag, downwards, anywhere
169 fet_beginchar("16th Mensural Flag (down)", "mensurald24", "mensd1sixteenthflag")
170 draw_mensural_flag (anywhere, 2, dir_down)
173 % 32th mensural flag, upwards, between staff lines
174 fet_beginchar("32th Mensural Flag (up)", "mensuralu05", "mensthirtysecondflag")
175 draw_mensural_flag (between_staff_lines, 3, dir_up)
178 % 32th mensural flag, upwards, on staff line
179 fet_beginchar("32th Mensural Flag (up)", "mensuralu15", "mens1thirtysecondflag")
180 draw_mensural_flag (on_staff_line, 3, dir_up)
183 % 32th mensural flag, upwards, anywhere
184 fet_beginchar("32th Mensural Flag (up)", "mensuralu25", "mens1thirtysecondflag")
185 draw_mensural_flag (anywhere, 3, dir_up)
188 % 32th mensural flag, downwards, between staff lines
189 fet_beginchar("32th Mensural Flag (down)", "mensurald05", "mensdthirtysecondflag")
190 draw_mensural_flag (between_staff_lines, 3, dir_down)
193 % 32th mensural flag, downwards, on staff line
194 fet_beginchar("32th Mensural Flag (down)", "mensurald15", "mensd1thirtysecondflag")
195 draw_mensural_flag (on_staff_line, 3, dir_down)
198 % 32th mensural flag, downwards, anywhere
199 fet_beginchar("32th Mensural Flag (down)", "mensurald25", "mensd1thirtysecondflag")
200 draw_mensural_flag (anywhere, 3, dir_down)
203 % 64th mensural flag, upwards, between staff lines
204 fet_beginchar("64th Mensural Flag (up)", "mensuralu06", "menssixtyfourthflag")
205 draw_mensural_flag (between_staff_lines, 4, dir_up)
208 % 64th mensural flag, upwards, on staff line
209 fet_beginchar("64th Mensural Flag (up)", "mensuralu16", "mens1sixtyfourthflag")
210 draw_mensural_flag (on_staff_line, 4, dir_up)
213 % 64th mensural flag, upwards, anywhere
214 fet_beginchar("64th Mensural Flag (up)", "mensuralu26", "mens1sixtyfourthflag")
215 draw_mensural_flag (anywhere, 4, dir_up)
218 % 64th mensural flag, downwards, between staff lines
219 fet_beginchar("64th Mensural Flag (down)", "mensurald06", "mensdsixtyfourthflag")
220 draw_mensural_flag (between_staff_lines, 4, dir_down)
223 % 64th mensural flag, downwards, on staff line
224 fet_beginchar("64th Mensural Flag (down)", "mensurald16", "mensd1sixtyfourthflag")
225 draw_mensural_flag (on_staff_line, 4, dir_down)
228 % 64th mensural flag, downwards, anywhere
229 fet_beginchar("64th Mensural Flag (down)", "mensurald26", "mensd1sixtyfourthflag")
230 draw_mensural_flag (anywhere, 4, dir_down)
233 fet_endgroup ("flags")