1 % -%-Fundamental-%- -*-Metafont-*-
2 % parmesan-custodes.mf -- implement ancient custodes
4 % source file of LilyPond's pretty-but-neat music font
6 % (c) 2000--2006 Juergen Reuter <reuter@ipd.uka.de>
9 save black_notehead_width;
10 numeric black_notehead_width;
12 fet_begingroup ("custodes")
17 % The custos is assumed to be vertically centered around (0, 0).
18 % The left-most edge of the custos should touch the vertical line
19 % that goes though the point (0, 0).
21 % set_char_box() conventions:
23 % * breapth: Ignored (as far as I know). Should be set to 0.
25 % * width: Should cover the horizontal range of the custos that is to
26 % be printed in the staff. If the custos has an appendage that is
27 % supposed to reach beyond the right end of the staff, the width
28 % should be set such that the appendage is outside of the char box.
30 % * depth: Should match the bottom edge of the custos. Affects
31 % vertical collision handling.
33 % * height: Should match the top edge of the custos. Affects vertical
37 save between_staff_lines, on_staff_line, anywhere;
38 between_staff_lines = 0;
42 save dir_up, dir_down;
54 % parameterized hufnagel custos
55 def custos_hufnagel(expr verbose_name, internal_name,
56 direction, staffline_adjustment) =
58 fet_beginchar(verbose_name, internal_name)
59 save alpha, dalpha, ht, wd, stem_ht, pen_size;
63 dalpha# = direction*alpha#;
65 if staffline_adjustment = between_staff_lines:
66 stem_ht# = 1.00 staff_space#;
67 elseif staffline_adjustment = on_staff_line:
68 stem_ht# = 1.50 staff_space#;
69 else: % staffline_adjustment = anywhere
70 stem_ht# = 1.25 staff_space#;
72 pen_size# = 0.5*sqrt(wd#*wd#+ht#*ht#);
74 define_pixels(ht, wd, pen_size, stem_ht);
80 if direction = dir_up:
89 y3 - y2 = direction*stem_ht;
90 (y3 - y2) = (x3 - x2) * tand(90-dalpha#);
93 % The stem is intentionally outside of the char box.
95 set_char_box(0, wd#, ht#/2, stem_ht#);
97 set_char_box(0, wd#, stem_ht#, ht#/2);
102 % custos hufnagel, stem up, between staff lines
103 custos_hufnagel("Custos Hufnagel", "hufnagel.u0",
104 dir_up, between_staff_lines);
106 % custos hufnagel, stem up, on staff line
107 custos_hufnagel("Custos Hufnagel", "hufnagel.u1",
108 dir_up, on_staff_line);
110 % custos hufnagel, stem up, anywhere
111 custos_hufnagel("Custos Hufnagel", "hufnagel.u2",
114 % custos hufnagel, stem down, between staff lines
115 custos_hufnagel("Reverse Custos Hufnagel", "hufnagel.d0",
116 dir_down, between_staff_lines);
118 % custos hufnagel, stem down, on staff line
119 custos_hufnagel("Reverse Custos Hufnagel", "hufnagel.d1",
120 dir_down, on_staff_line);
122 % custos hufnagel, stem down, anywhere
123 custos_hufnagel("Reverse Custos Hufnagel", "hufnagel.d2",
133 def custos_medicaea(expr verbose_name, internal_name,
134 direction, staffline_adjustment) =
136 fet_beginchar(verbose_name, internal_name)
138 save ht, wd, stem_ht;
142 if staffline_adjustment = between_staff_lines:
143 stem_ht# = 1.00 staff_space#;
144 elseif staffline_adjustment = on_staff_line:
145 stem_ht# = 1.50 staff_space#;
146 else: % staffline_adjustment = anywhere
147 stem_ht# = 1.25 staff_space#;
150 define_pixels(ht, wd, stem_ht);
152 pickup pencircle xscaled 0.6linethickness yscaled ht;
159 pickup pencircle scaled 0.6linethickness;
163 y4 = direction*stem_ht;
167 set_char_box(0, wd#, ht#/2, stem_ht#);
169 set_char_box(0, wd#, stem_ht#, ht#/2);
174 % custos medicaea, stem up, between staff lines
175 custos_medicaea("Custos Med.", "medicaea.u0",
176 dir_up, between_staff_lines);
178 % custos medicaea, stem up, on staff line
179 custos_medicaea("Custos Med.", "medicaea.u1",
180 dir_up, on_staff_line);
182 % custos medicaea, stem up, anywhere
183 custos_medicaea("Custos Med.", "medicaea.u2",
186 % custos medicaea, stem down, between staff lines
187 custos_medicaea("Reverse Custos Med.", "medicaea.d0",
188 dir_down, between_staff_lines);
190 % custos medicaea, stem down, on staff line
191 custos_medicaea("Reverse Custos Med.", "medicaea.d1",
192 dir_down, on_staff_line);
194 % custos medicaea, stem down, anywhere
195 custos_medicaea("Reverse Custos Med.", "medicaea.d2",
201 % Editio Vaticana style
205 def custos_vaticana(expr verbose_name, internal_name,
206 direction, staffline_adjustment) =
208 fet_beginchar(verbose_name, internal_name)
209 save ht, wd, u_offs, l_offs, stem_size, stem_end;
210 save pen_ht, l_shift, curve_ht, bend_ht;
214 if staffline_adjustment = between_staff_lines:
216 elseif staffline_adjustment = on_staff_line:
218 else: % staffline_adjustment = anywhere
224 u_offs# = +direction*0.5*(bend_ht#+l_shift#);
225 l_offs# = -direction*0.5*(bend_ht#-l_shift#);
226 stem_end# = direction*stem_size#*staff_space#;
227 pen_ht# = curve_ht#-l_shift#;
229 define_pixels(u_offs, l_offs, stem_end, ht, wd, pen_ht);
231 pickup pencircle scaled 0.6linethickness;
233 z2 = (0.7wd, l_offs);
238 penstroke z1e{z2 - z1} .. {right}z2e .. z3e;
247 set_char_box(0, wd#, -l_offs#+0.5pen_ht#, stem_end#);
249 set_char_box(0, wd#, -stem_end#, +l_offs#+0.5pen_ht#);
255 % custos vaticana, stem up, between staff lines
256 custos_vaticana("Custos Ed. Vat.", "vaticana.u0",
257 dir_up, between_staff_lines);
259 % custos vaticana, stem up, on staff line
260 custos_vaticana("Custos Ed. Vat.", "vaticana.u1",
261 dir_up, on_staff_line);
263 % custos vaticana, stem up, anywhere
264 custos_vaticana("Custos Ed. Vat.", "vaticana.u2",
267 % custos vaticana, stem down, between staff lines
268 custos_vaticana("Reverse Custos Ed. Vat.", "vaticana.d0",
269 dir_down, between_staff_lines);
271 % custos vaticana, stem down, on_staff_line
272 custos_vaticana("Reverse Custos Ed. Vat.", "vaticana.d1",
273 dir_down, on_staff_line);
275 % custos vaticana, stem down, anywhere
276 custos_vaticana("Reverse Custos Ed. Vat.", "vaticana.d2",
286 def custos_mensural(expr verbose_name, internal_name,
287 direction, staffline_adjustment) =
289 fet_beginchar(verbose_name, internal_name)
290 save alpha, dalpha, ht, wd, stem_ht;
294 dalpha# = direction*alpha#;
296 if staffline_adjustment = between_staff_lines:
297 stem_ht# = 1.00 staff_space#;
298 elseif staffline_adjustment = on_staff_line:
299 stem_ht# = 1.50 staff_space#;
300 else: % staffline_adjustment = anywhere
301 stem_ht# = 1.25 staff_space#;
304 define_pixels(ht, wd, stem_ht);
306 xscaled linethickness
311 bot y1 = bot y3 = bot y5 = -direction*0.33ht;
312 top y2 = top y4 = +direction*0.33ht;
314 top y1 = top y3 = top y5 = -direction*0.33ht;
315 bot y2 = bot y4 = +direction*0.33ht;
317 lft x1 = 0.0wd; lft x2 = 0.2wd; lft x3 = 0.4wd;
318 lft x4 = 0.6wd; lft x5 = 0.8wd;
319 y6 - y5 = direction*stem_ht;
320 (y6 - y5) = (x6 - x5) * tand(90-dalpha#);
322 draw z1 -- z2 -- z3 -- z4 -- z5 -- z6;
324 % The stem is intentionally outside of the char box.
326 set_char_box(0, wd#, +direction*0.33ht#, stem_ht#);
328 set_char_box(0, wd#, stem_ht#, -direction*0.33ht#);
333 % custos mensural, stem up, between staff lines
334 custos_mensural("Custos Mensural", "mensural.u0",
335 dir_up, between_staff_lines);
337 % custos mensural, stem up, on staff line
338 custos_mensural("Custos Mensural", "mensural.u1",
339 dir_up, on_staff_line);
341 % custos mensural, stem up, anywhere
342 custos_mensural("Custos Mensural", "mensural.u2",
345 % custos mensural, stem down, between staff lines
346 custos_mensural("Reverse Custos Mensural", "mensural.d0",
347 dir_down, between_staff_lines);
349 % custos mensural, stem down, on staff line
350 custos_mensural("Reverse Custos Mensural", "mensural.d1",
351 dir_down, on_staff_line);
353 % custos mensural, stem down, anywhere
354 custos_mensural("Reverse Custos Mensural", "mensural.d2",
357 fet_endgroup ("custodes")