1 % Feta (not the Font-En-Tja) music font -- ancient note heads
2 % This file is part of LilyPond, the GNU music typesetter.
4 % Copyright (C) 2001--2011 Juergen Reuter <reuter@ipd.uka.de>
6 % Neo-mensural heads originally by
7 % Christian Mondrup and Mats Bengtsson
9 % LilyPond is free software: you can redistribute it and/or modify
10 % it under the terms of the GNU General Public License as published by
11 % the Free Software Foundation, either version 3 of the License, or
12 % (at your option) any later version.
14 % LilyPond is distributed in the hope that it will be useful,
15 % but WITHOUT ANY WARRANTY; without even the implied warranty of
16 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 % GNU General Public License for more details.
19 % You should have received a copy of the GNU General Public License
20 % along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
22 save black_notehead_width;
23 numeric black_notehead_width;
25 fet_begingroup ("noteheads");
30 % The head is assumed to be vertically centered around (0, 0).
31 % The left-most edge of the head should touch the vertical line
32 % that goes though the point (0, 0).
34 % set_char_box() conventions:
36 % * breapth: Ignored (as far as I know). Should be set to 0.
38 % * width: Should match the head's width.
40 % * depth: Should match the bottom edge of the head. Affects vertical
43 % * height: Should match the top edge of the head. Affects vertical
46 % TODO: should depth/height include appendages/stems?
48 save overdone_heads, noteheight;
51 noteheight# := staff_space# + (1 + overdone_heads) * stafflinethickness#;
52 define_pixels (noteheight);
59 % NEO-MENSURAL NOTATION
64 def draw_neomensural_brevis (expr brevwid, holeheight, open, full) =
65 save beamheight, head_width, head_height;
66 save stem_width, serif_size, serif_protrude;
68 head_width# := brevwid;
69 head_height# := noteheight#;
70 stem_width := 1.3 linethickness;
72 define_pixels (head_width, head_height);
74 set_char_box (0, head_width#,
75 head_height# / 2, head_height# / 2);
77 2 beamheight + holeheight = head_height;
78 serif_size := .75 linethickness;
79 serif_protrude := .15 head_height;
82 z2l = (0, - (holeheight - 2 serif_size) / 2);
83 z3r = z2r + serif_size * (1, -1);
86 z5l = z3l + (-serif_size, -serif_protrude);
88 penpos1 (stem_width, 0);
89 penpos2 (stem_width, 0);
90 penpos3 (beamheight, 90);
91 penpos4 (beamheight, 90);
92 penpos5 (stem_width, 180);
103 -- reverse pat_out yscaled -1;
105 -- reverse pat_out shifted (-x4r, 0)
120 -- reverse pat_in yscaled -1;
123 -- reverse pat_in shifted (-x4r, 0)
132 penlabels (1, 2, 3, 4, 5);
137 % Some sources (eg. Musix/OpusTeX) think that the appendage should be on
138 % the left, some say right. Right wins democratically.
140 def draw_neomensural_longa (expr wid, holeheight, direction) =
141 draw_neomensural_brevis (wid, holeheight, true, true);
146 x7 = head_width - stem_width / 2;
148 z6 - z7 = (stem_width / 2, -dir * staff_space);
149 theta = dir * angle (z6 - z7) + 90;
151 penpos7 (stem_width, 0);
152 penpos6 (1.2 stem_width, theta);
154 z7' = find_tangent (z6l, pat_out,
155 (x7l + 0.5 stem_width, y7l),
156 (x7l - 0.5 stem_width, y7l));
169 def draw_neomensural_black_head (expr wid, height) =
170 save head_height, head_width, stem_width;
171 save ne, nw, ne_dist, nw_dist, penthickness;
172 pair ne, nw, ne_dist, nw_dist;
174 penthickness# = linethickness#;
175 head_height# := height + penthickness#;
176 head_width# := wid + penthickness#;
177 stem_width# := 1.3 linethickness#;
179 set_char_box (0, head_width#,
180 head_height# / 2, head_height# / 2);
182 charwx := head_width# / 2;
183 charwy := head_height# / 2 - 2 stem_width#;
185 define_pixels (penthickness);
188 x2 = x4 = 1/2 [x1, x3];
190 pickup pencircle scaled penthickness;
197 ne := unitvector (z2 - z1);
198 nw_dist := (ne rotated 90) * penthickness / 2;
199 nw := unitvector (z2 - z3);
200 ne_dist := (nw rotated -90) * penthickness / 2;
220 def draw_neomensural_open_head (expr wid, height)=
221 draw_neomensural_black_head (wid, height);
223 save headNW, headSW, stem_width;
225 headNW = length (z2 - z1) + penthickness;
226 headSW = length (z4 - z1) + penthickness;
227 stem_width = 1.3 linethickness;
229 save hole_widthNW, hole_widthSW;
231 hole_widthNW = .25 headNW;
232 hole_widthSW + 2 stem_width = headSW;
234 (rt z7 + lft z5) / 2 = (w / 2, 0);
235 (bot z8 + top z6) / 2 = (w / 2, 0);
236 z6 - z5 = (hole_widthNW - penthickness) * unitvector (z2 - z1);
237 z7 - z6 = (hole_widthSW - penthickness) * unitvector (z4 - z1);
258 % Neo-mensural maxima/longa/brevis
260 % En wij presenteren U: de opvolgster van Emily
265 save nm_maxima_width, nm_longa_width, nm_brevis_width;
266 save nm_holeheight, nm_red_holeheight;
268 nm_maxima_width := 2.6 staff_space#;
269 nm_longa_width := 2 staff_space#;
270 nm_brevis_width := nm_longa_width;
271 nm_holeheight := 4 linethickness;
272 nm_red_holeheight := 2.5 linethickness;
274 fet_beginchar ("Neo-mensural maxima notehead (up)", "uM3neomensural");
275 draw_neomensural_longa (nm_maxima_width, nm_holeheight, 1);
278 fet_beginchar ("Neo-mensural maxima notehead (down)", "dM3neomensural");
279 draw_neomensural_longa (nm_maxima_width, nm_holeheight, -1);
282 fet_beginchar ("Neo-mensural longa notehead (up)", "uM2neomensural");
283 draw_neomensural_longa (nm_longa_width, nm_holeheight, 1);
286 fet_beginchar ("Neo-mensural longa notehead (down)", "dM2neomensural");
287 draw_neomensural_longa (nm_longa_width, nm_holeheight, -1);
290 fet_beginchar ("Neo-mensural brevis notehead", "sM1neomensural");
291 draw_neomensural_brevis (nm_brevis_width, nm_holeheight, true, true);
294 fet_beginchar ("Neo-mensural maxima notehead (up, reduced hole)", "urM3neomensural");
295 draw_neomensural_longa (nm_maxima_width, nm_red_holeheight, 1);
298 fet_beginchar ("Neo-mensural maxima notehead (down, reduced hole)", "drM3neomensural");
299 draw_neomensural_longa (nm_maxima_width, nm_red_holeheight, -1);
302 fet_beginchar ("Neo-mensural longa notehead (up, reduced hole)", "urM2neomensural");
303 draw_neomensural_longa (nm_longa_width, nm_red_holeheight, 1);
306 fet_beginchar ("Neo-mensural longa notehead (down, reduced hole)", "drM2neomensural");
307 draw_neomensural_longa (nm_longa_width, nm_red_holeheight, -1);
310 fet_beginchar ("Neo-mensural brevis notehead (reduced hole)", "srM1neomensural");
311 draw_neomensural_brevis (nm_brevis_width, nm_red_holeheight, true, true);
316 % Neo-mensural semibrevis/minima/semiminima
319 save nm_height, nm_width;
320 nm_height := noteheight#;
321 nm_width := staff_space#;
322 fet_beginchar ("Neo-mensural semibrevis head", "s0neomensural");
323 draw_neomensural_open_head (nm_width, nm_height);
326 fet_beginchar ("Neo-mensural minima head", "s1neomensural");
327 draw_neomensural_open_head (nm_width, nm_height);
330 fet_beginchar ("Neo-mensural semiminima head", "s2neomensural");
331 draw_neomensural_black_head (nm_width, nm_height);
344 % WL says the thin lines should be thinner.
347 fet_beginchar ("Harmonic notehead (Neo-mensural open)", "s0harmonic");
348 draw_neomensural_open_head (1.3 staff_space#, 1.3 noteheight#);
349 charwx := head_width#;
353 fet_beginchar ("Harmonic notehead (Neo-mensural black)", "s2harmonic");
354 draw_neomensural_black_head (1.3 staff_space#, 1.3 noteheight#);
355 charwx := head_width#;
364 % MENSURAL/PETRUCCI NOTATIONS
369 def draw_mensural_brevis (expr wid, holeheight, open, full) =
370 % TODO. For the moment, fall back to draw_neomensural_brevis.
371 draw_neomensural_brevis (wid, holeheight, open, full);
375 def draw_mensural_longa (expr wid, holeheight, open, full, direction) =
376 draw_mensural_brevis (wid, holeheight, open, full);
381 x6 = x7 = head_width - stem_width / 2;
383 y7 = dir * y5 -1.75 dir * staff_space;
385 z17 = (x7, y7 - dir * stem_width / 2);
387 penpos6 (stem_width, 0);
388 penpos7 (1.5 stem_width, 0);
402 def draw_diamond_head (expr head_h, pen_w, pen_h, angle, open) =
403 save head_width, head_height;
404 save ellipse, ellipse_r;
405 path ellipse, ellipse_r, diamond_shape;
407 head_height# = head_h;
408 head_width# / head_height# = tand (angle);
410 set_char_box (0, head_width#,
411 head_height# / 2, head_height# / 2);
413 charwx := head_width# / 2;
414 charwy := head_height# / 2 - 2 linethickness#;
416 define_pixels (head_width, head_height);
418 ellipse := reverse fullcircle
419 xscaled (max (blot_diameter, pen_w * head_width))
420 yscaled (max (blot_diameter, pen_h * head_width))
423 z1 = find_tangent_shift (((0, h) -- (0, -h)), ellipse,
425 z2 = find_tangent_shift (((0, h) -- (w, h)), ellipse,
426 (w / 2, h), (w / 2, 0));
427 z3 = find_tangent_shift (((w, h) -- (w, -h)), ellipse,
429 z4 = find_tangent_shift (((0, -h) -- (w, -h)), ellipse,
430 (w / 2, -h), (w / 2, 0));
432 diamond_shape := get_subpath (ellipse, z1 - z4, z2 - z1, z1)
433 -- get_subpath (ellipse, z2 - z1, z3 - z2, z2)
434 -- get_subpath (ellipse, z3 - z2, z4 - z3, z3)
435 -- get_subpath (ellipse, z4 - z3, z1 - z4, z4)
443 l12 := (directionpoint (z1 - z2) of ellipse) shifted z1
444 -- (directionpoint (z1 - z2) of ellipse) shifted z2;
445 l23 := (directionpoint (z2 - z3) of ellipse) shifted z2
446 -- (directionpoint (z2 - z3) of ellipse) shifted z3;
447 l34 := (directionpoint (z3 - z4) of ellipse) shifted z3
448 -- (directionpoint (z3 - z4) of ellipse) shifted z4;
449 l41 := (directionpoint (z4 - z1) of ellipse) shifted z4
450 -- (directionpoint (z4 - z1) of ellipse) shifted z1;
452 unfill l12 intersectionpoint l23
453 -- l23 intersectionpoint l34
454 -- l34 intersectionpoint l41
455 -- l41 intersectionpoint l12
464 % Mensural/Petrucci maxima/longa/brevis
467 save m_maxima_width, m_longa_width, m_brevis_width,
468 m_holeheight, m_red_holeheight;
469 m_maxima_width := 2.0 staff_space#;
470 m_longa_width := staff_space#;
471 m_brevis_width := m_longa_width;
472 m_holeheight := nm_holeheight;
473 m_red_holeheight := nm_red_holeheight;
475 fet_beginchar ("Mensural maxima notehead (up)", "uM3mensural");
476 draw_mensural_longa (m_maxima_width, m_holeheight, true, true, 1);
479 fet_beginchar ("Mensural maxima notehead (down)", "dM3mensural");
480 draw_mensural_longa (m_maxima_width, m_holeheight, true, true, -1);
483 fet_beginchar ("Mensural maxima notehead (ligature)", "sM3ligmensural");
484 draw_mensural_brevis (m_maxima_width, m_holeheight, true, true);
487 fet_beginchar ("Mensural longa notehead (up)", "uM2mensural");
488 draw_mensural_longa (m_longa_width, m_holeheight, true, true, 1);
491 fet_beginchar ("Mensural longa notehead (down)", "dM2mensural");
492 draw_mensural_longa (m_longa_width, m_holeheight, true, true, -1);
495 fet_beginchar ("Mensural brevis notehead", "sM1mensural");
496 draw_mensural_brevis (m_brevis_width, m_holeheight, true, true);
499 fet_beginchar ("Mensural maxima notehead (up, reduced hole)", "urM3mensural");
500 draw_mensural_longa (m_maxima_width, m_red_holeheight, true, true, 1);
503 fet_beginchar ("Mensural maxima notehead (down, reduced hole)", "drM3mensural");
504 draw_mensural_longa (m_maxima_width, m_red_holeheight, true, true, -1);
507 fet_beginchar ("Mensural maxima notehead (ligature, reduced hole)", "srM3ligmensural");
508 draw_mensural_brevis (m_maxima_width, m_red_holeheight, true, true);
511 fet_beginchar ("Mensural longa notehead (up, reduced hole)", "urM2mensural");
512 draw_mensural_longa (m_longa_width, m_red_holeheight, true, true, 1);
515 fet_beginchar ("Mensural longa notehead (down, reduced hole)", "drM2mensural");
516 draw_mensural_longa (m_longa_width, m_red_holeheight, true, true, -1);
519 fet_beginchar ("Mensural brevis notehead (reduced hole)", "srM1mensural");
520 draw_mensural_brevis (m_brevis_width, m_red_holeheight, true, true);
525 % Semi-colored mensural/Petrucci maxima/longa/brevis
528 fet_beginchar ("Semi-colored mensural maxima notehead (up)", "uM3semimensural");
529 draw_mensural_longa (m_maxima_width, m_holeheight, true, false, 1);
532 fet_beginchar ("Semi-colored mensural maxima notehead (down)", "dM3semimensural");
533 draw_mensural_longa (m_maxima_width, m_holeheight, true, false, -1);
536 fet_beginchar ("Semi-colored mensural maxima notehead (ligature)", "sM3semiligmensural");
537 draw_mensural_brevis (m_maxima_width, m_holeheight, true, false);
540 fet_beginchar ("Semi-colored mensural longa notehead (up)", "uM2semimensural");
541 draw_mensural_longa (m_longa_width, m_holeheight, true, false, 1);
544 fet_beginchar ("Semi-colored mensural longa notehead (down)", "dM2semimensural");
545 draw_mensural_longa (m_longa_width, m_holeheight, true, false, -1);
548 fet_beginchar ("Semi-colored mensural brevis notehead", "sM1semimensural");
549 draw_mensural_brevis (m_brevis_width, m_holeheight, true, false);
552 fet_beginchar ("Semi-colored mensural maxima notehead (up, reduced hole)", "urM3semimensural");
553 draw_mensural_longa (m_maxima_width, m_red_holeheight, true, false, 1);
556 fet_beginchar ("Semi-colored mensural maxima notehead (down, reduced hole)", "drM3semimensural");
557 draw_mensural_longa (m_maxima_width, m_red_holeheight, true, false, -1);
560 fet_beginchar ("Semi-colored mensural maxima notehead (ligature, reduced hole)", "srM3semiligmensural");
561 draw_mensural_brevis (m_maxima_width, m_red_holeheight, true, false);
564 fet_beginchar ("Semi-colored mensural longa notehead (up, reduced hole)", "urM2semimensural");
565 draw_mensural_longa (m_longa_width, m_red_holeheight, true, false, 1);
568 fet_beginchar ("Semi-colored mensural longa notehead (down, reduced hole)", "drM2semimensural");
569 draw_mensural_longa (m_longa_width, m_red_holeheight, true, false, -1);
572 fet_beginchar ("Semi-colored mensural brevis notehead (reduced hole)", "srM1semimensural");
573 draw_mensural_brevis (m_brevis_width, m_red_holeheight, true, false);
578 % Black mensural/Petrucci maxima/longa/brevis
581 fet_beginchar ("Black mensural maxima notehead (up)", "uM3blackmensural");
582 draw_mensural_longa (m_maxima_width, 0, false, false, 1);
585 fet_beginchar ("Black mensural maxima notehead (down)", "dM3blackmensural");
586 draw_mensural_longa (m_maxima_width, 0, false, false, -1);
589 fet_beginchar ("Black mensural maxima notehead (ligature)", "sM3blackligmensural");
590 draw_mensural_brevis (m_maxima_width, 0, false, false);
593 fet_beginchar ("Black mensural longa notehead (up)", "uM2blackmensural");
594 draw_mensural_longa (m_longa_width, 0, false, false, 1);
597 fet_beginchar ("Black mensural longa notehead (down)", "dM2blackmensural");
598 draw_mensural_longa (m_longa_width, 0, false, false, -1);
601 fet_beginchar ("Black mensural brevis notehead", "sM1blackmensural");
602 draw_mensural_brevis (m_brevis_width, 0, false, false);
607 % Mensural semibrevis/minima/semiminima
610 fet_beginchar ("Mensural semibrevis head", "s0mensural");
611 draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
614 fet_beginchar ("Mensural minima head", "s1mensural");
615 draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
618 fet_beginchar ("Mensural semiminima head", "s2mensural");
619 draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
624 % Black mensural semibrevis/minima/semiminima
627 fet_beginchar ("Black mensural semibrevis head", "s0blackmensural");
628 draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
633 % Petrucci semibrevis/minima/semiminima
635 % These values can be measured in several sources.
636 % I used "Modulis ex sacris literis delecti, Liber primus"
637 % Josquin Desprez, BNF
639 save petrucci_width, petrucci_height;
640 petrucci_height := 1.3 noteheight#;
641 petrucci_width := .72 petrucci_height;
643 fet_beginchar ("Petrucci semibrevis head", "s0petrucci");
644 draw_neomensural_open_head (petrucci_width, petrucci_height);
647 fet_beginchar ("Petrucci minima head", "s1petrucci");
648 draw_neomensural_open_head (petrucci_width, petrucci_height);
651 fet_beginchar ("Petrucci semiminima head", "s2petrucci");
652 draw_neomensural_black_head (petrucci_width, petrucci_height);
657 % Black Petrucci semibrevis/minima/semiminima
660 fet_beginchar ("Petrucci colored semibrevis head", "s0blackpetrucci");
661 draw_neomensural_black_head (petrucci_width, petrucci_height);
664 fet_beginchar ("Petrucci colored minima head", "s1blackpetrucci");
665 draw_neomensural_black_head (petrucci_width, petrucci_height);
668 fet_beginchar ("Petrucci colored semiminima head", "s2blackpetrucci");
669 draw_neomensural_black_head (petrucci_width, petrucci_height);
677 % EDITIO VATICANA (including solesmes extensions)
682 def vat_punctum_char (expr verbose_name, internal_name,
683 linea, cavum, straight, auctum,
684 d_up, up_shift, down_shift, mag) =
685 fet_beginchar (verbose_name, "s" & internal_name);
688 a_b := 1.54; % b_h * a_b / a_w = wd / ht
692 save a, beta, ht, wd;
694 ht# = noteheight# * mag;
698 black_notehead_width# := wd#;
712 % convexity and eccentricity
713 save u_convexity, u_eccentricity;
716 u_convexity# := -0.01 ht#;
717 u_eccentricity# := 0.0 ht#; % dummy
719 u_convexity# := -0.03 ht#;
720 u_eccentricity# := +0.25 ht#;
722 u_convexity# := -0.05 ht#;
723 u_eccentricity# := 0.0 ht#; % dummy
726 save convexity, eccentricity;
728 convexity# := d_sign * u_convexity#;
729 eccentricity# := d_sign * u_eccentricity#;
742 define_pixels (convexity, eccentricity, yoffs, ht, wd);
744 pickup pencircle scaled linethickness;
746 save height, yoffs_bt, p, circle, circle_r;
747 path p, circle, circle_r;
750 yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
752 define_pixels (height, yoffs_bt);
754 circle := fullcircle scaled linethickness;
763 save box_top, box_bt;
766 z1 = (0.00 wd + linethickness / 2, yoffs_bt);
767 z2 = (0.21 wd, yoffs_bt + convexity);
768 z3 = (0.42 wd - linethickness/ 2,
769 yoffs_bt + eccentricity);
770 box_top# = height# + yoffs_bt# +
771 max (0, convexity#, eccentricity#);
772 box_bt# = yoffs_bt# +
773 min (0, convexity#, eccentricity#);
782 z1 = (0.00 wd + linethickness / 2, yoffs_bt);
783 z2 = (0.21 wd, yoffs_bt + convexity);
784 z3 = (0.42 wd - linethickness / 2, yoffs_bt);
785 box_top# = height# + yoffs_bt# + max (0, convexity#);
786 box_bt# = yoffs_bt# + min (0, convexity#);
796 labels (1, 2, 3, 4, 5, 6);
801 dirs12 := direction (0 + epsilon) of p;
802 dirs2 := direction 1 of p;
803 dirs32 := direction (2 - epsilon) of p;
804 dirs45 := direction (3 + epsilon) of p;
805 dirs5 := direction 4 of p;
806 dirs65 := direction (5 - epsilon) of p;
808 fill get_subpath (circle, down, dirs12, z1)
810 .. get_subpath (circle, dirs32, up, z3)
811 -- get_subpath (circle, up, dirs45, z4)
813 .. get_subpath (circle, dirs65, down, z6)
821 pat123 := ((directionpoint -dirs12 of circle)
824 .. {dirs32}((directionpoint -dirs32 of circle)
828 pat456 := ((directionpoint -dirs45 of circle)
831 .. {dirs65}((directionpoint -dirs65 of circle)
836 t61 := ypart (pat61 intersectiontimes pat123);
837 t12 := xpart (pat123 intersectiontimes pat34);
838 t34 := ypart (pat34 intersectiontimes pat456);
839 t45 := xpart (pat456 intersectiontimes pat61);
841 unfill subpath (t61, t12) of pat123
842 -- subpath (t34, t45) of pat456
846 set_char_box (0.00 wd#, 0.42 wd#,
847 max (0, -box_bt#) + linethickness# / 2,
848 max (0, box_top#) + linethickness# / 2);
851 save linea_width, linea_height;
853 linea_width# = 0.6 linethickness#;
854 linea_height# = 0.7 ht#;
856 define_pixels (linea_width, linea_height);
858 pickup pencircle scaled 0.6 linethickness;
860 draw_rounded_block ((-0.10 wd - linea_width / 2,
862 (-0.10 wd + linea_width / 2,
865 draw_rounded_block ((+0.52 wd - linea_width / 2,
867 (+0.52 wd + linea_width / 2,
871 set_char_box (0, 0.62 wd# + linea_width#,
875 currentpicture := currentpicture
876 shifted (0.10 wd + linea_width / 2, 0);
882 def plica_char (expr verbose_name, internal_name,
884 fet_beginchar (verbose_name, "s" & internal_name);
887 a_b := 1.54; % b_h * a_b / a_w = wd / ht
891 save a, beta, ht, wd;
893 ht# = noteheight# * mag;
897 black_notehead_width# := wd#;
911 % convexity and eccentricity
912 save convexity, eccentricity;
914 convexity# := d_sign * -0.10 ht#;
915 eccentricity# := d_sign * -0.12 ht#;
922 define_pixels (convexity, eccentricity, yoffs, ht, wd);
924 pickup pencircle scaled linethickness;
926 save height, yoffs_bt, p, circle, circle_r;
927 path p, circle, circle_r;
930 yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
932 define_pixels (height, yoffs_bt);
934 circle := fullcircle scaled linethickness;
943 save box_top, box_bt;
945 z1 = (0.00 wd + linethickness / 2, yoffs_bt);
946 z2 = (0.21 wd, yoffs_bt + convexity);
947 z3 = (0.42 wd - linethickness/ 2, yoffs_bt + eccentricity);
948 box_top# = height# + yoffs_bt# +
949 max (0, convexity#, eccentricity#);
950 box_bt# = yoffs_bt# +
951 min (0, convexity#, eccentricity#);
960 labels (1, 2, 3, 4, 5, 6);
965 dirs12 := direction (0 + epsilon) of p;
966 dirs2 := direction 1 of p;
967 dirs32 := direction (2 - epsilon) of p;
968 dirs45 := direction (3 + epsilon) of p;
969 dirs5 := direction 4 of p;
970 dirs65 := direction (5 - epsilon) of p;
972 fill get_subpath (circle, down, dirs12, z1)
974 .. get_subpath (circle, dirs32, up, z3)
975 -- get_subpath (circle, up, dirs45, z4)
977 .. get_subpath (circle, dirs65, down, z6)
980 pickup pencircle scaled 0.6 linethickness;
984 set_char_box (0.00 wd#, 0.42 wd#,
985 max (0, -box_bt#) + linethickness# / 2,
986 max (0, box_top#) + linethickness# / 2);
992 def epiphonus_char (expr verbose_name, internal_name,
993 left_stem, d_up, down_shift, mag) =
994 fet_beginchar (verbose_name, "s" & internal_name);
997 a_b := 1.54; % b_h * a_b / a_w = wd / ht
1001 save a, beta, ht, wd;
1003 ht# = noteheight# * mag;
1007 black_notehead_width# := wd#;
1021 % convexity and eccentricity
1024 convexity# := d_sign * -0.05ht#;
1030 yoffs# := -0.11 ht#;
1035 define_pixels (convexity, yoffs, ht, wd);
1037 pickup pencircle scaled linethickness;
1039 save height, yoffs_bt, p, circle, circle_r;
1040 path p, circle, circle_r;
1043 yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
1045 define_pixels (height, yoffs_bt);
1047 circle := fullcircle scaled linethickness;
1056 save box_top, box_bt;
1058 z1 = (0.00 wd + linethickness / 2, yoffs_bt - 2.5 convexity);
1059 z2 = (0.06 wd, yoffs_bt + 1.4 convexity);
1060 z3 = (0.42 wd - linethickness / 2, yoffs_bt - 1.0 convexity);
1061 box_top# = height# + yoffs_bt# +
1062 max (-1.0 convexity#, 1.4 convexity#, 0);
1063 box_bt# = yoffs_bt# +
1064 min (-1.0 convexity#, 1.4 convexity#, 0);
1066 .. {curl 1}z2{right}
1073 labels (1, 2, 3, 4, 5, 6);
1078 dirs12 := direction (0 + epsilon) of p;
1079 dirs21 := direction (1 - epsilon) of p;
1080 dirs23 := direction (1 + epsilon) of p;
1081 dirs32 := direction (2 - epsilon) of p;
1082 dirs45 := direction (3 + epsilon) of p;
1083 dirs54 := direction (4 - epsilon) of p;
1084 dirs56 := direction (4 + epsilon) of p;
1085 dirs65 := direction (5 - epsilon) of p;
1087 fill get_subpath (circle, down, dirs12, z1)
1088 .. get_subpath (circle, dirs21, dirs23, z2)
1089 .. get_subpath (circle, dirs32, up, z3)
1090 -- get_subpath (circle, up, dirs45, z4)
1091 .. get_subpath (circle, dirs54, dirs56, z5)
1092 .. get_subpath (circle, dirs65, down, z6)
1098 pickup pencircle scaled 0.6 linethickness;
1100 lft x11 = x1 - linethickness / 2;
1101 bot y11 = yoffs - 1.1 ht - linethickness / 2;
1105 draw_rounded_block (bot lft z11, top rt z12,
1107 stem_bt# = yoffs# - 1.1 ht#;
1114 set_char_box (0.00 wd#, 0.42 wd#,
1115 max (0, -box_bt#, -stem_bt#) + linethickness# / 2,
1116 max (0, box_top#) + linethickness# / 2);
1121 def inclinatum_char (expr verbose_name, internal_name,
1122 small, stropha, auctum) =
1123 fet_beginchar (verbose_name, "s" & internal_name);
1129 ht# = 0.50 noteheight#;
1131 ht# = 0.80 noteheight#;
1134 draw_diamond_head (ht#, 0, 0, alpha, false);
1138 off_angle := alpha + 15;
1140 save stropha_ellipse, auctum_hook, circle;
1141 path stropha_ellipse, auctum_hook, circle;
1143 circle := reverse fullcircle scaled linethickness;
1145 stropha_ellipse := fullcircle xscaled 0.25 head_height
1146 yscaled 0.55 head_height
1150 + linethickness / 2 * dir (180 - off_angle)
1151 - directionpoint dir (90 - off_angle)
1153 z12 = directionpoint -dir (90 - off_angle) of diamond_shape +
1154 linethickness / 2 * dir (180 - off_angle);
1155 z13 = (0, -0.5 head_height + linethickness);
1157 auctum_hook := z12{-dir (90 - off_angle)}
1158 .. {dir (90 + alpha)}z13;
1162 if (stropha and not auctum):
1167 t_in := xpart ((stropha_ellipse shifted z11)
1169 get_subpath (diamond_shape,
1172 t_out := xpart ((stropha_ellipse shifted z11)
1174 get_subpath (diamond_shape,
1178 % the addition or subtraction of `1' is necessary
1179 % so that we get the right starting point
1180 fill get_subpath_i (diamond_shape,
1181 dir (angle (z2 - z1) - 1),
1182 dir (angle (z1 - z4) + 1),
1184 -- get_subpath (stropha_ellipse,
1185 direction t_in of stropha_ellipse,
1186 direction t_out of stropha_ellipse,
1193 if (auctum and not stropha):
1196 fill get_subpath (diamond_shape,
1198 -dir (90 - off_angle),
1200 .. get_subpath (circle,
1204 .. get_subpath (circle,
1205 dir (90 - off_angle),
1213 if (auctum and stropha):
1218 t := xpart ((stropha_ellipse shifted z11)
1220 get_subpath (diamond_shape, up, right,
1223 % the addition or subtraction of `1' is necessary
1224 % so that we get the right starting point
1225 fill get_subpath_i (diamond_shape,
1226 dir (angle (z2 - z1) - 1),
1227 -dir (90 - off_angle),
1229 .. get_subpath (circle,
1233 .. get_subpath (stropha_ellipse,
1234 dir (90 - off_angle),
1235 direction t of stropha_ellipse,
1246 vat_punctum_char ("Ed. Vat. punctum", "vaticana.punctum",
1247 false, false, false, false,
1248 false, false, false, 1.0);
1251 % punctum cavum (for OpusTeX compatibility)
1252 vat_punctum_char ("Ed. Vat. punctum cavum", "vaticana.punctum.cavum",
1253 false, true, false, false,
1254 false, false, false, 1.0);
1257 % linea punctum (for OpusTeX compatibility)
1258 vat_punctum_char ("Ed. Vat. linea punctum", "vaticana.linea.punctum",
1259 true, false, false, false,
1260 false, false, false, 1.0);
1263 % linea punctum cavum (for OpusTeX compatibility)
1264 vat_punctum_char ("Ed. Vat. linea punctum cavum", "vaticana.linea.punctum.cavum",
1265 true, true, false, false,
1266 false, false, false, 1.0);
1269 % punctum inclinatum
1270 inclinatum_char ("Ed. Vat. inclinatum", "vaticana.inclinatum",
1271 false, false, false);
1275 vat_punctum_char ("Ed. Vat. pes lower punctum", "vaticana.lpes",
1276 false, false, true, false,
1277 true, false, false, 1.0);
1281 vat_punctum_char ("Ed. Vat. pes var lower punctum", "vaticana.vlpes",
1282 false, false, true, false,
1283 true, false, true, 1.0);
1287 vat_punctum_char ("Ed. Vat. pes upper punctum", "vaticana.upes",
1288 false, false, true, false,
1289 false, false, false, 1.0);
1292 % pes upper punctum (shifted variation)
1294 % This note head is used instead of the regular pes upper punctum to
1295 % avoid collision with the lower punctum note of the pes when the upper
1296 % punctum sits directly on top of the lower punctum.
1298 vat_punctum_char ("Ed. Vat. var pes upper punctum", "vaticana.vupes",
1299 false, false, true, false,
1300 false, true, false, 1.0);
1303 % small punctum as used in epiphonus
1304 vat_punctum_char ("Ed. Vat. plica", "vaticana.plica",
1305 false, false, false, false,
1306 false, false, false, 0.6);
1309 % small punctum as used in epiphonus
1310 plica_char ("Ed. Vat. var plica", "vaticana.vplica",
1314 % eccentric punctum as used in epiphonus
1315 epiphonus_char ("Ed. Vat. epiphonus", "vaticana.epiphonus",
1316 false, true, false, 1.0);
1319 % eccentric punctum as used in epiphonus (shifted variation)
1321 % This note head is used instead of the regular epiphonus punctum to
1322 % avoid collision with the plica head when the plica sits directly on
1323 % top of the lower head.
1325 epiphonus_char ("Ed. Vat. var epiphonus", "vaticana.vepiphonus",
1326 false, true, true, 1.0);
1329 % small punctum as used in cephalicus
1330 vat_punctum_char ("Ed. Vat. rev. plica", "vaticana.reverse.plica",
1331 false, false, false, false,
1332 true, false, false, 0.6);
1335 % small punctum as used in cephalicus
1336 plica_char ("Ed. Vat. rev. var plica", "vaticana.reverse.vplica",
1340 % eccentric punctum as used in cephalicus; without left stem
1341 epiphonus_char ("Ed. Vat. inner cephalicus", "vaticana.inner.cephalicus",
1342 false, false, false, 1.0);
1345 % eccentric punctum as used in cephalicus; with left stem
1346 epiphonus_char ("Ed. Vat. cephalicus", "vaticana.cephalicus",
1347 true, false, false, 1.0);
1351 fet_beginchar ("Ed. Vat. quilisma", "svaticana.quilisma");
1354 a_b := 1.54; % b_h * a_b / a_w = wd / ht
1358 save a, beta, ht, wd;
1365 set_char_box (0, 0.42 wd#, 0.28 ht#, 0.36 ht#);
1367 black_notehead_width# := wd#;
1369 define_pixels (ht, wd);
1375 T := identity xscaled linethickness
1377 pickup pencircle transformed T;
1378 ellipse := reverse fullcircle transformed T;
1380 z1 = (rt 0.00 wd, top -0.28 ht);
1381 z2 = (0.11 wd, -0.14 ht);
1382 z3 = (0.12 wd, +0.03 ht);
1383 z4 = (0.25 wd, -0.09 ht);
1384 z5 = (0.25 wd, +0.08 ht);
1385 z6 = (lft 0.42 wd, -0.04 ht);
1386 z7 = (lft 0.40 wd, bot +0.36 ht);
1388 fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
1389 -- get_subpath (ellipse, z2 - z1, z1 - z2, z2)
1391 fill get_subpath (ellipse, z3 - z4, z4 - z3, z3)
1392 -- get_subpath (ellipse, z4 - z3, z3 - z4, z4)
1394 fill get_subpath (ellipse, z5 - z6, z6 - z5, z5)
1395 -- point 0 of get_subpath (ellipse, z6 - z5, z5 - z6, z6)
1396 -- get_subpath (ellipse, z7 - z6, z6 - z7, z7)
1397 -- get_subpath (ellipse, z6 - z7, z5 - z6, z6)
1400 labels (1, 2, 3, 4, 5, 6, 7);
1404 % solesmes punctum inclinatum parvum
1405 inclinatum_char ("Solesmes punctum inclinatum parvum", "solesmes.incl.parvum",
1406 true, false, false);
1409 % solesmes punctum auctum ascendens
1410 vat_punctum_char ("Solesmes punctum auctum ascendens", "solesmes.auct.asc",
1411 false, false, false, true,
1412 true, false, false, 1.0);
1415 % solesmes punctum auctum descendens
1416 vat_punctum_char ("Solesmes punctum auctum descendens", "solesmes.auct.desc",
1417 false, false, false, true,
1418 false, false, false, 1.0);
1421 % solesmes punctum inclinatum auctum
1422 inclinatum_char ("Solesmes punctum incl. auctum", "solesmes.incl.auctum",
1423 false, false, true);
1427 inclinatum_char ("Solesmes stropha", "solesmes.stropha",
1428 false, true, false);
1431 % solesmes stropha aucta
1432 inclinatum_char ("Solesmes stropha aucta", "solesmes.stropha.aucta",
1437 fet_beginchar ("Solesmes oriscus", "ssolesmes.oriscus");
1440 a_b := 1.54; % b_h * a_b / a_w = wd / ht
1444 save a, beta, ht, wd;
1450 black_notehead_width# := wd#;
1454 convexity# = +0.05 ht#;
1456 define_pixels (ht, wd, convexity);
1458 set_char_box (0.00 wd#, 0.50 wd#,
1459 0.25 ht# + convexity#, 0.25 ht# + convexity#);
1461 z1 = (0.00 wd + blot_diameter / 2, -convexity);
1462 z2 = (1/6 wd, +convexity);
1463 z3 = (2/6 wd, -convexity);
1464 z4 = (0.50 wd - blot_diameter / 2, +convexity);
1469 height = 2 ypart (directionpoint right of (z1
1478 T := identity xscaled blot_diameter
1479 yscaled (h + d - height);
1480 pickup pencircle transformed T;
1481 ellipse := fullcircle transformed T;
1483 % Adjust vertical coordinates to touch bounding box.
1490 d_ := direction 0 of (z1
1495 fill get_subpath (ellipse, -d_, d_, z1)
1498 .. get_subpath (ellipse, d_, -d_, z4)
1503 labels (1, 2, 3, 4);
1517 fet_beginchar ("Ed. Med. inclinatum", "smedicaea.inclinatum");
1518 draw_diamond_head (1.2 staff_space#, 0, 0, 35, false);
1522 def med_punctum_char (expr verbose_name, internal_name,
1523 left_up_stem, left_down_stem) =
1524 fet_beginchar (verbose_name, "s" & internal_name);
1527 ht# = 2 staff_space#;
1529 black_notehead_width# := wd#;
1531 define_pixels (ht, wd);
1536 ellipse := fullcircle xscaled blot_diameter
1539 z1 = (0.00 wd + blot_diameter / 2, 0);
1540 z2 = (0.4 wd - blot_diameter / 2, 0);
1544 pickup pencircle scaled linethickness;
1547 z4 = (0.00 wd + linethickness / 2, -1.25 ht);
1549 fill get_subpath (ellipse, left, down, z1)
1553 -- (rt x4, -.5 ht / 2)
1554 -- get_subpath (ellipse, right, left, z2)
1559 set_char_box (0.0, 0.4 wd#, 1.25 ht#, 0.25 ht#);
1560 elseif left_up_stem:
1561 z4 = (0.00 wd + linethickness / 2, +1.25 ht);
1563 fill get_subpath (ellipse, down, right, z1)
1564 -- get_subpath (ellipse, right, left, z2)
1565 -- (rt x4, .5 ht / 2)
1573 set_char_box (0.0, 0.4 wd#, 0.25 ht#, 1.25 ht#);
1575 fill get_subpath (ellipse, left, right, z1)
1576 -- get_subpath (ellipse, right, left, z2)
1579 set_char_box (0.0, 0.4 wd#, 0.25 ht#, 0.25 ht#);
1587 med_punctum_char ("Ed. Med. punctum", "medicaea.punctum",
1591 % left up-stemmed punctum
1592 med_punctum_char ("Ed. Med. reverse virga", "medicaea.rvirga",
1596 % virga (i.e. left down-stemmed punctum)
1597 med_punctum_char ("Ed. Med. virga", "medicaea.virga",
1610 def huf_punctum_char (expr verbose_name, internal_name,
1612 fet_beginchar (verbose_name, "s" & internal_name);
1617 draw_diamond_head (staff_space#, 0, 0, alpha, false);
1620 set_char_box (0, head_width#,
1621 1.5 staff_space#, head_height# / 2);
1626 ellipse := reverse fullcircle xscaled blot_diameter
1627 yscaled 0.7 staff_space
1630 z11 = (head_width / 2, 0);
1631 z12 = find_tangent_shift (((0, -d) -- (w, -d)), ellipse,
1632 (w / 2, -d), (w / 2, 0));
1634 fill get_subpath (ellipse, up, down, z11)
1635 -- get_subpath (ellipse, down, up, z12)
1645 huf_punctum_char ("Hufnagel punctum", "hufnagel.punctum", false)
1649 huf_punctum_char ("Hufnagel virga", "hufnagel.virga", true)
1653 fet_beginchar ("Hufnagel pes lower punctum", "shufnagel.lpes")
1654 save width, height, alpha;
1656 width# = 2 * staff_space#;
1657 height# = 0.7 * staff_space#;
1660 set_char_box (0, width#, height# / 2, height# / 2);
1662 define_pixels (width, height);
1667 circle := reverse fullcircle scaled linethickness;
1669 pickup pencircle scaled linethickness;
1671 rt x3 = -lft x1 = width / 2;
1672 y2 = y3 = height / 2;
1673 y1 = y4 = -height / 2;
1675 tand (alpha) * (y2 - y1) = x2 - x1 = x3 - x4;
1677 fill get_subpath (circle, left, z2 - z1, z1)
1678 -- get_subpath (circle, z2 - z1, right, z2)
1679 -- get_subpath (circle, right, z4 - z3, z3)
1680 -- get_subpath (circle, z4 - z3, left, z4)
1683 currentpicture := currentpicture shifted (width/2, 0);
1685 % labels (1, 2, 3, 4);
1689 fet_endgroup ("noteheads");