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--2014 Juergen Reuter <reuter@ipd.uka.de>
6 % The LilyPond font is free software: you can redistribute it and/or modify
7 % it under the terms of the GNU General Public License as published by
8 % the Free Software Foundation, either version 3 of the License, or
9 % (at your option) any later version, or under the SIL Open Font License.
11 % LilyPond is distributed in the hope that it will be useful,
12 % but WITHOUT ANY WARRANTY; without even the implied warranty of
13 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 % GNU General Public License for more details.
16 % You should have received a copy of the GNU General Public License
17 % along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
19 save black_notehead_width;
20 numeric black_notehead_width;
22 fet_begingroup ("custodes");
27 % The custos is assumed to be vertically centered around (0, 0).
28 % The left-most edge of the custos should touch the vertical line
29 % that goes though the point (0, 0).
31 % set_char_box() conventions:
33 % * breapth: Ignored (as far as I know). Should be set to 0.
35 % * width: Should cover the horizontal range of the custos that is to
36 % be printed in the staff. If the custos has an appendage that is
37 % supposed to reach beyond the right end of the staff, the width
38 % should be set such that the appendage is outside of the char box.
40 % * depth: Should match the bottom edge of the custos. Affects
41 % vertical collision handling.
43 % * height: Should match the top edge of the custos. Affects vertical
47 save between_staff_lines, on_staff_line, anywhere;
49 between_staff_lines := 0;
53 save dir_up, dir_down;
66 % parameterized hufnagel custos
67 def custos_hufnagel (expr verbose_name, internal_name,
68 direction, staffline_adjustment) =
70 fet_beginchar (verbose_name, internal_name);
71 save alpha, dalpha, ht, wd, stem_ht, pen_size;
76 dalpha = direction * alpha;
78 if staffline_adjustment = between_staff_lines:
79 stem_ht# = 1.00 staff_space#;
80 elseif staffline_adjustment = on_staff_line:
81 stem_ht# = 1.50 staff_space#;
82 else: % staffline_adjustment = anywhere
83 stem_ht# = 1.25 staff_space#;
86 pen_size# = 0.5 (wd# ++ ht#);
88 define_pixels (ht, wd, pen_size, stem_ht);
94 T := identity xscaled linethickness
97 pickup pencircle transformed T;
98 ellipse := fullcircle transformed T;
100 if direction = dir_up:
110 y3 - y2 = direction * stem_ht;
111 (y3 - y2) = (x3 - x2) * tand (90 - dalpha);
113 fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
115 -- get_subpath (ellipse, z2 - z1, z3 - z2, z2)
117 -- get_subpoint (ellipse, z2 - z1, z2)
118 -- get_subpoint (ellipse, z3 - z2, z2)
120 -- get_subpath (ellipse, z3 - z2, z2 - z3, z3)
122 -- get_subpoint (ellipse, z2 - z3, z2)
123 -- get_subpoint (ellipse, z1 - z2, z2)
125 -- get_subpath (ellipse, z2 - z3, z1 - z2, z2)
129 % The stem is intentionally outside of the char box.
131 set_char_box (0, wd#, ht# / 2, stem_ht#);
133 set_char_box (0, wd#, stem_ht#, ht# / 2);
141 % custos hufnagel, stem up, between staff lines
142 custos_hufnagel ("Custos Hufnagel", "hufnagel.u0",
143 dir_up, between_staff_lines);
146 % custos hufnagel, stem up, on staff line
147 custos_hufnagel ("Custos Hufnagel", "hufnagel.u1",
148 dir_up, on_staff_line);
151 % custos hufnagel, stem up, anywhere
152 custos_hufnagel ("Custos Hufnagel", "hufnagel.u2",
156 % custos hufnagel, stem down, between staff lines
157 custos_hufnagel ("Reverse Custos Hufnagel", "hufnagel.d0",
158 dir_down, between_staff_lines);
161 % custos hufnagel, stem down, on staff line
162 custos_hufnagel ("Reverse Custos Hufnagel", "hufnagel.d1",
163 dir_down, on_staff_line);
166 % custos hufnagel, stem down, anywhere
167 custos_hufnagel ("Reverse Custos Hufnagel", "hufnagel.d2",
178 def custos_medicaea (expr verbose_name, internal_name,
179 direction, staffline_adjustment) =
180 fet_beginchar (verbose_name, internal_name);
181 save ht, wd, stem_ht;
186 if staffline_adjustment = between_staff_lines:
187 stem_ht# = 1.00 staff_space#;
188 elseif staffline_adjustment = on_staff_line:
189 stem_ht# = 1.50 staff_space#;
190 else: % staffline_adjustment = anywhere
191 stem_ht# = 1.25 staff_space#;
194 define_pixels (ht, wd, stem_ht);
200 T := identity xscaled 0.6 linethickness
202 pickup pencircle transformed T;
203 ellipse := fullcircle transformed T;
210 fill get_subpath (ellipse, left, right, z1)
211 -- get_subpath (ellipse, right, left, z2)
214 pickup pencircle scaled 0.6 linethickness;
221 draw_rounded_block (bot lft z3, top rt z4,
225 draw_rounded_block (bot lft z4, top rt z3,
231 set_char_box (0, wd#, ht# / 2, stem_ht#);
233 set_char_box (0, wd#, stem_ht#, ht# / 2);
241 % custos medicaea, stem up, between staff lines
242 custos_medicaea ("Custos Med.", "medicaea.u0",
243 dir_up, between_staff_lines);
246 % custos medicaea, stem up, on staff line
247 custos_medicaea ("Custos Med.", "medicaea.u1",
248 dir_up, on_staff_line);
251 % custos medicaea, stem up, anywhere
252 custos_medicaea ("Custos Med.", "medicaea.u2",
256 % custos medicaea, stem down, between staff lines
257 custos_medicaea ("Reverse Custos Med.", "medicaea.d0",
258 dir_down, between_staff_lines);
261 % custos medicaea, stem down, on staff line
262 custos_medicaea ("Reverse Custos Med.", "medicaea.d1",
263 dir_down, on_staff_line);
266 % custos medicaea, stem down, anywhere
267 custos_medicaea ("Reverse Custos Med.", "medicaea.d2",
274 % Editio Vaticana style
278 def custos_vaticana (expr verbose_name, internal_name,
279 direction, staffline_adjustment) =
280 fet_beginchar (verbose_name, internal_name);
281 save ht, wd, u_offs, l_offs, stem_size, stem_end;
282 save pen_ht, l_shift, curve_ht, bend_ht;
287 if staffline_adjustment = between_staff_lines:
289 elseif staffline_adjustment = on_staff_line:
291 else: % staffline_adjustment = anywhere
298 u_offs# = +direction * 0.5 * (bend_ht# + l_shift#);
299 l_offs# = -direction * 0.5 * (bend_ht# - l_shift#);
300 stem_end# = direction * stem_size# * staff_space#;
301 pen_ht# = curve_ht# - l_shift#;
303 define_pixels (u_offs, l_offs, stem_end, ht, wd, pen_ht);
305 pickup pencircle scaled 0.6 linethickness;
308 z2 = (0.7 wd, l_offs);
311 penpos1 (pen_ht, 90);
312 penpos2 (pen_ht, 90);
313 penpos3 (pen_ht, 90);
315 penstroke z1e{z2 - z1}
325 draw_rounded_block (bot lft z4, top rt z5,
330 draw_rounded_block (bot lft z5, top rt z4,
335 set_char_box (0, wd#,
336 -l_offs# + 0.5 pen_ht#, stem_end#);
338 set_char_box (0, wd#,
339 -stem_end#, +l_offs# + 0.5 pen_ht#);
348 % custos vaticana, stem up, between staff lines
349 custos_vaticana ("Custos Ed. Vat.", "vaticana.u0",
350 dir_up, between_staff_lines);
353 % custos vaticana, stem up, on staff line
354 custos_vaticana ("Custos Ed. Vat.", "vaticana.u1",
355 dir_up, on_staff_line);
358 % custos vaticana, stem up, anywhere
359 custos_vaticana ("Custos Ed. Vat.", "vaticana.u2",
363 % custos vaticana, stem down, between staff lines
364 custos_vaticana ("Reverse Custos Ed. Vat.", "vaticana.d0",
365 dir_down, between_staff_lines);
368 % custos vaticana, stem down, on_staff_line
369 custos_vaticana ("Reverse Custos Ed. Vat.", "vaticana.d1",
370 dir_down, on_staff_line);
373 % custos vaticana, stem down, anywhere
374 custos_vaticana ("Reverse Custos Ed. Vat.", "vaticana.d2",
385 def custos_mensural (expr verbose_name, internal_name,
386 direction, staffline_adjustment) =
387 fet_beginchar (verbose_name, internal_name);
388 save alpha, dalpha, ht, wd, stem_ht;
393 dalpha = direction * alpha;
395 if staffline_adjustment = between_staff_lines:
396 stem_ht# = 2.00 staff_space#;
397 elseif staffline_adjustment = on_staff_line:
398 stem_ht# = 2.50 staff_space#;
399 else: % staffline_adjustment = anywhere
400 stem_ht# = 2.25 staff_space#;
403 define_pixels (ht, wd, stem_ht);
409 T := identity xscaled linethickness
412 pickup pencircle transformed T;
413 ellipse := fullcircle transformed T;
416 bot y1 = bot y3 = bot y5 = -direction * 0.33 ht;
417 top y2 = top y4 = +direction * 0.33 ht;
419 top y1 = top y3 = top y5 = -direction * 0.33 ht;
420 bot y2 = bot y4 = +direction * 0.33 ht;
429 y6 - y5 = direction * stem_ht;
430 y6 - y5 = (x6 - x5) * tand (90 - dalpha);
433 fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
434 -- get_subpoint (ellipse, z2 - z1, z2)
435 -- get_subpoint (ellipse, z3 - z2, z2)
436 -- get_subpath (ellipse, z3 - z2, z4 - z3, z3)
437 -- get_subpoint (ellipse, z4 - z3, z4)
438 -- get_subpoint (ellipse, z5 - z4, z4)
439 -- get_subpath (ellipse, z5 - z4, z6 - z5, z5)
440 -- get_subpath (ellipse, z6 - z5, z5 - z6, z6)
441 -- get_subpoint (ellipse, z5 - z6, z5)
442 -- get_subpoint (ellipse, z4 - z5, z5)
443 -- get_subpath (ellipse, z4 - z5, z3 - z4, z4)
444 -- get_subpoint (ellipse, z3 - z4, z3)
445 -- get_subpoint (ellipse, z2 - z3, z3)
446 -- get_subpath (ellipse, z2 - z3, z1 - z2, z2)
449 fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
450 -- get_subpath (ellipse, z2 -z1, z3 - z2, z2)
451 -- get_subpoint (ellipse, z3 - z2, z3)
452 -- get_subpoint (ellipse, z4 - z3, z3)
453 -- get_subpath (ellipse, z4 -z3, z5 - z4, z4)
454 -- get_subpoint (ellipse, z5 - z4, z5)
455 -- get_subpoint (ellipse, z6 - z5, z5)
456 -- get_subpath (ellipse, z6 - z5, z5 - z6, z6)
457 -- get_subpath (ellipse, z5 - z6, z4 - z5, z5)
458 -- get_subpoint (ellipse, z4 - z5, z4)
459 -- get_subpoint (ellipse, z3 - z4, z4)
460 -- get_subpath (ellipse, z3 - z4, z2 - z3, z3)
461 -- get_subpoint (ellipse, z2 - z3, z2)
462 -- get_subpoint (ellipse, z1 - z2, z2)
466 % The stem is intentionally outside of the char box.
468 set_char_box (0, wd#,
469 +direction * 0.33 ht#, stem_ht#);
471 set_char_box (0, wd#,
472 stem_ht#, -direction * 0.33 ht#);
475 labels (1, 2, 3, 4, 5, 6);
480 % custos mensural, stem up, between staff lines
481 custos_mensural ("Custos Mensural", "mensural.u0",
482 dir_up, between_staff_lines);
485 % custos mensural, stem up, on staff line
486 custos_mensural ("Custos Mensural", "mensural.u1",
487 dir_up, on_staff_line);
490 % custos mensural, stem up, anywhere
491 custos_mensural ("Custos Mensural", "mensural.u2",
495 % custos mensural, stem down, between staff lines
496 custos_mensural ("Reverse Custos Mensural", "mensural.d0",
497 dir_down, between_staff_lines);
500 % custos mensural, stem down, on staff line
501 custos_mensural ("Reverse Custos Mensural", "mensural.d1",
502 dir_down, on_staff_line);
505 % custos mensural, stem down, anywhere
506 custos_mensural ("Reverse Custos Mensural", "mensural.d2",
510 fet_endgroup ("custodes");