2 % parmesan-flags.mf -- implement ancient flags
4 % source file of LilyPond's pretty-but-neat music font
6 % (c) 2001--2002 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(stafflinethickness, staff_space)
34 xscaled 1.00 stafflinethickness
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(stafflinethickness, staff_space)
65 xscaled 1.00 stafflinethickness
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:
92 set_char_box(0, 0.60 staff_space#,
93 (1.00+char_box_adjust)*staff_space#, 0)
94 else: % direction = dir_down
95 set_char_box(0.60 staff_space#, 0,
96 (1.00+char_box_adjust)*staff_space#, 0)
98 draw_mensural_outermost_flare (staffline_adjustment)
99 for flare_count := 2 step 1 until 4:
100 if flares >= flare_count:
101 draw_mensural_inner_flare(flare_shift+flare_count-0.5)
104 if direction = dir_down:
105 currentpicture := currentpicture xscaled -1 yscaled -1;
109 % 8th mensural flag, upwards, between staff lines
110 fet_beginchar("8th Mensural Flag (up)", "mensuralu03", "menseighthflag")
111 draw_mensural_flag (between_staff_lines, 1, dir_up)
114 % 8th mensural flag, upwards, on staff line
115 fet_beginchar("8th Mensural Flag (up)", "mensuralu13", "mens1eighthflag")
116 draw_mensural_flag (on_staff_line, 1, dir_up)
119 % 8th mensural flag, upwards, anywhere
120 fet_beginchar("8th Mensural Flag (up)", "mensuralu23", "mens1eighthflag")
121 draw_mensural_flag (anywhere, 1, dir_up)
124 % 8th mensural flag, downwards, between staff lines
125 fet_beginchar("8th Mensural Flag (down)", "mensurald03", "mensdeighthflag")
126 draw_mensural_flag (between_staff_lines, 1, dir_down)
129 % 8th mensural flag, downwards, on staff line
130 fet_beginchar("8th Mensural Flag (down)", "mensurald13", "mensd1eighthflag")
131 draw_mensural_flag (on_staff_line, 1, dir_down)
134 % 8th mensural flag, downwards, anywhere
135 fet_beginchar("8th Mensural Flag (down)", "mensurald23", "mensd1eighthflag")
136 draw_mensural_flag (anywhere, 1, dir_down)
139 % 16th mensural flag, upwards, between staff lines
140 fet_beginchar("16th Mensural Flag (up)", "mensuralu04", "menssixteenthflag")
141 draw_mensural_flag (between_staff_lines, 2, dir_up)
144 % 16th mensural flag, upwards, on staff line
145 fet_beginchar("16th Mensural Flag (up)", "mensuralu14", "mens1sixteenthflag")
146 draw_mensural_flag (on_staff_line, 2, dir_up)
149 % 16th mensural flag, upwards, anywhere
150 fet_beginchar("16th Mensural Flag (up)", "mensuralu24", "mens1sixteenthflag")
151 draw_mensural_flag (anywhere, 2, dir_up)
154 % 16th mensural flag, downwards, between staff lines
155 fet_beginchar("16th Mensural Flag (down)", "mensurald04", "mensdsixteenthflag")
156 draw_mensural_flag (between_staff_lines, 2, dir_down)
159 % 16th mensural flag, downwards, on staff line
160 fet_beginchar("16th Mensural Flag (down)", "mensurald14", "mensd1sixteenthflag")
161 draw_mensural_flag (on_staff_line, 2, dir_down)
164 % 16th mensural flag, downwards, anywhere
165 fet_beginchar("16th Mensural Flag (down)", "mensurald24", "mensd1sixteenthflag")
166 draw_mensural_flag (anywhere, 2, dir_down)
169 % 32th mensural flag, upwards, between staff lines
170 fet_beginchar("32th Mensural Flag (up)", "mensuralu05", "mensthirtysecondflag")
171 draw_mensural_flag (between_staff_lines, 3, dir_up)
174 % 32th mensural flag, upwards, on staff line
175 fet_beginchar("32th Mensural Flag (up)", "mensuralu15", "mens1thirtysecondflag")
176 draw_mensural_flag (on_staff_line, 3, dir_up)
179 % 32th mensural flag, upwards, anywhere
180 fet_beginchar("32th Mensural Flag (up)", "mensuralu25", "mens1thirtysecondflag")
181 draw_mensural_flag (anywhere, 3, dir_up)
184 % 32th mensural flag, downwards, between staff lines
185 fet_beginchar("32th Mensural Flag (down)", "mensurald05", "mensdthirtysecondflag")
186 draw_mensural_flag (between_staff_lines, 3, dir_down)
189 % 32th mensural flag, downwards, on staff line
190 fet_beginchar("32th Mensural Flag (down)", "mensurald15", "mensd1thirtysecondflag")
191 draw_mensural_flag (on_staff_line, 3, dir_down)
194 % 32th mensural flag, downwards, anywhere
195 fet_beginchar("32th Mensural Flag (down)", "mensurald25", "mensd1thirtysecondflag")
196 draw_mensural_flag (anywhere, 3, dir_down)
199 % 64th mensural flag, upwards, between staff lines
200 fet_beginchar("64th Mensural Flag (up)", "mensuralu06", "menssixtyfourthflag")
201 draw_mensural_flag (between_staff_lines, 4, dir_up)
204 % 64th mensural flag, upwards, on staff line
205 fet_beginchar("64th Mensural Flag (up)", "mensuralu16", "mens1sixtyfourthflag")
206 draw_mensural_flag (on_staff_line, 4, dir_up)
209 % 64th mensural flag, upwards, anywhere
210 fet_beginchar("64th Mensural Flag (up)", "mensuralu26", "mens1sixtyfourthflag")
211 draw_mensural_flag (anywhere, 4, dir_up)
214 % 64th mensural flag, downwards, between staff lines
215 fet_beginchar("64th Mensural Flag (down)", "mensurald06", "mensdsixtyfourthflag")
216 draw_mensural_flag (between_staff_lines, 4, dir_down)
219 % 64th mensural flag, downwards, on staff line
220 fet_beginchar("64th Mensural Flag (down)", "mensurald16", "mensd1sixtyfourthflag")
221 draw_mensural_flag (on_staff_line, 4, dir_down)
224 % 64th mensural flag, downwards, anywhere
225 fet_beginchar("64th Mensural Flag (down)", "mensurald26", "mensd1sixtyfourthflag")
226 draw_mensural_flag (anywhere, 4, dir_down)
229 fet_endgroup ("flags")