]> git.donarmstrong.com Git - lilypond.git/blob - mf/parmesan-noteheads.mf
Improves parmesan noteheads.
[lilypond.git] / mf / parmesan-noteheads.mf
1 % Feta (not the Font-En-Tja) music font --  ancient note heads
2 % This file is part of LilyPond, the GNU music typesetter.
3 %
4 % Copyright (C) 2001--2011 Juergen Reuter <reuter@ipd.uka.de>
5 %
6 % Neo-mensural heads originally by
7 % Christian Mondrup and Mats Bengtsson
8 %
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.
13 %
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.
18 %
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/>.
21
22 save black_notehead_width;
23 numeric black_notehead_width;
24
25 fet_begingroup ("noteheads");
26
27 %
28 % character aligment:
29 %
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).
33 %
34 % set_char_box() conventions:
35 %
36 % * breapth: Ignored (as far as I know).  Should be set to 0.
37 %
38 % * width: Should match the head's width.
39 %
40 % * depth: Should match the bottom edge of the head.  Affects vertical
41 %   collision handling.
42 %
43 % * height: Should match the top edge of the head.  Affects vertical
44 %   collision handling.
45 %
46 % TODO: should depth/height include appendages/stems?
47
48 save overdone_heads, noteheight;
49
50 overdone_heads = 0;
51 noteheight# := staff_space# + (1 + overdone_heads) * stafflinethickness#;
52 define_pixels (noteheight);
53
54
55 %%%%%%%%
56 %
57 %
58 %
59 % NEO-MENSURAL NOTATION
60 %
61 %
62 %
63
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;
67
68         head_width# := brevwid;
69         head_height# := noteheight#;
70         stem_width := 1.3 linethickness;
71
72         define_pixels (head_width, head_height);
73
74         set_char_box (0, head_width#,
75                       head_height# / 2, head_height# / 2);
76
77         2 beamheight + holeheight = head_height;
78         serif_size := .75 linethickness;
79         serif_protrude := .15 head_height;
80
81         z1l = (0, 0);
82         z2l = (0, - (holeheight - 2 serif_size) / 2);
83         z3r = z2r + serif_size * (1, -1);
84         y4r = y3r;
85         x4r = head_width / 2;
86         z5l = z3l + (-serif_size, -serif_protrude);
87
88         penpos1 (stem_width, 0);
89         penpos2 (stem_width, 0);
90         penpos3 (beamheight, 90);
91         penpos4 (beamheight, 90);
92         penpos5 (stem_width, 180);
93
94         save pat_out;
95         path pat_out;
96
97         pat_out := z4l
98                    -- z3l{left}
99                    .. z5l{down}
100                    .. z5r{up}
101                    -- z1l;
102         pat_out := pat_out
103                    -- reverse pat_out yscaled -1;
104         pat_out := pat_out
105                    -- reverse pat_out shifted (-x4r, 0)
106                                       xscaled -1
107                                       shifted (x4l, 0)
108                    -- cycle;
109         fill pat_out;
110
111         if open:
112                 save pat_in;
113                 path pat_in;
114
115                 pat_in := z4r
116                           -- z3r{left}
117                           .. z2r{up}
118                           -- z1r;
119                 pat_in := pat_in
120                           -- reverse pat_in yscaled -1;
121                 if full:
122                         pat_in := pat_in
123                                   -- reverse pat_in shifted (-x4r, 0)
124                                                     xscaled -1
125                                                     shifted (x4l, 0);
126                 fi;
127                 pat_in := pat_in
128                           -- cycle;
129                 unfill pat_in;
130         fi;
131
132         penlabels (1, 2, 3, 4, 5);
133 enddef;
134
135
136 %
137 % Some sources (eg. Musix/OpusTeX) think that the appendage should be on
138 % the left, some say right.  Right wins democratically.
139 %
140 def draw_neomensural_longa (expr wid, holeheight, direction) =
141         draw_neomensural_brevis (wid, holeheight, true, true);
142
143         save theta, dir;
144         dir := -direction;
145
146         x7 = head_width - stem_width / 2;
147         y7 = dir * y5;
148         z6 - z7 = (stem_width / 2, -dir * staff_space);
149         theta = dir * angle (z6 - z7) + 90;
150
151         penpos7 (stem_width, 0);
152         penpos6 (1.2 stem_width, theta);
153
154         z7' = find_tangent (z6l, pat_out,
155                             (x7l + 0.5 stem_width, y7l),
156                             (x7l - 0.5 stem_width, y7l));
157
158         fill z7r
159              .. z6r{z6 - z7}
160              .. {z7 - z6}z6l
161              -- z7'
162              -- cycle;
163
164         penlabels (6, 7);
165         labels (7');
166 enddef;
167
168
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;
173
174         penthickness# = linethickness#;
175         head_height# := height + penthickness#;
176         head_width# := wid + penthickness#;
177         stem_width# := 1.3 linethickness#;
178
179         set_char_box (0, head_width#,
180                       head_height# / 2, head_height# / 2);
181
182         charwx := head_width# / 2;
183         charwy := head_height# / 2 - 2 stem_width#;
184
185         define_pixels (penthickness);
186
187         y3 = y1 = 0;
188         x2 = x4 = 1/2 [x1, x3];
189
190         pickup pencircle scaled penthickness;
191
192         top y2 = h;
193         bot y4 = -d;
194         lft x1 = 0;
195         rt x3 = w;
196
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;
201
202         fill lft z1
203              .. (z1 + nw_dist)
204              -- (z2 + nw_dist)
205              .. top z2
206              .. (z2 + ne_dist)
207              -- (z3 + ne_dist)
208              .. rt z3
209              .. (z3 - nw_dist)
210              -- (z4 - nw_dist)
211              .. bot z4
212              .. (z4 - ne_dist)
213              -- (z1 - ne_dist)
214              .. cycle;
215
216         labels (1, 2, 3, 4);
217 enddef;
218
219
220 def draw_neomensural_open_head (expr wid, height)=
221         draw_neomensural_black_head (wid, height);
222
223         save headNW, headSW, stem_width;
224
225         headNW = length (z2 - z1) + penthickness;
226         headSW = length (z4 - z1) + penthickness;
227         stem_width = 1.3 linethickness;
228
229         save hole_widthNW, hole_widthSW;
230
231         hole_widthNW = .25 headNW;
232         hole_widthSW + 2 stem_width = headSW;
233
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);
238
239         unfill lft z5
240                .. (z5 + nw_dist)
241                -- (z6 + nw_dist)
242                .. top z6
243                .. (z6 + ne_dist)
244                -- (z7 + ne_dist)
245                .. rt z7
246                .. (z7 - nw_dist)
247                -- (z8 - nw_dist)
248                .. bot z8
249                .. (z8 - ne_dist)
250                -- (z5 - ne_dist)
251                .. cycle;
252
253         labels (5, 6, 7, 8);
254 enddef;
255
256
257 %
258 % Neo-mensural maxima/longa/brevis
259 %
260 % En wij presenteren U: de opvolgster van Emily
261 %
262 % (ze is wel breed)
263 %
264
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;
272
273 fet_beginchar ("Neo-mensural maxima notehead (up)", "uM3neomensural");
274         draw_neomensural_longa (nm_maxima_width, nm_holeheight, 1);
275 fet_endchar;
276
277 fet_beginchar ("Neo-mensural maxima notehead (down)", "dM3neomensural");
278         draw_neomensural_longa (nm_maxima_width, nm_holeheight, -1);
279 fet_endchar;
280
281 fet_beginchar ("Neo-mensural longa notehead (up)", "uM2neomensural");
282         draw_neomensural_longa (nm_longa_width, nm_holeheight, 1);
283 fet_endchar;
284
285 fet_beginchar ("Neo-mensural longa notehead (down)", "dM2neomensural");
286         draw_neomensural_longa (nm_longa_width, nm_holeheight, -1);
287 fet_endchar;
288
289 fet_beginchar ("Neo-mensural brevis notehead", "sM1neomensural");
290         draw_neomensural_brevis (nm_brevis_width, nm_holeheight, true, true);
291 fet_endchar;
292
293 fet_beginchar ("Neo-mensural maxima notehead (up, reduced hole)", "urM3neomensural");
294         draw_neomensural_longa (nm_maxima_width, nm_red_holeheight, 1);
295 fet_endchar;
296
297 fet_beginchar ("Neo-mensural maxima notehead (down, reduced hole)", "drM3neomensural");
298         draw_neomensural_longa (nm_maxima_width, nm_red_holeheight, -1);
299 fet_endchar;
300
301 fet_beginchar ("Neo-mensural longa notehead (up, reduced hole)", "urM2neomensural");
302         draw_neomensural_longa (nm_longa_width, nm_red_holeheight, 1);
303 fet_endchar;
304
305 fet_beginchar ("Neo-mensural longa notehead (down, reduced hole)", "drM2neomensural");
306         draw_neomensural_longa (nm_longa_width, nm_red_holeheight, -1);
307 fet_endchar;
308
309 fet_beginchar ("Neo-mensural brevis notehead (reduced hole)", "srM1neomensural");
310         draw_neomensural_brevis (nm_brevis_width, nm_red_holeheight, true, true);
311 fet_endchar;
312
313
314 %
315 % Neo-mensural semibrevis/minima/semiminima
316 %
317
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);
323 fet_endchar;
324
325 fet_beginchar ("Neo-mensural minima head", "s1neomensural");
326         draw_neomensural_open_head (nm_width, nm_height);
327 fet_endchar;
328
329 fet_beginchar ("Neo-mensural semiminima head", "s2neomensural");
330         draw_neomensural_black_head (nm_width, nm_height);
331 fet_endchar;
332
333 %%%%%%%%
334 %
335 %
336 %
337 % HARMONIC NOTATION
338 %
339 %
340 %
341
342 %
343 % WL says the thin lines should be thinner.
344 %
345
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#;
349         charwy := 0;
350 fet_endchar;
351
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#;
355         charwy := 0;
356 fet_endchar;
357
358
359 %%%%%%%%
360 %
361 %
362 %
363 % MENSURAL/PETRUCCI NOTATIONS
364 %
365 %
366 %
367
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);
371 enddef;
372
373
374 def draw_mensural_longa (expr wid, holeheight, open, full, direction) =
375         draw_mensural_brevis (wid, holeheight, open, full);
376
377         save dir;
378         dir := -direction;
379
380         x6 = x7 = head_width - stem_width / 2;
381         y6 = dir * y5;
382         y7 = dir * y5 -1.75 dir * staff_space;
383
384         z17 = (x7, y7 - dir * stem_width / 2);
385
386         penpos6 (stem_width, 0);
387         penpos7 (1.5 stem_width, 0);
388
389         fill z7l
390              -- z6l
391              -- z6r
392              -- z7r
393              .. z17
394              .. cycle;
395
396         penlabels (6, 7);
397         labels (17);
398 enddef;
399
400
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;
405
406         head_height# = head_h;
407         head_width# / head_height# = tand (angle);
408
409         set_char_box (0, head_width#,
410                       head_height# / 2, head_height# / 2);
411
412         charwx := head_width# / 2;
413         charwy := head_height# / 2 - 2 linethickness#;
414
415         define_pixels (head_width, head_height);
416
417         ellipse := reverse fullcircle
418                      xscaled (max (blot_diameter, pen_w * head_width))
419                      yscaled (max (blot_diameter, pen_h * head_width))
420                      rotated -angle;
421
422         z1 = find_tangent_shift (((0, h) -- (0, -h)), ellipse,
423                                  (0, 0), (w / 2, 0));
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,
427                                  (w, 0), (w / 2, 0));
428         z4 = find_tangent_shift (((0, -h) -- (w, -h)), ellipse,
429                                  (w / 2, -h), (w / 2, 0));
430
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)
435                          -- cycle;
436         fill diamond_shape;
437
438         if open:
439                 save l;
440                 path l[];
441
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;
450
451                 unfill l12 intersectionpoint l23
452                        -- l23 intersectionpoint l34
453                        -- l34 intersectionpoint l41
454                        -- l41 intersectionpoint l12
455                        -- cycle;
456         fi;
457
458         labels (1, 2, 3, 4);
459 enddef;
460
461
462 %
463 % Mensural/Petrucci maxima/longa/brevis
464 %
465
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;
473
474 fet_beginchar ("Mensural maxima notehead (up)", "uM3mensural");
475         draw_mensural_longa (m_maxima_width, m_holeheight, true, true, 1);
476 fet_endchar;
477
478 fet_beginchar ("Mensural maxima notehead (down)", "dM3mensural");
479         draw_mensural_longa (m_maxima_width, m_holeheight, true, true, -1);
480 fet_endchar;
481
482 fet_beginchar ("Mensural maxima notehead (ligature)", "sM3ligmensural");
483         draw_mensural_brevis (m_maxima_width, m_holeheight, true, true);
484 fet_endchar;
485
486 fet_beginchar ("Mensural longa notehead (up)", "uM2mensural");
487         draw_mensural_longa (m_longa_width, m_holeheight, true, true, 1);
488 fet_endchar;
489
490 fet_beginchar ("Mensural longa notehead (down)", "dM2mensural");
491         draw_mensural_longa (m_longa_width, m_holeheight, true, true, -1);
492 fet_endchar;
493
494 fet_beginchar ("Mensural brevis notehead", "sM1mensural");
495         draw_mensural_brevis (m_brevis_width, m_holeheight, true, true);
496 fet_endchar;
497
498 fet_beginchar ("Mensural maxima notehead (up, reduced hole)", "urM3mensural");
499         draw_mensural_longa (m_maxima_width, m_red_holeheight, true, true, 1);
500 fet_endchar;
501
502 fet_beginchar ("Mensural maxima notehead (down, reduced hole)", "drM3mensural");
503         draw_mensural_longa (m_maxima_width, m_red_holeheight, true, true, -1);
504 fet_endchar;
505
506 fet_beginchar ("Mensural maxima notehead (ligature, reduced hole)", "srM3ligmensural");
507         draw_mensural_brevis (m_maxima_width, m_red_holeheight, true, true);
508 fet_endchar;
509
510 fet_beginchar ("Mensural longa notehead (up, reduced hole)", "urM2mensural");
511         draw_mensural_longa (m_longa_width, m_red_holeheight, true, true, 1);
512 fet_endchar;
513
514 fet_beginchar ("Mensural longa notehead (down, reduced hole)", "drM2mensural");
515         draw_mensural_longa (m_longa_width, m_red_holeheight, true, true, -1);
516 fet_endchar;
517
518 fet_beginchar ("Mensural brevis notehead (reduced hole)", "srM1mensural");
519         draw_mensural_brevis (m_brevis_width, m_red_holeheight, true, true);
520 fet_endchar;
521
522
523 %
524 % Semi-colored mensural/Petrucci maxima/longa/brevis
525 %
526
527 fet_beginchar ("Semi-colored mensural maxima notehead (up)", "uM3semimensural");
528         draw_mensural_longa (m_maxima_width, m_holeheight, true, false, 1);
529 fet_endchar;
530
531 fet_beginchar ("Semi-colored mensural maxima notehead (down)", "dM3semimensural");
532         draw_mensural_longa (m_maxima_width, m_holeheight, true, false, -1);
533 fet_endchar;
534
535 fet_beginchar ("Semi-colored mensural maxima notehead (ligature)", "sM3semiligmensural");
536         draw_mensural_brevis (m_maxima_width, m_holeheight, true, false);
537 fet_endchar;
538
539 fet_beginchar ("Semi-colored mensural longa notehead (up)", "uM2semimensural");
540         draw_mensural_longa (m_longa_width, m_holeheight, true, false, 1);
541 fet_endchar;
542
543 fet_beginchar ("Semi-colored mensural longa notehead (down)", "dM2semimensural");
544         draw_mensural_longa (m_longa_width, m_holeheight, true, false, -1);
545 fet_endchar;
546
547 fet_beginchar ("Semi-colored mensural brevis notehead", "sM1semimensural");
548         draw_mensural_brevis (m_brevis_width, m_holeheight, true, false);
549 fet_endchar;
550
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);
553 fet_endchar;
554
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);
557 fet_endchar;
558
559 fet_beginchar ("Semi-colored mensural maxima notehead (ligature, reduced hole)", "srM3semiligmensural");
560         draw_mensural_brevis (m_maxima_width, m_red_holeheight, true, false);
561 fet_endchar;
562
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);
565 fet_endchar;
566
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);
569 fet_endchar;
570
571 fet_beginchar ("Semi-colored mensural brevis notehead (reduced hole)", "srM1semimensural");
572         draw_mensural_brevis (m_brevis_width, m_red_holeheight, true, false);
573 fet_endchar;
574
575
576 %
577 % Black mensural/Petrucci maxima/longa/brevis
578 %
579
580 fet_beginchar ("Black mensural maxima notehead (up)", "uM3blackmensural");
581         draw_mensural_longa (m_maxima_width, 0, false, false, 1);
582 fet_endchar;
583
584 fet_beginchar ("Black mensural maxima notehead (down)", "dM3blackmensural");
585         draw_mensural_longa (m_maxima_width, 0, false, false, -1);
586 fet_endchar;
587
588 fet_beginchar ("Black mensural maxima notehead (ligature)", "sM3blackligmensural");
589         draw_mensural_brevis (m_maxima_width, 0, false, false);
590 fet_endchar;
591
592 fet_beginchar ("Black mensural longa notehead (up)", "uM2blackmensural");
593         draw_mensural_longa (m_longa_width, 0, false, false, 1);
594 fet_endchar;
595
596 fet_beginchar ("Black mensural longa notehead (down)", "dM2blackmensural");
597         draw_mensural_longa (m_longa_width, 0, false, false, -1);
598 fet_endchar;
599
600 fet_beginchar ("Black mensural brevis notehead", "sM1blackmensural");
601         draw_mensural_brevis (m_brevis_width, 0, false, false);
602 fet_endchar;
603
604
605 %
606 % Mensural semibrevis/minima/semiminima
607 %
608
609 fet_beginchar ("Mensural semibrevis head", "s0mensural");
610         draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
611 fet_endchar;
612
613 fet_beginchar ("Mensural minima head", "s1mensural");
614         draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
615 fet_endchar;
616
617 fet_beginchar ("Mensural semiminima head", "s2mensural");
618         draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
619 fet_endchar;
620
621
622 %
623 % Black mensural semibrevis/minima/semiminima
624 %
625
626 fet_beginchar ("Black mensural semibrevis head", "s0blackmensural");
627         draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
628 fet_endchar;
629
630
631 %
632 % Petrucci semibrevis/minima/semiminima
633 %
634 % These values can be measured in several sources.
635 % I used "Modulis ex sacris literis delecti, Liber primus"
636 % Josquin Desprez, BNF
637
638 save petrucci_width, petrucci_height;
639 petrucci_height := 1.3 noteheight#;
640 petrucci_width := .72 petrucci_height;
641
642 fet_beginchar ("Petrucci semibrevis head", "s0petrucci");
643         draw_neomensural_open_head (petrucci_width, petrucci_height);
644 fet_endchar;
645
646 fet_beginchar ("Petrucci minima head", "s1petrucci");
647         draw_neomensural_open_head (petrucci_width, petrucci_height);
648 fet_endchar;
649
650 fet_beginchar ("Petrucci semiminima head", "s2petrucci");
651         draw_neomensural_black_head (petrucci_width, petrucci_height);
652 fet_endchar;
653
654
655 %
656 % Black Petrucci semibrevis/minima/semiminima
657 %
658
659 fet_beginchar ("Petrucci colored semibrevis head", "s0blackpetrucci");
660         draw_neomensural_black_head (petrucci_width, petrucci_height);
661 fet_endchar;
662
663 fet_beginchar ("Petrucci colored minima head", "s1blackpetrucci");
664         draw_neomensural_black_head (petrucci_width, petrucci_height);
665 fet_endchar;
666
667 fet_beginchar ("Petrucci colored semiminima head", "s2blackpetrucci");
668         draw_neomensural_black_head (petrucci_width, petrucci_height);
669 fet_endchar;
670
671
672 %%%%%%%%
673 %
674 %
675 %
676 % EDITIO VATICANA (including solesmes extensions)
677 %
678 %
679 %
680
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);
685                 save a_b, b_h, a_w;
686
687                 a_b := 1.54; % b_h * a_b / a_w = wd / ht
688                 b_h := 0.85;
689                 a_w := 1.09;
690
691                 save a, beta, ht, wd;
692
693                 ht# = noteheight# * mag;
694                 2 beta = ht# * b_h;
695                 a = beta * a_b;
696                 wd# = 2 a / a_w;
697                 black_notehead_width# := wd#;
698
699                 % direction
700                 save d_, d_sign;
701                 pair d_;
702
703                 if d_up:
704                         d_ := up;
705                         d_sign := 1;
706                 else:
707                         d_ := down;
708                         d_sign := -1;
709                 fi;
710
711                 % convexity and eccentricity
712                 save u_convexity, u_eccentricity;
713
714                 if straight:
715                         u_convexity# := -0.01 ht#;
716                         u_eccentricity# := 0.0 ht#; % dummy
717                 elseif auctum:
718                         u_convexity# := -0.03 ht#;
719                         u_eccentricity# := +0.25 ht#;
720                 else:
721                         u_convexity# := -0.05 ht#;
722                         u_eccentricity# := 0.0 ht#; % dummy
723                 fi;
724
725                 save convexity, eccentricity;
726
727                 convexity# := d_sign * u_convexity#;
728                 eccentricity# := d_sign * u_eccentricity#;
729
730                 % y shift offset
731                 save yoffs;
732
733                 if up_shift:
734                         yoffs# := 0.08 ht#;
735                 elseif down_shift:
736                         yoffs# := -0.11 ht#;
737                 else:
738                         yoffs# := 0.00 ht#;
739                 fi;
740
741                 define_pixels (convexity, eccentricity, yoffs, ht, wd);
742
743                 pickup pencircle scaled linethickness;
744
745                 save height, yoffs_bt, p, circle, circle_r;
746                 path p, circle, circle_r;
747
748                 height# = 0.47 ht#;
749                 yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
750
751                 define_pixels (height, yoffs_bt);
752
753                 circle := fullcircle scaled linethickness;
754
755                 x1 = x6;
756                 x2 = x5;
757                 x3 = x4;
758                 y1 + height = y6;
759                 y2 + height = y5;
760                 y3 + height = y4;
761
762                 save box_top, box_bt;
763
764                 if auctum:
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#);
773                         p = z1
774                             .. {right}z2
775                             .. {d_}z3
776                             -- z4{-d_}
777                             .. z5{left}
778                             .. z6
779                             -- cycle;
780                 else:
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#);
786                         p = z1
787                             .. z2
788                             .. z3
789                             -- z4
790                             .. z5
791                             .. z6
792                             -- cycle;
793                 fi;
794
795                 labels (1, 2, 3, 4, 5, 6);
796
797                 save dirs;
798                 pair dirs[];
799
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;
806
807                 fill get_subpath (circle, down, dirs12, z1)
808                      .. (bot z2){dirs2}
809                      .. get_subpath (circle, dirs32, up, z3)
810                      -- get_subpath (circle, up, dirs45, z4)
811                      .. (top z5){dirs5}
812                      .. get_subpath (circle, dirs65, down, z6)
813                      -- cycle;
814
815                 if cavum:
816                         save pat, t;
817                         path pat[];
818                         numeric t[];
819
820                         pat123 := ((directionpoint -dirs12 of circle)
821                                     shifted z1){dirs12}
822                                   .. (top z2){dirs2}
823                                   .. {dirs32}((directionpoint -dirs32 of circle)
824                                        shifted z3);
825                         pat34 := lft z3
826                                  -- lft z4;
827                         pat456 := ((directionpoint -dirs45 of circle)
828                                     shifted z4){dirs45}
829                                   .. (bot z5){dirs5}
830                                   .. {dirs65}((directionpoint -dirs65 of circle)
831                                        shifted z6);
832                         pat61 := rt z6
833                                  -- rt z1;
834
835                         t61 := ypart (pat61 intersectiontimes pat123);
836                         t12 := xpart (pat123 intersectiontimes pat34);
837                         t34 := ypart (pat34 intersectiontimes pat456);
838                         t45 := xpart (pat456 intersectiontimes pat61);
839
840                         unfill subpath (t61, t12) of pat123
841                                -- subpath (t34, t45) of pat456
842                                -- cycle;
843                 fi;
844
845                 set_char_box (0.00 wd#, 0.42 wd#,
846                               max (0, -box_bt#) + linethickness# / 2,
847                               max (0, box_top#) + linethickness# / 2);
848
849                 if linea:
850                         save linea_width, linea_height;
851
852                         linea_width# = 0.6 linethickness#;
853                         linea_height# = 0.7 ht#;
854
855                         define_pixels (linea_width, linea_height);
856
857                         pickup pencircle scaled 0.6 linethickness;
858
859                         draw_rounded_block ((-0.10 wd - linea_width / 2,
860                                              -linea_height / 2),
861                                             (-0.10 wd + linea_width / 2,
862                                              +linea_height / 2),
863                                             0.6 linethickness);
864                         draw_rounded_block ((+0.52 wd - linea_width / 2,
865                                              -linea_height / 2),
866                                             (+0.52 wd + linea_width / 2,
867                                              +linea_height / 2),
868                                             0.6 linethickness);
869
870                         set_char_box (0, 0.62 wd# + linea_width#,
871                                       linea_height# / 2,
872                                       linea_height# / 2);
873
874                         currentpicture := currentpicture
875                                 shifted (0.10 wd + linea_width / 2, 0);
876                 fi;
877         fet_endchar;
878 enddef;
879
880
881 def plica_char (expr verbose_name, internal_name,
882                      d_up, mag) =
883         fet_beginchar (verbose_name, "s" & internal_name);
884                 save a_b, b_h, a_w;
885
886                 a_b := 1.54; % b_h * a_b / a_w = wd / ht
887                 b_h := 0.85;
888                 a_w := 1.09;
889
890                 save a, beta, ht, wd;
891
892                 ht# = noteheight# * mag;
893                 2 beta = ht# * b_h;
894                 a = beta * a_b;
895                 wd# = 2 a / a_w;
896                 black_notehead_width# := wd#;
897
898                 % direction
899                 save d_, d_sign;
900                 pair d_;
901
902                 if d_up:
903                         d_ := up;
904                         d_sign := 1;
905                 else:
906                         d_ := down;
907                         d_sign := -1;
908                 fi;
909
910                 % convexity and eccentricity
911                 save convexity, eccentricity;
912
913                 convexity# := d_sign * -0.10 ht#;
914                 eccentricity# := d_sign * -0.12 ht#;
915
916                 % y shift offset
917                 save yoffs;
918
919                 yoffs# := -0.11 ht#;
920
921                 define_pixels (convexity, eccentricity, yoffs, ht, wd);
922
923                 pickup pencircle scaled linethickness;
924
925                 save height, yoffs_bt, p, circle, circle_r;
926                 path p, circle, circle_r;
927
928                 height# = 0.47 ht#;
929                 yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
930
931                 define_pixels (height, yoffs_bt);
932
933                 circle := fullcircle scaled linethickness;
934
935                 x1 = x6;
936                 x2 = x5;
937                 x3 = x4;
938                 y1 + height = y6;
939                 y2 + height = y5;
940                 y3 + height = y4;
941
942                 save box_top, box_bt;
943
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#);
951                 p = z1
952                     .. z2{right}
953                     .. z3
954                     -- z4
955                     .. z5{left}
956                     .. z6
957                     -- cycle;
958
959                 labels (1, 2, 3, 4, 5, 6);
960
961                 save dirs;
962                 pair dirs[];
963
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;
970
971                 fill get_subpath (circle, down, dirs12, z1)
972                      .. (bot z2){dirs2}
973                      .. get_subpath (circle, dirs32, up, z3)
974                      -- get_subpath (circle, up, dirs45, z4)
975                      .. (top z5){dirs5}
976                      .. get_subpath (circle, dirs65, down, z6)
977                      -- cycle;
978
979                 pickup pencircle scaled 0.6 linethickness;
980
981                 save stem_bt;
982
983                 set_char_box (0.00 wd#, 0.42 wd#,
984                               max (0, -box_bt#) + linethickness# / 2,
985                               max (0, box_top#) + linethickness# / 2);
986
987         fet_endchar;
988 enddef;
989
990
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);
994                 save a_b, b_h, a_w;
995
996                 a_b := 1.54; % b_h * a_b / a_w = wd / ht
997                 b_h := 0.85;
998                 a_w := 1.09;
999
1000                 save a, beta, ht, wd;
1001
1002                 ht# = noteheight# * mag;
1003                 2 beta = ht# * b_h;
1004                 a = beta * a_b;
1005                 wd# = 2 a / a_w;
1006                 black_notehead_width# := wd#;
1007
1008                 % direction
1009                 save d_, d_sign;
1010                 pair d_;
1011
1012                 if d_up:
1013                         d_ := up;
1014                         d_sign := 1;
1015                 else:
1016                         d_ := down;
1017                         d_sign := -1;
1018                 fi;
1019
1020                 % convexity and eccentricity
1021                 save convexity;
1022
1023                 convexity# := d_sign * -0.05ht#;
1024
1025                 % y shift offset
1026                 save yoffs;
1027
1028                 if down_shift:
1029                         yoffs# := -0.11 ht#;
1030                 else:
1031                         yoffs# := 0.00 ht#;
1032                 fi;
1033
1034                 define_pixels (convexity, yoffs, ht, wd);
1035
1036                 pickup pencircle scaled linethickness;
1037
1038                 save height, yoffs_bt, p, circle, circle_r;
1039                 path p, circle, circle_r;
1040
1041                 height# = 0.47 ht#;
1042                 yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
1043
1044                 define_pixels (height, yoffs_bt);
1045
1046                 circle := fullcircle scaled linethickness;
1047
1048                 x1 = x6;
1049                 x2 = x5;
1050                 x3 = x4;
1051                 y1 + height = y6;
1052                 y2 + height = y5;
1053                 y3 + height = y4;
1054
1055                 save box_top, box_bt;
1056
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);
1064                 p = z1{-d_}
1065                     .. {curl 1}z2{right}
1066                     .. z3
1067                     -- z4
1068                     .. {left}z5{curl 1}
1069                     .. {d_}z6
1070                     -- cycle;
1071
1072                 labels (1, 2, 3, 4, 5, 6);
1073
1074                 save dirs;
1075                 pair dirs[];
1076
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;
1085
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)
1092                      -- cycle;
1093
1094                 save stem_bt;
1095
1096                 if left_stem:
1097                         pickup pencircle scaled 0.6 linethickness;
1098
1099                         lft x11 = x1 - linethickness / 2;
1100                         bot y11 = yoffs - 1.1 ht - linethickness / 2;
1101                         x12 = x11;
1102                         y12 = y1;
1103
1104                         draw_rounded_block (bot lft z11, top rt z12,
1105                                             0.6 linethickness);
1106                         stem_bt# = yoffs# - 1.1 ht#;
1107
1108                         labels (11, 12);
1109                 else:
1110                         stem_bt# = 0;
1111                 fi;
1112
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);
1116         fet_endchar;
1117 enddef;
1118
1119
1120 def inclinatum_char (expr verbose_name, internal_name,
1121                           small, stropha, auctum) =
1122         fet_beginchar (verbose_name, "s" & internal_name);
1123                 save ht, alpha;
1124
1125                 alpha := 35;
1126
1127                 if small:
1128                         ht# = 0.50 noteheight#;
1129                 else:
1130                         ht# = 0.80 noteheight#;
1131                 fi;
1132
1133                 draw_diamond_head (ht#, 0, 0, alpha, false);
1134
1135                 save off_angle;
1136
1137                 off_angle := alpha + 15;
1138
1139                 save stropha_ellipse, auctum_hook, circle;
1140                 path stropha_ellipse, auctum_hook, circle;
1141
1142                 circle := reverse fullcircle scaled linethickness;
1143
1144                 stropha_ellipse := fullcircle xscaled 0.25 head_height
1145                                               yscaled 0.55 head_height
1146                                               rotated alpha;
1147
1148                 z11 = z12
1149                       + linethickness / 2 * dir (180 - off_angle)
1150                       - directionpoint dir (90 - off_angle)
1151                           of stropha_ellipse;
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);
1155
1156                 auctum_hook := z12{-dir (90 - off_angle)}
1157                                .. {dir (90 + alpha)}z13;
1158
1159                 labels (12);
1160
1161                 if (stropha and not auctum):
1162                         clearit;
1163
1164                         save t_in, t_out;
1165
1166                         t_in := xpart ((stropha_ellipse shifted z11)
1167                                        intersectiontimes
1168                                        get_subpath (diamond_shape,
1169                                                     left, up,
1170                                                     (0, 0)));
1171                         t_out := xpart ((stropha_ellipse shifted z11)
1172                                         intersectiontimes
1173                                         get_subpath (diamond_shape,
1174                                                      up, right,
1175                                                      (0, 0)));
1176
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),
1182                                             (0, 0))
1183                              -- get_subpath (stropha_ellipse,
1184                                              direction t_in of stropha_ellipse,
1185                                              direction t_out of stropha_ellipse,
1186                                              z11)
1187                              -- cycle;
1188
1189                         labels (11);
1190                 fi;
1191
1192                 if (auctum and not stropha):
1193                         clearit;
1194
1195                         fill get_subpath (diamond_shape,
1196                                           left,
1197                                           -dir (90 - off_angle),
1198                                           (0, 0))
1199                              .. get_subpath (circle,
1200                                              dir (90 + alpha),
1201                                              -dir (90 + alpha),
1202                                              z13)
1203                              .. get_subpath (circle,
1204                                              dir (90 - off_angle),
1205                                              right,
1206                                              z12)
1207                              -- cycle;
1208
1209                         labels (13);
1210                 fi;
1211
1212                 if (auctum and stropha):
1213                         clearit;
1214
1215                         save t;
1216
1217                         t := xpart ((stropha_ellipse shifted z11)
1218                                     intersectiontimes
1219                                     get_subpath (diamond_shape, up, right,
1220                                                  (0, 0)));
1221
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),
1227                                             (0, 0))
1228                              .. get_subpath (circle,
1229                                              dir (90 + alpha),
1230                                              -dir (90 + alpha),
1231                                              z13)
1232                              .. get_subpath (stropha_ellipse,
1233                                              dir (90 - off_angle),
1234                                              direction t of stropha_ellipse,
1235                                              z11)
1236                              -- cycle;
1237
1238                         labels (11, 13);
1239                 fi;
1240         fet_endchar;
1241 enddef;
1242
1243
1244 % punctum
1245 vat_punctum_char ("Ed. Vat. punctum", "vaticana.punctum",
1246                   false, false, false, false,
1247                   false, false, false, 1.0);
1248
1249
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);
1254
1255
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);
1260
1261
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);
1266
1267
1268 % punctum inclinatum
1269 inclinatum_char ("Ed. Vat. inclinatum", "vaticana.inclinatum",
1270                  false, false, false);
1271
1272
1273 % pes lower punctum
1274 vat_punctum_char ("Ed. Vat. pes lower punctum", "vaticana.lpes",
1275                   false, false, true, false,
1276                   true, false, false, 1.0);
1277
1278
1279 % pes lower punctum
1280 vat_punctum_char ("Ed. Vat. pes var lower punctum", "vaticana.vlpes",
1281                   false, false, true, false,
1282                   true, false, true, 1.0);
1283
1284
1285 % pes upper punctum
1286 vat_punctum_char ("Ed. Vat. pes upper punctum", "vaticana.upes",
1287                   false, false, true, false,
1288                   false, false, false, 1.0);
1289
1290
1291 % pes upper punctum (shifted variation)
1292 %
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.
1296 %
1297 vat_punctum_char ("Ed. Vat. var pes upper punctum", "vaticana.vupes",
1298                   false, false, true, false,
1299                   false, true, false, 1.0);
1300
1301
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);
1306
1307
1308 % small punctum as used in epiphonus
1309 plica_char ("Ed. Vat. var plica", "vaticana.vplica",
1310             false, 0.6);
1311
1312
1313 % eccentric punctum as used in epiphonus
1314 epiphonus_char ("Ed. Vat. epiphonus", "vaticana.epiphonus",
1315                 false, true, false, 1.0);
1316
1317
1318 % eccentric punctum as used in epiphonus (shifted variation)
1319 %
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.
1323 %
1324 epiphonus_char ("Ed. Vat. var epiphonus", "vaticana.vepiphonus",
1325                 false, true, true, 1.0);
1326
1327
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);
1332
1333
1334 % small punctum as used in cephalicus
1335 plica_char ("Ed. Vat. rev. var plica", "vaticana.reverse.vplica",
1336             true, 0.6);
1337
1338
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);
1342
1343
1344 % eccentric punctum as used in cephalicus; with left stem
1345 epiphonus_char ("Ed. Vat. cephalicus", "vaticana.cephalicus",
1346                 true, false, false, 1.0);
1347
1348
1349 % quilisma
1350 fet_beginchar ("Ed. Vat. quilisma", "svaticana.quilisma");
1351         save a_b, b_h, a_w;
1352
1353         a_b := 1.54; % b_h * a_b / a_w = wd / ht
1354         b_h := 0.85;
1355         a_w := 1.09;
1356
1357         save a, beta, ht, wd;
1358
1359         ht# = noteheight#;
1360         2 beta = ht# * b_h;
1361         a = beta * a_b;
1362         wd# = 2 a / a_w;
1363
1364         set_char_box (0, 0.42 wd#, 0.28 ht#, 0.36 ht#);
1365
1366         black_notehead_width# := wd#;
1367
1368         define_pixels (ht, wd);
1369
1370         save ellipse, T;
1371         path ellipse;
1372         transform T;
1373
1374         T := identity xscaled linethickness
1375                       yscaled 0.44 ht;
1376         pickup pencircle transformed T;
1377         ellipse := reverse fullcircle transformed T;
1378
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);
1386
1387         fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
1388              -- get_subpath (ellipse, z2 - z1, z1 - z2, z2)
1389              -- cycle;
1390         fill get_subpath (ellipse, z3 - z4, z4 - z3, z3)
1391              -- get_subpath (ellipse, z4 - z3, z3 - z4, z4)
1392              -- cycle;
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)
1397              -- cycle;
1398
1399         labels (1, 2, 3, 4, 5, 6, 7);
1400 fet_endchar;
1401
1402
1403 % solesmes punctum inclinatum parvum
1404 inclinatum_char ("Solesmes punctum inclinatum parvum", "solesmes.incl.parvum",
1405                  true, false, false);
1406
1407
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);
1412
1413
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);
1418
1419
1420 % solesmes punctum inclinatum auctum
1421 inclinatum_char ("Solesmes punctum incl. auctum", "solesmes.incl.auctum",
1422                  false, false, true);
1423
1424
1425 % solesmes stropha
1426 inclinatum_char ("Solesmes stropha", "solesmes.stropha",
1427                  false, true, false);
1428
1429
1430 % solesmes stropha aucta
1431 inclinatum_char ("Solesmes stropha aucta", "solesmes.stropha.aucta",
1432                  false, true, true);
1433
1434
1435 % solesmes oriscus
1436 fet_beginchar ("Solesmes oriscus", "ssolesmes.oriscus");
1437         save a_b, b_h, a_w;
1438
1439         a_b := 1.54; % b_h * a_b / a_w = wd / ht
1440         b_h := 0.85;
1441         a_w := 1.09;
1442
1443         save a, beta, ht, wd;
1444
1445         ht# = noteheight#;
1446         2 beta = ht# * b_h;
1447         a = beta * a_b;
1448         wd# = 2 a / a_w;
1449         black_notehead_width# := wd#;
1450
1451         save convexity;
1452
1453         convexity# = +0.05 ht#;
1454
1455         define_pixels (ht, wd, convexity);
1456
1457         set_char_box (0.00 wd#, 0.50 wd#,
1458                       0.25 ht# + convexity#, 0.25 ht# + convexity#);
1459
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);
1464
1465
1466         save height;
1467
1468         height = 2 ypart (directionpoint right of (z1
1469                                                    .. z2
1470                                                    .. z3
1471                                                    .. z4));
1472
1473         save ellipse, T;
1474         path ellipse;
1475         transform T;
1476
1477         T := identity xscaled blot_diameter
1478                       yscaled (h + d - height);
1479         pickup pencircle transformed T;
1480         ellipse := fullcircle transformed T;
1481
1482         % Adjust vertical coordinates to touch bounding box.
1483         y1 := top -d;
1484         y4 := bot h;
1485
1486         save d_;
1487         pair d_;
1488
1489         d_ := direction 0 of (z1
1490                               .. z2
1491                               .. z3
1492                               .. z4);
1493
1494         fill get_subpath (ellipse, -d_, d_, z1)
1495              .. bot z2
1496              .. bot z3
1497              .. get_subpath (ellipse, d_, -d_, z4)
1498              .. top z3
1499              .. top z2
1500              .. cycle;
1501
1502         labels (1, 2, 3, 4);
1503 fet_endchar;
1504
1505
1506 %%%%%%%%
1507 %
1508 %
1509 %
1510 % EDITIO MEDICAEA
1511 %
1512 %
1513 %
1514
1515 % inclinatum
1516 fet_beginchar ("Ed. Med. inclinatum", "smedicaea.inclinatum");
1517         draw_diamond_head (1.2 staff_space#, 0, 0, 35, false);
1518 fet_endchar;
1519
1520
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);
1524                 save a, ht, wd;
1525
1526                 ht# = 2 staff_space#;
1527                 wd# = ht#;
1528                 black_notehead_width# := wd#;
1529
1530                 define_pixels (ht, wd);
1531
1532                 save ellipse;
1533                 path ellipse;
1534
1535                 ellipse := fullcircle xscaled blot_diameter
1536                                       yscaled 0.50 ht;
1537
1538                 z1 = (0.00 wd + blot_diameter / 2, 0);
1539                 z2 = (0.4 wd - blot_diameter / 2, 0);
1540
1541                 labels (1, 2);
1542
1543                 pickup pencircle scaled linethickness;
1544
1545                 if left_down_stem:
1546                         z4 = (0.00 wd + linethickness / 2, -1.25 ht);
1547
1548                         fill get_subpath (ellipse, left, down, z1)
1549                              -- top lft z4{down}
1550                              .. z4{right}
1551                              .. top rt z4{up}
1552                              -- (rt x4, -.5 ht / 2)
1553                              -- get_subpath (ellipse, right, left, z2)
1554                              -- cycle;
1555
1556                         labels (4);
1557
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);
1561
1562                         fill get_subpath (ellipse, down, right, z1)
1563                              -- get_subpath (ellipse, right, left, z2)
1564                              -- (rt x4, .5 ht / 2)
1565                              -- bot rt z4{up}
1566                              .. z4{left}
1567                              .. bot lft z4{down}
1568                              -- cycle;
1569
1570                         labels (4);
1571
1572                         set_char_box (0.0, 0.4 wd#, 0.25 ht#, 1.25 ht#);
1573                 else:
1574                         fill get_subpath (ellipse, left, right, z1)
1575                              -- get_subpath (ellipse, right, left, z2)
1576                              -- cycle;
1577
1578                         set_char_box (0.0, 0.4 wd#, 0.25 ht#, 0.25 ht#);
1579                 fi;
1580
1581         fet_endchar;
1582 enddef;
1583
1584
1585 % punctum
1586 med_punctum_char ("Ed. Med. punctum", "medicaea.punctum",
1587                   false, false);
1588
1589
1590 % left up-stemmed punctum
1591 med_punctum_char ("Ed. Med. reverse virga", "medicaea.rvirga",
1592                   true, false);
1593
1594
1595 % virga (i.e. left down-stemmed punctum)
1596 med_punctum_char ("Ed. Med. virga", "medicaea.virga",
1597                   false, true);
1598
1599
1600 %%%%%%%%
1601 %
1602 %
1603 %
1604 % HUFNAGEL
1605 %
1606 %
1607 %
1608
1609 def huf_punctum_char (expr verbose_name, internal_name,
1610                            down_stem) =
1611         fet_beginchar (verbose_name, "s" & internal_name);
1612                 save alpha;
1613
1614                 alpha = 55;
1615
1616                 draw_diamond_head (staff_space#, 0, 0, alpha, false);
1617
1618                 if down_stem:
1619                         set_char_box (0, head_width#,
1620                                       1.5 staff_space#, head_height# / 2);
1621
1622                         save ellipse;
1623                         path ellipse;
1624
1625                         ellipse := reverse fullcircle xscaled blot_diameter
1626                                                       yscaled 0.7 staff_space
1627                                                       rotated -alpha;
1628
1629                         z11 = (head_width / 2, 0);
1630                         z12 = find_tangent_shift (((0, -d) -- (w, -d)), ellipse,
1631                                                   (w / 2, -d), (w / 2, 0));
1632
1633                         fill get_subpath (ellipse, up, down, z11)
1634                              -- get_subpath (ellipse, down, up, z12)
1635                              -- cycle;
1636
1637                         labels (11, 12);
1638                 fi;
1639         fet_endchar;
1640 enddef;
1641
1642
1643 % punctum
1644 huf_punctum_char ("Hufnagel punctum", "hufnagel.punctum", false)
1645
1646
1647 % virga
1648 huf_punctum_char ("Hufnagel virga", "hufnagel.virga", true)
1649
1650
1651 % pes lower punctum
1652 fet_beginchar ("Hufnagel pes lower punctum", "shufnagel.lpes")
1653         save width, height, alpha;
1654
1655         width# = 2 * staff_space#;
1656         height# = 0.7 * staff_space#;
1657         alpha = 35;
1658
1659         set_char_box (0, width#, height# / 2, height# / 2);
1660
1661         define_pixels (width, height);
1662
1663         save circle;
1664         path circle;
1665
1666         circle := reverse fullcircle scaled linethickness;
1667
1668         pickup pencircle scaled linethickness;
1669
1670         rt x3 = -lft x1 = width / 2;
1671         y2 = y3 = height / 2;
1672         y1 = y4 = -height / 2;
1673
1674         tand (alpha) * (y2 - y1) = x2 - x1 = x3 - x4;
1675
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)
1680              -- cycle;
1681
1682         currentpicture := currentpicture shifted (width/2, 0);
1683
1684 %       labels (1, 2, 3, 4);
1685 fet_endchar;
1686
1687
1688 fet_endgroup ("noteheads");