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 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 nm_holeheight, nm_red_holeheight;
267 nm_maxima_width := 2.6 staff_space#;
268 nm_longa_width := 2 staff_space#;
269 nm_brevis_width := nm_longa_width;
270 nm_holeheight := 4 linethickness;
271 nm_red_holeheight := 2.5 linethickness;
273 fet_beginchar ("Neo-mensural maxima notehead (up)", "uM3neomensural");
274 draw_neomensural_longa (nm_maxima_width, nm_holeheight, 1);
277 fet_beginchar ("Neo-mensural maxima notehead (down)", "dM3neomensural");
278 draw_neomensural_longa (nm_maxima_width, nm_holeheight, -1);
281 fet_beginchar ("Neo-mensural longa notehead (up)", "uM2neomensural");
282 draw_neomensural_longa (nm_longa_width, nm_holeheight, 1);
285 fet_beginchar ("Neo-mensural longa notehead (down)", "dM2neomensural");
286 draw_neomensural_longa (nm_longa_width, nm_holeheight, -1);
289 fet_beginchar ("Neo-mensural brevis notehead", "sM1neomensural");
290 draw_neomensural_brevis (nm_brevis_width, nm_holeheight, true, true);
293 fet_beginchar ("Neo-mensural maxima notehead (up, reduced hole)", "urM3neomensural");
294 draw_neomensural_longa (nm_maxima_width, nm_red_holeheight, 1);
297 fet_beginchar ("Neo-mensural maxima notehead (down, reduced hole)", "drM3neomensural");
298 draw_neomensural_longa (nm_maxima_width, nm_red_holeheight, -1);
301 fet_beginchar ("Neo-mensural longa notehead (up, reduced hole)", "urM2neomensural");
302 draw_neomensural_longa (nm_longa_width, nm_red_holeheight, 1);
305 fet_beginchar ("Neo-mensural longa notehead (down, reduced hole)", "drM2neomensural");
306 draw_neomensural_longa (nm_longa_width, nm_red_holeheight, -1);
309 fet_beginchar ("Neo-mensural brevis notehead (reduced hole)", "srM1neomensural");
310 draw_neomensural_brevis (nm_brevis_width, nm_red_holeheight, true, true);
315 % Neo-mensural semibrevis/minima/semiminima
318 save nm_height, nm_width;
319 nm_height := noteheight#;
320 nm_width := staff_space#;
321 fet_beginchar ("Neo-mensural semibrevis head", "s0neomensural");
322 draw_neomensural_open_head (nm_width, nm_height);
325 fet_beginchar ("Neo-mensural minima head", "s1neomensural");
326 draw_neomensural_open_head (nm_width, nm_height);
329 fet_beginchar ("Neo-mensural semiminima head", "s2neomensural");
330 draw_neomensural_black_head (nm_width, nm_height);
343 % WL says the thin lines should be thinner.
346 fet_beginchar ("Harmonic notehead (Neo-mensural open)", "s0harmonic");
347 draw_neomensural_open_head (1.3 staff_space#, 1.3 noteheight#);
348 charwx := head_width#;
352 fet_beginchar ("Harmonic notehead (Neo-mensural black)", "s2harmonic");
353 draw_neomensural_black_head (1.3 staff_space#, 1.3 noteheight#);
354 charwx := head_width#;
363 % MENSURAL/PETRUCCI NOTATIONS
368 def draw_mensural_brevis (expr wid, holeheight, open, full) =
369 % TODO. For the moment, fall back to draw_neomensural_brevis.
370 draw_neomensural_brevis (wid, holeheight, open, full);
374 def draw_mensural_longa (expr wid, holeheight, open, full, direction) =
375 draw_mensural_brevis (wid, holeheight, open, full);
380 x6 = x7 = head_width - stem_width / 2;
382 y7 = dir * y5 -1.75 dir * staff_space;
384 z17 = (x7, y7 - dir * stem_width / 2);
386 penpos6 (stem_width, 0);
387 penpos7 (1.5 stem_width, 0);
401 def draw_diamond_head (expr head_h, pen_w, pen_h, angle, open) =
402 save head_width, head_height;
403 save ellipse, ellipse_r;
404 path ellipse, ellipse_r, diamond_shape;
406 head_height# = head_h;
407 head_width# / head_height# = tand (angle);
409 set_char_box (0, head_width#,
410 head_height# / 2, head_height# / 2);
412 charwx := head_width# / 2;
413 charwy := head_height# / 2 - 2 linethickness#;
415 define_pixels (head_width, head_height);
417 ellipse := reverse fullcircle
418 xscaled (max (blot_diameter, pen_w * head_width))
419 yscaled (max (blot_diameter, pen_h * head_width))
422 z1 = find_tangent_shift (((0, h) -- (0, -h)), ellipse,
424 z2 = find_tangent_shift (((0, h) -- (w, h)), ellipse,
425 (w / 2, h), (w / 2, 0));
426 z3 = find_tangent_shift (((w, h) -- (w, -h)), ellipse,
428 z4 = find_tangent_shift (((0, -h) -- (w, -h)), ellipse,
429 (w / 2, -h), (w / 2, 0));
431 diamond_shape := get_subpath (ellipse, z1 - z4, z2 - z1, z1)
432 -- get_subpath (ellipse, z2 - z1, z3 - z2, z2)
433 -- get_subpath (ellipse, z3 - z2, z4 - z3, z3)
434 -- get_subpath (ellipse, z4 - z3, z1 - z4, z4)
442 l12 := (directionpoint (z1 - z2) of ellipse) shifted z1
443 -- (directionpoint (z1 - z2) of ellipse) shifted z2;
444 l23 := (directionpoint (z2 - z3) of ellipse) shifted z2
445 -- (directionpoint (z2 - z3) of ellipse) shifted z3;
446 l34 := (directionpoint (z3 - z4) of ellipse) shifted z3
447 -- (directionpoint (z3 - z4) of ellipse) shifted z4;
448 l41 := (directionpoint (z4 - z1) of ellipse) shifted z4
449 -- (directionpoint (z4 - z1) of ellipse) shifted z1;
451 unfill l12 intersectionpoint l23
452 -- l23 intersectionpoint l34
453 -- l34 intersectionpoint l41
454 -- l41 intersectionpoint l12
463 % Mensural/Petrucci maxima/longa/brevis
466 save m_maxima_width, m_longa_width, m_brevis_width,
467 m_holeheight, m_red_holeheight;
468 m_maxima_width := 2.0 staff_space#;
469 m_longa_width := staff_space#;
470 m_brevis_width := m_longa_width;
471 m_holeheight := nm_holeheight;
472 m_red_holeheight := nm_red_holeheight;
474 fet_beginchar ("Mensural maxima notehead (up)", "uM3mensural");
475 draw_mensural_longa (m_maxima_width, m_holeheight, true, true, 1);
478 fet_beginchar ("Mensural maxima notehead (down)", "dM3mensural");
479 draw_mensural_longa (m_maxima_width, m_holeheight, true, true, -1);
482 fet_beginchar ("Mensural maxima notehead (ligature)", "sM3ligmensural");
483 draw_mensural_brevis (m_maxima_width, m_holeheight, true, true);
486 fet_beginchar ("Mensural longa notehead (up)", "uM2mensural");
487 draw_mensural_longa (m_longa_width, m_holeheight, true, true, 1);
490 fet_beginchar ("Mensural longa notehead (down)", "dM2mensural");
491 draw_mensural_longa (m_longa_width, m_holeheight, true, true, -1);
494 fet_beginchar ("Mensural brevis notehead", "sM1mensural");
495 draw_mensural_brevis (m_brevis_width, m_holeheight, true, true);
498 fet_beginchar ("Mensural maxima notehead (up, reduced hole)", "urM3mensural");
499 draw_mensural_longa (m_maxima_width, m_red_holeheight, true, true, 1);
502 fet_beginchar ("Mensural maxima notehead (down, reduced hole)", "drM3mensural");
503 draw_mensural_longa (m_maxima_width, m_red_holeheight, true, true, -1);
506 fet_beginchar ("Mensural maxima notehead (ligature, reduced hole)", "srM3ligmensural");
507 draw_mensural_brevis (m_maxima_width, m_red_holeheight, true, true);
510 fet_beginchar ("Mensural longa notehead (up, reduced hole)", "urM2mensural");
511 draw_mensural_longa (m_longa_width, m_red_holeheight, true, true, 1);
514 fet_beginchar ("Mensural longa notehead (down, reduced hole)", "drM2mensural");
515 draw_mensural_longa (m_longa_width, m_red_holeheight, true, true, -1);
518 fet_beginchar ("Mensural brevis notehead (reduced hole)", "srM1mensural");
519 draw_mensural_brevis (m_brevis_width, m_red_holeheight, true, true);
524 % Semi-colored mensural/Petrucci maxima/longa/brevis
527 fet_beginchar ("Semi-colored mensural maxima notehead (up)", "uM3semimensural");
528 draw_mensural_longa (m_maxima_width, m_holeheight, true, false, 1);
531 fet_beginchar ("Semi-colored mensural maxima notehead (down)", "dM3semimensural");
532 draw_mensural_longa (m_maxima_width, m_holeheight, true, false, -1);
535 fet_beginchar ("Semi-colored mensural maxima notehead (ligature)", "sM3semiligmensural");
536 draw_mensural_brevis (m_maxima_width, m_holeheight, true, false);
539 fet_beginchar ("Semi-colored mensural longa notehead (up)", "uM2semimensural");
540 draw_mensural_longa (m_longa_width, m_holeheight, true, false, 1);
543 fet_beginchar ("Semi-colored mensural longa notehead (down)", "dM2semimensural");
544 draw_mensural_longa (m_longa_width, m_holeheight, true, false, -1);
547 fet_beginchar ("Semi-colored mensural brevis notehead", "sM1semimensural");
548 draw_mensural_brevis (m_brevis_width, m_holeheight, true, false);
551 fet_beginchar ("Semi-colored mensural maxima notehead (up, reduced hole)", "urM3semimensural");
552 draw_mensural_longa (m_maxima_width, m_red_holeheight, true, false, 1);
555 fet_beginchar ("Semi-colored mensural maxima notehead (down, reduced hole)", "drM3semimensural");
556 draw_mensural_longa (m_maxima_width, m_red_holeheight, true, false, -1);
559 fet_beginchar ("Semi-colored mensural maxima notehead (ligature, reduced hole)", "srM3semiligmensural");
560 draw_mensural_brevis (m_maxima_width, m_red_holeheight, true, false);
563 fet_beginchar ("Semi-colored mensural longa notehead (up, reduced hole)", "urM2semimensural");
564 draw_mensural_longa (m_longa_width, m_red_holeheight, true, false, 1);
567 fet_beginchar ("Semi-colored mensural longa notehead (down, reduced hole)", "drM2semimensural");
568 draw_mensural_longa (m_longa_width, m_red_holeheight, true, false, -1);
571 fet_beginchar ("Semi-colored mensural brevis notehead (reduced hole)", "srM1semimensural");
572 draw_mensural_brevis (m_brevis_width, m_red_holeheight, true, false);
577 % Black mensural/Petrucci maxima/longa/brevis
580 fet_beginchar ("Black mensural maxima notehead (up)", "uM3blackmensural");
581 draw_mensural_longa (m_maxima_width, 0, false, false, 1);
584 fet_beginchar ("Black mensural maxima notehead (down)", "dM3blackmensural");
585 draw_mensural_longa (m_maxima_width, 0, false, false, -1);
588 fet_beginchar ("Black mensural maxima notehead (ligature)", "sM3blackligmensural");
589 draw_mensural_brevis (m_maxima_width, 0, false, false);
592 fet_beginchar ("Black mensural longa notehead (up)", "uM2blackmensural");
593 draw_mensural_longa (m_longa_width, 0, false, false, 1);
596 fet_beginchar ("Black mensural longa notehead (down)", "dM2blackmensural");
597 draw_mensural_longa (m_longa_width, 0, false, false, -1);
600 fet_beginchar ("Black mensural brevis notehead", "sM1blackmensural");
601 draw_mensural_brevis (m_brevis_width, 0, false, false);
606 % Mensural semibrevis/minima/semiminima
609 fet_beginchar ("Mensural semibrevis head", "s0mensural");
610 draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
613 fet_beginchar ("Mensural minima head", "s1mensural");
614 draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
617 fet_beginchar ("Mensural semiminima head", "s2mensural");
618 draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
623 % Black mensural semibrevis/minima/semiminima
626 fet_beginchar ("Black mensural semibrevis head", "s0blackmensural");
627 draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
632 % Petrucci semibrevis/minima/semiminima
634 % These values can be measured in several sources.
635 % I used "Modulis ex sacris literis delecti, Liber primus"
636 % Josquin Desprez, BNF
638 save petrucci_width, petrucci_height;
639 petrucci_height := 1.3 noteheight#;
640 petrucci_width := .72 petrucci_height;
642 fet_beginchar ("Petrucci semibrevis head", "s0petrucci");
643 draw_neomensural_open_head (petrucci_width, petrucci_height);
646 fet_beginchar ("Petrucci minima head", "s1petrucci");
647 draw_neomensural_open_head (petrucci_width, petrucci_height);
650 fet_beginchar ("Petrucci semiminima head", "s2petrucci");
651 draw_neomensural_black_head (petrucci_width, petrucci_height);
656 % Black Petrucci semibrevis/minima/semiminima
659 fet_beginchar ("Petrucci colored semibrevis head", "s0blackpetrucci");
660 draw_neomensural_black_head (petrucci_width, petrucci_height);
663 fet_beginchar ("Petrucci colored minima head", "s1blackpetrucci");
664 draw_neomensural_black_head (petrucci_width, petrucci_height);
667 fet_beginchar ("Petrucci colored semiminima head", "s2blackpetrucci");
668 draw_neomensural_black_head (petrucci_width, petrucci_height);
676 % EDITIO VATICANA (including solesmes extensions)
681 def vat_punctum_char (expr verbose_name, internal_name,
682 linea, cavum, straight, auctum,
683 d_up, up_shift, down_shift, mag) =
684 fet_beginchar (verbose_name, "s" & internal_name);
687 a_b := 1.54; % b_h * a_b / a_w = wd / ht
691 save a, beta, ht, wd;
693 ht# = noteheight# * mag;
697 black_notehead_width# := wd#;
711 % convexity and eccentricity
712 save u_convexity, u_eccentricity;
715 u_convexity# := -0.01 ht#;
716 u_eccentricity# := 0.0 ht#; % dummy
718 u_convexity# := -0.03 ht#;
719 u_eccentricity# := +0.25 ht#;
721 u_convexity# := -0.05 ht#;
722 u_eccentricity# := 0.0 ht#; % dummy
725 save convexity, eccentricity;
727 convexity# := d_sign * u_convexity#;
728 eccentricity# := d_sign * u_eccentricity#;
741 define_pixels (convexity, eccentricity, yoffs, ht, wd);
743 pickup pencircle scaled linethickness;
745 save height, yoffs_bt, p, circle, circle_r;
746 path p, circle, circle_r;
749 yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
751 define_pixels (height, yoffs_bt);
753 circle := fullcircle scaled linethickness;
762 save box_top, box_bt;
765 z1 = (0.00 wd + linethickness / 2, yoffs_bt);
766 z2 = (0.21 wd, yoffs_bt + convexity);
767 z3 = (0.42 wd - linethickness/ 2,
768 yoffs_bt + eccentricity);
769 box_top# = height# + yoffs_bt# +
770 max (0, convexity#, eccentricity#);
771 box_bt# = yoffs_bt# +
772 min (0, convexity#, eccentricity#);
781 z1 = (0.00 wd + linethickness / 2, yoffs_bt);
782 z2 = (0.21 wd, yoffs_bt + convexity);
783 z3 = (0.42 wd - linethickness / 2, yoffs_bt);
784 box_top# = height# + yoffs_bt# + max (0, convexity#);
785 box_bt# = yoffs_bt# + min (0, convexity#);
795 labels (1, 2, 3, 4, 5, 6);
800 dirs12 := direction (0 + epsilon) of p;
801 dirs2 := direction 1 of p;
802 dirs32 := direction (2 - epsilon) of p;
803 dirs45 := direction (3 + epsilon) of p;
804 dirs5 := direction 4 of p;
805 dirs65 := direction (5 - epsilon) of p;
807 fill get_subpath (circle, down, dirs12, z1)
809 .. get_subpath (circle, dirs32, up, z3)
810 -- get_subpath (circle, up, dirs45, z4)
812 .. get_subpath (circle, dirs65, down, z6)
820 pat123 := ((directionpoint -dirs12 of circle)
823 .. {dirs32}((directionpoint -dirs32 of circle)
827 pat456 := ((directionpoint -dirs45 of circle)
830 .. {dirs65}((directionpoint -dirs65 of circle)
835 t61 := ypart (pat61 intersectiontimes pat123);
836 t12 := xpart (pat123 intersectiontimes pat34);
837 t34 := ypart (pat34 intersectiontimes pat456);
838 t45 := xpart (pat456 intersectiontimes pat61);
840 unfill subpath (t61, t12) of pat123
841 -- subpath (t34, t45) of pat456
845 set_char_box (0.00 wd#, 0.42 wd#,
846 max (0, -box_bt#) + linethickness# / 2,
847 max (0, box_top#) + linethickness# / 2);
850 save linea_width, linea_height;
852 linea_width# = 0.6 linethickness#;
853 linea_height# = 0.7 ht#;
855 define_pixels (linea_width, linea_height);
857 pickup pencircle scaled 0.6 linethickness;
859 draw_rounded_block ((-0.10 wd - linea_width / 2,
861 (-0.10 wd + linea_width / 2,
864 draw_rounded_block ((+0.52 wd - linea_width / 2,
866 (+0.52 wd + linea_width / 2,
870 set_char_box (0, 0.62 wd# + linea_width#,
874 currentpicture := currentpicture
875 shifted (0.10 wd + linea_width / 2, 0);
881 def plica_char (expr verbose_name, internal_name,
883 fet_beginchar (verbose_name, "s" & internal_name);
886 a_b := 1.54; % b_h * a_b / a_w = wd / ht
890 save a, beta, ht, wd;
892 ht# = noteheight# * mag;
896 black_notehead_width# := wd#;
910 % convexity and eccentricity
911 save convexity, eccentricity;
913 convexity# := d_sign * -0.10 ht#;
914 eccentricity# := d_sign * -0.12 ht#;
921 define_pixels (convexity, eccentricity, yoffs, ht, wd);
923 pickup pencircle scaled linethickness;
925 save height, yoffs_bt, p, circle, circle_r;
926 path p, circle, circle_r;
929 yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
931 define_pixels (height, yoffs_bt);
933 circle := fullcircle scaled linethickness;
942 save box_top, box_bt;
944 z1 = (0.00 wd + linethickness / 2, yoffs_bt);
945 z2 = (0.21 wd, yoffs_bt + convexity);
946 z3 = (0.42 wd - linethickness/ 2, yoffs_bt + eccentricity);
947 box_top# = height# + yoffs_bt# +
948 max (0, convexity#, eccentricity#);
949 box_bt# = yoffs_bt# +
950 min (0, convexity#, eccentricity#);
959 labels (1, 2, 3, 4, 5, 6);
964 dirs12 := direction (0 + epsilon) of p;
965 dirs2 := direction 1 of p;
966 dirs32 := direction (2 - epsilon) of p;
967 dirs45 := direction (3 + epsilon) of p;
968 dirs5 := direction 4 of p;
969 dirs65 := direction (5 - epsilon) of p;
971 fill get_subpath (circle, down, dirs12, z1)
973 .. get_subpath (circle, dirs32, up, z3)
974 -- get_subpath (circle, up, dirs45, z4)
976 .. get_subpath (circle, dirs65, down, z6)
979 pickup pencircle scaled 0.6 linethickness;
983 set_char_box (0.00 wd#, 0.42 wd#,
984 max (0, -box_bt#) + linethickness# / 2,
985 max (0, box_top#) + linethickness# / 2);
991 def epiphonus_char (expr verbose_name, internal_name,
992 left_stem, d_up, down_shift, mag) =
993 fet_beginchar (verbose_name, "s" & internal_name);
996 a_b := 1.54; % b_h * a_b / a_w = wd / ht
1000 save a, beta, ht, wd;
1002 ht# = noteheight# * mag;
1006 black_notehead_width# := wd#;
1020 % convexity and eccentricity
1023 convexity# := d_sign * -0.05ht#;
1029 yoffs# := -0.11 ht#;
1034 define_pixels (convexity, yoffs, ht, wd);
1036 pickup pencircle scaled linethickness;
1038 save height, yoffs_bt, p, circle, circle_r;
1039 path p, circle, circle_r;
1042 yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
1044 define_pixels (height, yoffs_bt);
1046 circle := fullcircle scaled linethickness;
1055 save box_top, box_bt;
1057 z1 = (0.00 wd + linethickness / 2, yoffs_bt - 2.5 convexity);
1058 z2 = (0.06 wd, yoffs_bt + 1.4 convexity);
1059 z3 = (0.42 wd - linethickness / 2, yoffs_bt - 1.0 convexity);
1060 box_top# = height# + yoffs_bt# +
1061 max (-1.0 convexity#, 1.4 convexity#, 0);
1062 box_bt# = yoffs_bt# +
1063 min (-1.0 convexity#, 1.4 convexity#, 0);
1065 .. {curl 1}z2{right}
1072 labels (1, 2, 3, 4, 5, 6);
1077 dirs12 := direction (0 + epsilon) of p;
1078 dirs21 := direction (1 - epsilon) of p;
1079 dirs23 := direction (1 + epsilon) of p;
1080 dirs32 := direction (2 - epsilon) of p;
1081 dirs45 := direction (3 + epsilon) of p;
1082 dirs54 := direction (4 - epsilon) of p;
1083 dirs56 := direction (4 + epsilon) of p;
1084 dirs65 := direction (5 - epsilon) of p;
1086 fill get_subpath (circle, down, dirs12, z1)
1087 .. get_subpath (circle, dirs21, dirs23, z2)
1088 .. get_subpath (circle, dirs32, up, z3)
1089 -- get_subpath (circle, up, dirs45, z4)
1090 .. get_subpath (circle, dirs54, dirs56, z5)
1091 .. get_subpath (circle, dirs65, down, z6)
1097 pickup pencircle scaled 0.6 linethickness;
1099 lft x11 = x1 - linethickness / 2;
1100 bot y11 = yoffs - 1.1 ht - linethickness / 2;
1104 draw_rounded_block (bot lft z11, top rt z12,
1106 stem_bt# = yoffs# - 1.1 ht#;
1113 set_char_box (0.00 wd#, 0.42 wd#,
1114 max (0, -box_bt#, -stem_bt#) + linethickness# / 2,
1115 max (0, box_top#) + linethickness# / 2);
1120 def inclinatum_char (expr verbose_name, internal_name,
1121 small, stropha, auctum) =
1122 fet_beginchar (verbose_name, "s" & internal_name);
1128 ht# = 0.50 noteheight#;
1130 ht# = 0.80 noteheight#;
1133 draw_diamond_head (ht#, 0, 0, alpha, false);
1137 off_angle := alpha + 15;
1139 save stropha_ellipse, auctum_hook, circle;
1140 path stropha_ellipse, auctum_hook, circle;
1142 circle := reverse fullcircle scaled linethickness;
1144 stropha_ellipse := fullcircle xscaled 0.25 head_height
1145 yscaled 0.55 head_height
1149 + linethickness / 2 * dir (180 - off_angle)
1150 - directionpoint dir (90 - off_angle)
1152 z12 = directionpoint -dir (90 - off_angle) of diamond_shape +
1153 linethickness / 2 * dir (180 - off_angle);
1154 z13 = (0, -0.5 head_height + linethickness);
1156 auctum_hook := z12{-dir (90 - off_angle)}
1157 .. {dir (90 + alpha)}z13;
1161 if (stropha and not auctum):
1166 t_in := xpart ((stropha_ellipse shifted z11)
1168 get_subpath (diamond_shape,
1171 t_out := xpart ((stropha_ellipse shifted z11)
1173 get_subpath (diamond_shape,
1177 % the addition or subtraction of `1' is necessary
1178 % so that we get the right starting point
1179 fill get_subpath_i (diamond_shape,
1180 dir (angle (z2 - z1) - 1),
1181 dir (angle (z1 - z4) + 1),
1183 -- get_subpath (stropha_ellipse,
1184 direction t_in of stropha_ellipse,
1185 direction t_out of stropha_ellipse,
1192 if (auctum and not stropha):
1195 fill get_subpath (diamond_shape,
1197 -dir (90 - off_angle),
1199 .. get_subpath (circle,
1203 .. get_subpath (circle,
1204 dir (90 - off_angle),
1212 if (auctum and stropha):
1217 t := xpart ((stropha_ellipse shifted z11)
1219 get_subpath (diamond_shape, up, right,
1222 % the addition or subtraction of `1' is necessary
1223 % so that we get the right starting point
1224 fill get_subpath_i (diamond_shape,
1225 dir (angle (z2 - z1) - 1),
1226 -dir (90 - off_angle),
1228 .. get_subpath (circle,
1232 .. get_subpath (stropha_ellipse,
1233 dir (90 - off_angle),
1234 direction t of stropha_ellipse,
1245 vat_punctum_char ("Ed. Vat. punctum", "vaticana.punctum",
1246 false, false, false, false,
1247 false, false, false, 1.0);
1250 % punctum cavum (for OpusTeX compatibility)
1251 vat_punctum_char ("Ed. Vat. punctum cavum", "vaticana.punctum.cavum",
1252 false, true, false, false,
1253 false, false, false, 1.0);
1256 % linea punctum (for OpusTeX compatibility)
1257 vat_punctum_char ("Ed. Vat. linea punctum", "vaticana.linea.punctum",
1258 true, false, false, false,
1259 false, false, false, 1.0);
1262 % linea punctum cavum (for OpusTeX compatibility)
1263 vat_punctum_char ("Ed. Vat. linea punctum cavum", "vaticana.linea.punctum.cavum",
1264 true, true, false, false,
1265 false, false, false, 1.0);
1268 % punctum inclinatum
1269 inclinatum_char ("Ed. Vat. inclinatum", "vaticana.inclinatum",
1270 false, false, false);
1274 vat_punctum_char ("Ed. Vat. pes lower punctum", "vaticana.lpes",
1275 false, false, true, false,
1276 true, false, false, 1.0);
1280 vat_punctum_char ("Ed. Vat. pes var lower punctum", "vaticana.vlpes",
1281 false, false, true, false,
1282 true, false, true, 1.0);
1286 vat_punctum_char ("Ed. Vat. pes upper punctum", "vaticana.upes",
1287 false, false, true, false,
1288 false, false, false, 1.0);
1291 % pes upper punctum (shifted variation)
1293 % This note head is used instead of the regular pes upper punctum to
1294 % avoid collision with the lower punctum note of the pes when the upper
1295 % punctum sits directly on top of the lower punctum.
1297 vat_punctum_char ("Ed. Vat. var pes upper punctum", "vaticana.vupes",
1298 false, false, true, false,
1299 false, true, false, 1.0);
1302 % small punctum as used in epiphonus
1303 vat_punctum_char ("Ed. Vat. plica", "vaticana.plica",
1304 false, false, false, false,
1305 false, false, false, 0.6);
1308 % small punctum as used in epiphonus
1309 plica_char ("Ed. Vat. var plica", "vaticana.vplica",
1313 % eccentric punctum as used in epiphonus
1314 epiphonus_char ("Ed. Vat. epiphonus", "vaticana.epiphonus",
1315 false, true, false, 1.0);
1318 % eccentric punctum as used in epiphonus (shifted variation)
1320 % This note head is used instead of the regular epiphonus punctum to
1321 % avoid collision with the plica head when the plica sits directly on
1322 % top of the lower head.
1324 epiphonus_char ("Ed. Vat. var epiphonus", "vaticana.vepiphonus",
1325 false, true, true, 1.0);
1328 % small punctum as used in cephalicus
1329 vat_punctum_char ("Ed. Vat. rev. plica", "vaticana.reverse.plica",
1330 false, false, false, false,
1331 true, false, false, 0.6);
1334 % small punctum as used in cephalicus
1335 plica_char ("Ed. Vat. rev. var plica", "vaticana.reverse.vplica",
1339 % eccentric punctum as used in cephalicus; without left stem
1340 epiphonus_char ("Ed. Vat. inner cephalicus", "vaticana.inner.cephalicus",
1341 false, false, false, 1.0);
1344 % eccentric punctum as used in cephalicus; with left stem
1345 epiphonus_char ("Ed. Vat. cephalicus", "vaticana.cephalicus",
1346 true, false, false, 1.0);
1350 fet_beginchar ("Ed. Vat. quilisma", "svaticana.quilisma");
1353 a_b := 1.54; % b_h * a_b / a_w = wd / ht
1357 save a, beta, ht, wd;
1364 set_char_box (0, 0.42 wd#, 0.28 ht#, 0.36 ht#);
1366 black_notehead_width# := wd#;
1368 define_pixels (ht, wd);
1374 T := identity xscaled linethickness
1376 pickup pencircle transformed T;
1377 ellipse := reverse fullcircle transformed T;
1379 z1 = (rt 0.00 wd, top -0.28 ht);
1380 z2 = (0.11 wd, -0.14 ht);
1381 z3 = (0.12 wd, +0.03 ht);
1382 z4 = (0.25 wd, -0.09 ht);
1383 z5 = (0.25 wd, +0.08 ht);
1384 z6 = (lft 0.42 wd, -0.04 ht);
1385 z7 = (lft 0.40 wd, bot +0.36 ht);
1387 fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
1388 -- get_subpath (ellipse, z2 - z1, z1 - z2, z2)
1390 fill get_subpath (ellipse, z3 - z4, z4 - z3, z3)
1391 -- get_subpath (ellipse, z4 - z3, z3 - z4, z4)
1393 fill get_subpath (ellipse, z5 - z6, z6 - z5, z5)
1394 -- point 0 of get_subpath (ellipse, z6 - z5, z5 - z6, z6)
1395 -- get_subpath (ellipse, z7 - z6, z6 - z7, z7)
1396 -- get_subpath (ellipse, z6 - z7, z5 - z6, z6)
1399 labels (1, 2, 3, 4, 5, 6, 7);
1403 % solesmes punctum inclinatum parvum
1404 inclinatum_char ("Solesmes punctum inclinatum parvum", "solesmes.incl.parvum",
1405 true, false, false);
1408 % solesmes punctum auctum ascendens
1409 vat_punctum_char ("Solesmes punctum auctum ascendens", "solesmes.auct.asc",
1410 false, false, false, true,
1411 true, false, false, 1.0);
1414 % solesmes punctum auctum descendens
1415 vat_punctum_char ("Solesmes punctum auctum descendens", "solesmes.auct.desc",
1416 false, false, false, true,
1417 false, false, false, 1.0);
1420 % solesmes punctum inclinatum auctum
1421 inclinatum_char ("Solesmes punctum incl. auctum", "solesmes.incl.auctum",
1422 false, false, true);
1426 inclinatum_char ("Solesmes stropha", "solesmes.stropha",
1427 false, true, false);
1430 % solesmes stropha aucta
1431 inclinatum_char ("Solesmes stropha aucta", "solesmes.stropha.aucta",
1436 fet_beginchar ("Solesmes oriscus", "ssolesmes.oriscus");
1439 a_b := 1.54; % b_h * a_b / a_w = wd / ht
1443 save a, beta, ht, wd;
1449 black_notehead_width# := wd#;
1453 convexity# = +0.05 ht#;
1455 define_pixels (ht, wd, convexity);
1457 set_char_box (0.00 wd#, 0.50 wd#,
1458 0.25 ht# + convexity#, 0.25 ht# + convexity#);
1460 z1 = (0.00 wd + blot_diameter / 2, -convexity);
1461 z2 = (1/6 wd, +convexity);
1462 z3 = (2/6 wd, -convexity);
1463 z4 = (0.50 wd - blot_diameter / 2, +convexity);
1468 height = 2 ypart (directionpoint right of (z1
1477 T := identity xscaled blot_diameter
1478 yscaled (h + d - height);
1479 pickup pencircle transformed T;
1480 ellipse := fullcircle transformed T;
1482 % Adjust vertical coordinates to touch bounding box.
1489 d_ := direction 0 of (z1
1494 fill get_subpath (ellipse, -d_, d_, z1)
1497 .. get_subpath (ellipse, d_, -d_, z4)
1502 labels (1, 2, 3, 4);
1516 fet_beginchar ("Ed. Med. inclinatum", "smedicaea.inclinatum");
1517 draw_diamond_head (1.2 staff_space#, 0, 0, 35, false);
1521 def med_punctum_char (expr verbose_name, internal_name,
1522 left_up_stem, left_down_stem) =
1523 fet_beginchar (verbose_name, "s" & internal_name);
1526 ht# = 2 staff_space#;
1528 black_notehead_width# := wd#;
1530 define_pixels (ht, wd);
1535 ellipse := fullcircle xscaled blot_diameter
1538 z1 = (0.00 wd + blot_diameter / 2, 0);
1539 z2 = (0.4 wd - blot_diameter / 2, 0);
1543 pickup pencircle scaled linethickness;
1546 z4 = (0.00 wd + linethickness / 2, -1.25 ht);
1548 fill get_subpath (ellipse, left, down, z1)
1552 -- (rt x4, -.5 ht / 2)
1553 -- get_subpath (ellipse, right, left, z2)
1558 set_char_box (0.0, 0.4 wd#, 1.25 ht#, 0.25 ht#);
1559 elseif left_up_stem:
1560 z4 = (0.00 wd + linethickness / 2, +1.25 ht);
1562 fill get_subpath (ellipse, down, right, z1)
1563 -- get_subpath (ellipse, right, left, z2)
1564 -- (rt x4, .5 ht / 2)
1572 set_char_box (0.0, 0.4 wd#, 0.25 ht#, 1.25 ht#);
1574 fill get_subpath (ellipse, left, right, z1)
1575 -- get_subpath (ellipse, right, left, z2)
1578 set_char_box (0.0, 0.4 wd#, 0.25 ht#, 0.25 ht#);
1586 med_punctum_char ("Ed. Med. punctum", "medicaea.punctum",
1590 % left up-stemmed punctum
1591 med_punctum_char ("Ed. Med. reverse virga", "medicaea.rvirga",
1595 % virga (i.e. left down-stemmed punctum)
1596 med_punctum_char ("Ed. Med. virga", "medicaea.virga",
1609 def huf_punctum_char (expr verbose_name, internal_name,
1611 fet_beginchar (verbose_name, "s" & internal_name);
1616 draw_diamond_head (staff_space#, 0, 0, alpha, false);
1619 set_char_box (0, head_width#,
1620 1.5 staff_space#, head_height# / 2);
1625 ellipse := reverse fullcircle xscaled blot_diameter
1626 yscaled 0.7 staff_space
1629 z11 = (head_width / 2, 0);
1630 z12 = find_tangent_shift (((0, -d) -- (w, -d)), ellipse,
1631 (w / 2, -d), (w / 2, 0));
1633 fill get_subpath (ellipse, up, down, z11)
1634 -- get_subpath (ellipse, down, up, z12)
1644 huf_punctum_char ("Hufnagel punctum", "hufnagel.punctum", false)
1648 huf_punctum_char ("Hufnagel virga", "hufnagel.virga", true)
1652 fet_beginchar ("Hufnagel pes lower punctum", "shufnagel.lpes")
1653 save width, height, alpha;
1655 width# = 2 * staff_space#;
1656 height# = 0.7 * staff_space#;
1659 set_char_box (0, width#, height# / 2, height# / 2);
1661 define_pixels (width, height);
1666 circle := reverse fullcircle scaled linethickness;
1668 pickup pencircle scaled linethickness;
1670 rt x3 = -lft x1 = width / 2;
1671 y2 = y3 = height / 2;
1672 y1 = y4 = -height / 2;
1674 tand (alpha) * (y2 - y1) = x2 - x1 = x3 - x4;
1676 fill get_subpath (circle, left, z2 - z1, z1)
1677 -- get_subpath (circle, z2 - z1, right, z2)
1678 -- get_subpath (circle, right, z4 - z3, z3)
1679 -- get_subpath (circle, z4 - z3, left, z4)
1682 currentpicture := currentpicture shifted (width/2, 0);
1684 % labels (1, 2, 3, 4);
1688 fet_endgroup ("noteheads");