2 % parmesan-custodes.mf -- implement ancient custodes
4 % source file of LilyPond's pretty-but-neat music font
6 % (c) 2000--2003 Juergen Reuter <reuter@ipd.uka.de>
9 save black_notehead_width;
10 numeric black_notehead_width;
12 fet_begingroup ("custodes")
14 noteheight#:=staff_space#+ (1 + overdone_heads) *stafflinethickness#;
15 define_pixels(noteheight);
17 save between_staff_lines, on_staff_line, anywhere;
18 between_staff_lines = 0;
22 save dir_up, dir_down;
34 % parameterized hufnagel custos
35 def custos_hufnagel(expr verbose_name, internal_name, ly_name,
36 direction, staffline_adjustment) =
38 fet_beginchar(verbose_name, internal_name, ly_name)
39 save alpha, dalpha, ht, wd, stem_ht, pen_size;
43 dalpha# = direction*alpha#;
45 if staffline_adjustment = between_staff_lines:
46 stem_ht# = 1.00 staff_space#;
47 elseif staffline_adjustment = on_staff_line:
48 stem_ht# = 1.50 staff_space#;
49 else: % staffline_adjustment = anywhere
50 stem_ht# = 1.25 staff_space#;
52 pen_size# = 0.5*sqrt(wd#*wd#+ht#*ht#);
54 define_pixels(ht, wd, pen_size, stem_ht);
56 xscaled stafflinethickness
60 if direction = dir_up:
69 y3 - y2 = direction*stem_ht;
70 (y3 - y2) = (x3 - x2) * tand(90-dalpha#);
74 set_char_box(0, wd#, ht#/2, stem_ht#);
76 set_char_box(0, wd#, stem_ht#, ht#/2);
81 % custos hufnagel, stem up, between staff lines
82 custos_hufnagel("Custos Hufnagel", "hufnagel-u0", "hufnagelu0",
83 dir_up, between_staff_lines);
85 % custos hufnagel, stem up, on staff line
86 custos_hufnagel("Custos Hufnagel", "hufnagel-u1", "hufnagelu1",
87 dir_up, on_staff_line);
89 % custos hufnagel, stem up, anywhere
90 custos_hufnagel("Custos Hufnagel", "hufnagel-u2", "hufnagelu2",
93 % custos hufnagel, stem down, between staff lines
94 custos_hufnagel("Reverse Custos Hufnagel", "hufnagel-d0", "hufnageld0",
95 dir_down, between_staff_lines);
97 % custos hufnagel, stem down, on staff line
98 custos_hufnagel("Reverse Custos Hufnagel", "hufnagel-d1", "hufnageld1",
99 dir_down, on_staff_line);
101 % custos hufnagel, stem down, anywhere
102 custos_hufnagel("Reverse Custos Hufnagel", "hufnagel-d2", "hufnageld2",
112 def custos_medicaea(expr verbose_name, internal_name, ly_name,
113 direction, staffline_adjustment) =
115 fet_beginchar(verbose_name, internal_name, ly_name)
117 save ht, wd, stem_ht;
121 if staffline_adjustment = between_staff_lines:
122 stem_ht# = 1.00 staff_space#;
123 elseif staffline_adjustment = on_staff_line:
124 stem_ht# = 1.50 staff_space#;
125 else: % staffline_adjustment = anywhere
126 stem_ht# = 1.25 staff_space#;
129 define_pixels(ht, wd, stem_ht);
131 pickup pencircle xscaled 0.6stafflinethickness yscaled ht;
138 pickup pencircle scaled 0.6stafflinethickness;
142 y4 = direction*stem_ht;
146 set_char_box(0, wd#, ht#/2, stem_ht#);
148 set_char_box(0, wd#, stem_ht#, ht#/2);
153 % custos medicaea, stem up, between staff lines
154 custos_medicaea("Custos Med.", "medicaea-u0", "medicaeau0",
155 dir_up, between_staff_lines);
157 % custos medicaea, stem up, on staff line
158 custos_medicaea("Custos Med.", "medicaea-u1", "medicaeau1",
159 dir_up, on_staff_line);
161 % custos medicaea, stem up, anywhere
162 custos_medicaea("Custos Med.", "medicaea-u2", "medicaeau2",
165 % custos medicaea, stem down, between staff lines
166 custos_medicaea("Reverse Custos Med.", "medicaea-d0", "medicaead0",
167 dir_down, between_staff_lines);
169 % custos medicaea, stem down, on staff line
170 custos_medicaea("Reverse Custos Med.", "medicaea-d1", "medicaead1",
171 dir_down, on_staff_line);
173 % custos medicaea, stem down, anywhere
174 custos_medicaea("Reverse Custos Med.", "medicaea-d2", "medicaead2",
180 % Editio Vaticana style
184 def custos_vaticana(expr verbose_name, internal_name, ly_name,
185 direction, staffline_adjustment) =
187 fet_beginchar(verbose_name, internal_name, ly_name)
188 save ht, wd, u_offs, l_offs, stem_size, stem_end;
189 save pen_ht, l_shift, curve_ht, bend_ht;
193 if staffline_adjustment = between_staff_lines:
195 elseif staffline_adjustment = on_staff_line:
197 else: % staffline_adjustment = anywhere
203 u_offs# = +direction*0.5*(bend_ht#+l_shift#);
204 l_offs# = -direction*0.5*(bend_ht#-l_shift#);
205 stem_end# = direction*stem_size#*staff_space#;
206 pen_ht# = curve_ht#-l_shift#;
208 define_pixels(u_offs, l_offs, stem_end, ht, wd, pen_ht);
210 pickup pencircle scaled 0.6stafflinethickness;
212 z2 = (0.7wd, l_offs);
217 penstroke z1e{z2 - z1} .. {right}z2e .. z3e;
226 set_char_box(0, wd#, -l_offs#+0.5pen_ht#, stem_end#);
228 set_char_box(0, wd#, -stem_end#, +l_offs#+0.5pen_ht#);
234 % custos vaticana, stem up, between staff lines
235 custos_vaticana("Custos Ed. Vat.", "vaticana-u0", "vaticanau0",
236 dir_up, between_staff_lines);
238 % custos vaticana, stem up, on staff line
239 custos_vaticana("Custos Ed. Vat.", "vaticana-u1", "vaticanau1",
240 dir_up, on_staff_line);
242 % custos vaticana, stem up, anywhere
243 custos_vaticana("Custos Ed. Vat.", "vaticana-u2", "vaticanau2",
246 % custos vaticana, stem down, between staff lines
247 custos_vaticana("Reverse Custos Ed. Vat.", "vaticana-d0", "vaticanad0",
248 dir_down, between_staff_lines);
250 % custos vaticana, stem down, on_staff_line
251 custos_vaticana("Reverse Custos Ed. Vat.", "vaticana-d1", "vaticanad1",
252 dir_down, on_staff_line);
254 % custos vaticana, stem down, anywhere
255 custos_vaticana("Reverse Custos Ed. Vat.", "vaticana-d2", "vaticanad2",
265 def custos_mensural(expr verbose_name, internal_name, ly_name,
266 direction, staffline_adjustment) =
268 fet_beginchar(verbose_name, internal_name, ly_name)
269 save alpha, dalpha, ht, wd, stem_ht;
273 dalpha# = direction*alpha#;
275 if staffline_adjustment = between_staff_lines:
276 stem_ht# = 1.00 staff_space#;
277 elseif staffline_adjustment = on_staff_line:
278 stem_ht# = 1.50 staff_space#;
279 else: % staffline_adjustment = anywhere
280 stem_ht# = 1.25 staff_space#;
283 define_pixels(ht, wd, stem_ht);
285 xscaled stafflinethickness
290 bot y1 = bot y3 = bot y5 = -direction*0.33ht;
291 top y2 = top y4 = +direction*0.33ht;
293 top y1 = top y3 = top y5 = -direction*0.33ht;
294 bot y2 = bot y4 = +direction*0.33ht;
296 lft x1 = 0.0wd; lft x2 = 0.2wd; lft x3 = 0.4wd;
297 lft x4 = 0.6wd; lft x5 = 0.8wd;
298 y6 - y5 = direction*stem_ht;
299 (y6 - y5) = (x6 - x5) * tand(90-dalpha#);
301 draw z1 -- z2 -- z3 -- z4 -- z5 -- z6;
304 set_char_box(0, wd#, +direction*0.33ht#, stem_ht#);
306 set_char_box(0, wd#, stem_ht#, -direction*0.33ht#);
311 % custos mensural, stem up, between staff lines
312 custos_mensural("Custos Mensural", "mensural-u0", "mensuralu0",
313 dir_up, between_staff_lines);
315 % custos mensural, stem up, on staff line
316 custos_mensural("Custos Mensural", "mensural-u1", "mensuralu1",
317 dir_up, on_staff_line);
319 % custos mensural, stem up, anywhere
320 custos_mensural("Custos Mensural", "mensural-u2", "mensuralu2",
323 % custos mensural, stem down, between staff lines
324 custos_mensural("Reverse Custos Mensural", "mensural-d0", "mensurald0",
325 dir_down, between_staff_lines);
327 % custos mensural, stem down, on staff line
328 custos_mensural("Reverse Custos Mensural", "mensural-d1", "mensurald1",
329 dir_down, on_staff_line);
331 % custos mensural, stem down, anywhere
332 custos_mensural("Reverse Custos Mensural", "mensural-d2", "mensurald2",
335 fet_endgroup ("custodes")