1 % Feta (not the Font-En-Tja) music font -- ancient custodes
2 % This file is part of LilyPond, the GNU music typesetter.
4 % Copyright (C) 2000--2010 Juergen Reuter <reuter@ipd.uka.de>
7 % LilyPond is free software: you can redistribute it and/or modify
8 % it under the terms of the GNU General Public License as published by
9 % the Free Software Foundation, either version 3 of the License, or
10 % (at your option) any later version.
12 % LilyPond is distributed in the hope that it will be useful,
13 % but WITHOUT ANY WARRANTY; without even the implied warranty of
14 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 % GNU General Public License for more details.
17 % You should have received a copy of the GNU General Public License
18 % along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 save black_notehead_width;
21 numeric black_notehead_width;
23 fet_begingroup ("custodes");
28 % The custos is assumed to be vertically centered around (0, 0).
29 % The left-most edge of the custos should touch the vertical line
30 % that goes though the point (0, 0).
32 % set_char_box() conventions:
34 % * breapth: Ignored (as far as I know). Should be set to 0.
36 % * width: Should cover the horizontal range of the custos that is to
37 % be printed in the staff. If the custos has an appendage that is
38 % supposed to reach beyond the right end of the staff, the width
39 % should be set such that the appendage is outside of the char box.
41 % * depth: Should match the bottom edge of the custos. Affects
42 % vertical collision handling.
44 % * height: Should match the top edge of the custos. Affects vertical
48 save between_staff_lines, on_staff_line, anywhere;
50 between_staff_lines := 0;
54 save dir_up, dir_down;
67 % parameterized hufnagel custos
68 def custos_hufnagel (expr verbose_name, internal_name,
69 direction, staffline_adjustment) =
71 fet_beginchar (verbose_name, internal_name);
72 save alpha, dalpha, ht, wd, stem_ht, pen_size;
77 dalpha = direction * alpha;
79 if staffline_adjustment = between_staff_lines:
80 stem_ht# = 1.00 staff_space#;
81 elseif staffline_adjustment = on_staff_line:
82 stem_ht# = 1.50 staff_space#;
83 else: % staffline_adjustment = anywhere
84 stem_ht# = 1.25 staff_space#;
87 pen_size# = 0.5 (wd# ++ ht#);
89 define_pixels (ht, wd, pen_size, stem_ht);
95 T := identity xscaled linethickness
98 pickup pencircle transformed T;
99 ellipse := fullcircle transformed T;
101 if direction = dir_up:
111 y3 - y2 = direction * stem_ht;
112 (y3 - y2) = (x3 - x2) * tand (90 - dalpha);
114 fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
116 -- get_subpath (ellipse, z2 - z1, z3 - z2, z2)
118 -- get_subpoint (ellipse, z2 - z1, z2)
119 -- get_subpoint (ellipse, z3 - z2, z2)
121 -- get_subpath (ellipse, z3 - z2, z2 - z3, z3)
123 -- get_subpoint (ellipse, z2 - z3, z2)
124 -- get_subpoint (ellipse, z1 - z2, z2)
126 -- get_subpath (ellipse, z2 - z3, z1 - z2, z2)
130 % The stem is intentionally outside of the char box.
132 set_char_box (0, wd#, ht# / 2, stem_ht#);
134 set_char_box (0, wd#, stem_ht#, ht# / 2);
142 % custos hufnagel, stem up, between staff lines
143 custos_hufnagel ("Custos Hufnagel", "hufnagel.u0",
144 dir_up, between_staff_lines);
147 % custos hufnagel, stem up, on staff line
148 custos_hufnagel ("Custos Hufnagel", "hufnagel.u1",
149 dir_up, on_staff_line);
152 % custos hufnagel, stem up, anywhere
153 custos_hufnagel ("Custos Hufnagel", "hufnagel.u2",
157 % custos hufnagel, stem down, between staff lines
158 custos_hufnagel ("Reverse Custos Hufnagel", "hufnagel.d0",
159 dir_down, between_staff_lines);
162 % custos hufnagel, stem down, on staff line
163 custos_hufnagel ("Reverse Custos Hufnagel", "hufnagel.d1",
164 dir_down, on_staff_line);
167 % custos hufnagel, stem down, anywhere
168 custos_hufnagel ("Reverse Custos Hufnagel", "hufnagel.d2",
179 def custos_medicaea (expr verbose_name, internal_name,
180 direction, staffline_adjustment) =
181 fet_beginchar (verbose_name, internal_name);
182 save ht, wd, stem_ht;
187 if staffline_adjustment = between_staff_lines:
188 stem_ht# = 1.00 staff_space#;
189 elseif staffline_adjustment = on_staff_line:
190 stem_ht# = 1.50 staff_space#;
191 else: % staffline_adjustment = anywhere
192 stem_ht# = 1.25 staff_space#;
195 define_pixels (ht, wd, stem_ht);
201 T := identity xscaled 0.6 linethickness
203 pickup pencircle transformed T;
204 ellipse := fullcircle transformed T;
211 fill get_subpath (ellipse, left, right, z1)
212 -- get_subpath (ellipse, right, left, z2)
215 pickup pencircle scaled 0.6 linethickness;
222 draw_rounded_block (bot lft z3, top rt z4,
226 draw_rounded_block (bot lft z4, top rt z3,
232 set_char_box (0, wd#, ht# / 2, stem_ht#);
234 set_char_box (0, wd#, stem_ht#, ht# / 2);
242 % custos medicaea, stem up, between staff lines
243 custos_medicaea ("Custos Med.", "medicaea.u0",
244 dir_up, between_staff_lines);
247 % custos medicaea, stem up, on staff line
248 custos_medicaea ("Custos Med.", "medicaea.u1",
249 dir_up, on_staff_line);
252 % custos medicaea, stem up, anywhere
253 custos_medicaea ("Custos Med.", "medicaea.u2",
257 % custos medicaea, stem down, between staff lines
258 custos_medicaea ("Reverse Custos Med.", "medicaea.d0",
259 dir_down, between_staff_lines);
262 % custos medicaea, stem down, on staff line
263 custos_medicaea ("Reverse Custos Med.", "medicaea.d1",
264 dir_down, on_staff_line);
267 % custos medicaea, stem down, anywhere
268 custos_medicaea ("Reverse Custos Med.", "medicaea.d2",
275 % Editio Vaticana style
279 def custos_vaticana (expr verbose_name, internal_name,
280 direction, staffline_adjustment) =
281 fet_beginchar (verbose_name, internal_name);
282 save ht, wd, u_offs, l_offs, stem_size, stem_end;
283 save pen_ht, l_shift, curve_ht, bend_ht;
288 if staffline_adjustment = between_staff_lines:
290 elseif staffline_adjustment = on_staff_line:
292 else: % staffline_adjustment = anywhere
299 u_offs# = +direction * 0.5 * (bend_ht# + l_shift#);
300 l_offs# = -direction * 0.5 * (bend_ht# - l_shift#);
301 stem_end# = direction * stem_size# * staff_space#;
302 pen_ht# = curve_ht# - l_shift#;
304 define_pixels (u_offs, l_offs, stem_end, ht, wd, pen_ht);
306 pickup pencircle scaled 0.6 linethickness;
309 z2 = (0.7 wd, l_offs);
312 penpos1 (pen_ht, 90);
313 penpos2 (pen_ht, 90);
314 penpos3 (pen_ht, 90);
316 penstroke z1e{z2 - z1}
326 draw_rounded_block (bot lft z4, top rt z5,
331 draw_rounded_block (bot lft z5, top rt z4,
336 set_char_box (0, wd#,
337 -l_offs# + 0.5 pen_ht#, stem_end#);
339 set_char_box (0, wd#,
340 -stem_end#, +l_offs# + 0.5 pen_ht#);
349 % custos vaticana, stem up, between staff lines
350 custos_vaticana ("Custos Ed. Vat.", "vaticana.u0",
351 dir_up, between_staff_lines);
354 % custos vaticana, stem up, on staff line
355 custos_vaticana ("Custos Ed. Vat.", "vaticana.u1",
356 dir_up, on_staff_line);
359 % custos vaticana, stem up, anywhere
360 custos_vaticana ("Custos Ed. Vat.", "vaticana.u2",
364 % custos vaticana, stem down, between staff lines
365 custos_vaticana ("Reverse Custos Ed. Vat.", "vaticana.d0",
366 dir_down, between_staff_lines);
369 % custos vaticana, stem down, on_staff_line
370 custos_vaticana ("Reverse Custos Ed. Vat.", "vaticana.d1",
371 dir_down, on_staff_line);
374 % custos vaticana, stem down, anywhere
375 custos_vaticana ("Reverse Custos Ed. Vat.", "vaticana.d2",
386 def custos_mensural (expr verbose_name, internal_name,
387 direction, staffline_adjustment) =
388 fet_beginchar (verbose_name, internal_name);
389 save alpha, dalpha, ht, wd, stem_ht;
394 dalpha = direction * alpha;
396 if staffline_adjustment = between_staff_lines:
397 stem_ht# = 1.00 staff_space#;
398 elseif staffline_adjustment = on_staff_line:
399 stem_ht# = 1.50 staff_space#;
400 else: % staffline_adjustment = anywhere
401 stem_ht# = 1.25 staff_space#;
404 define_pixels (ht, wd, stem_ht);
410 T := identity xscaled linethickness
413 pickup pencircle transformed T;
414 ellipse := fullcircle transformed T;
417 bot y1 = bot y3 = bot y5 = -direction * 0.33 ht;
418 top y2 = top y4 = +direction * 0.33 ht;
420 top y1 = top y3 = top y5 = -direction * 0.33 ht;
421 bot y2 = bot y4 = +direction * 0.33 ht;
430 y6 - y5 = direction * stem_ht;
431 y6 - y5 = (x6 - x5) * tand (90 - dalpha);
434 fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
435 -- get_subpoint (ellipse, z2 - z1, z2)
436 -- get_subpoint (ellipse, z3 - z2, z2)
437 -- get_subpath (ellipse, z3 - z2, z4 - z3, z3)
438 -- get_subpoint (ellipse, z4 - z3, z4)
439 -- get_subpoint (ellipse, z5 - z4, z4)
440 -- get_subpath (ellipse, z5 - z4, z6 - z5, z5)
441 -- get_subpath (ellipse, z6 - z5, z5 - z6, z6)
442 -- get_subpoint (ellipse, z5 - z6, z5)
443 -- get_subpoint (ellipse, z4 - z5, z5)
444 -- get_subpath (ellipse, z4 - z5, z3 - z4, z4)
445 -- get_subpoint (ellipse, z3 - z4, z3)
446 -- get_subpoint (ellipse, z2 - z3, z3)
447 -- get_subpath (ellipse, z2 - z3, z1 - z2, z2)
450 fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
451 -- get_subpath (ellipse, z2 -z1, z3 - z2, z2)
452 -- get_subpoint (ellipse, z3 - z2, z3)
453 -- get_subpoint (ellipse, z4 - z3, z3)
454 -- get_subpath (ellipse, z4 -z3, z5 - z4, z4)
455 -- get_subpoint (ellipse, z5 - z4, z5)
456 -- get_subpoint (ellipse, z6 - z5, z5)
457 -- get_subpath (ellipse, z6 - z5, z5 - z6, z6)
458 -- get_subpath (ellipse, z5 - z6, z4 - z5, z5)
459 -- get_subpoint (ellipse, z4 - z5, z4)
460 -- get_subpoint (ellipse, z3 - z4, z4)
461 -- get_subpath (ellipse, z3 - z4, z2 - z3, z3)
462 -- get_subpoint (ellipse, z2 - z3, z2)
463 -- get_subpoint (ellipse, z1 - z2, z2)
467 % The stem is intentionally outside of the char box.
469 set_char_box (0, wd#,
470 +direction * 0.33 ht#, stem_ht#);
472 set_char_box (0, wd#,
473 stem_ht#, -direction * 0.33 ht#);
476 labels (1, 2, 3, 4, 5, 6);
481 % custos mensural, stem up, between staff lines
482 custos_mensural ("Custos Mensural", "mensural.u0",
483 dir_up, between_staff_lines);
486 % custos mensural, stem up, on staff line
487 custos_mensural ("Custos Mensural", "mensural.u1",
488 dir_up, on_staff_line);
491 % custos mensural, stem up, anywhere
492 custos_mensural ("Custos Mensural", "mensural.u2",
496 % custos mensural, stem down, between staff lines
497 custos_mensural ("Reverse Custos Mensural", "mensural.d0",
498 dir_down, between_staff_lines);
501 % custos mensural, stem down, on staff line
502 custos_mensural ("Reverse Custos Mensural", "mensural.d1",
503 dir_down, on_staff_line);
506 % custos mensural, stem down, anywhere
507 custos_mensural ("Reverse Custos Mensural", "mensural.d2",
511 fet_endgroup ("custodes");