]> git.donarmstrong.com Git - lilypond.git/blob - mf/parmesan-heads.mf
2004-09-10 Juergen Reuter <reuter@ipd.uka.de>
[lilypond.git] / mf / parmesan-heads.mf
1 % -%-Fundamental-%- -*-Metafont-*-
2 % parmesan-heads.mf -- implement ancient note heads
3
4 % source file of LilyPond's pretty-but-neat music font
5
6 % (c) 2001--2004 Juergen Reuter <reuter@ipd.uka.de>
7
8 % Neo-mensural heads originally by
9 % Christian Mondrup and Mats Bengtsson
10
11
12 save black_notehead_width;
13 numeric black_notehead_width;
14
15 fet_begingroup ("noteheads")
16
17 %
18 % character aligment:
19 %
20 %   The head is assumed to be vertically centered around (0, 0).
21 %   The left-most edge of the head should touch the vertical line
22 %   that goes though the point (0, 0).
23 %
24 % set_char_box() conventions:
25 %
26 % * breapth: Ignored (as far as I know).  Should be set to 0.
27 %
28 % * width: Should match the head's width.
29 %
30 % * depth: Should match the bottom edge of the head.  Affects vertical
31 %   collision handling.
32 %
33 % * height: Should match the top edge of the head.  Affects vertical
34 %   collision handling.
35 %
36 % TODO: should depth/height include appendages/stems?
37
38 overdone_heads = 0;
39 noteheight# := staff_space# + (1 + overdone_heads)*stafflinethickness#;
40 define_pixels(noteheight);
41
42
43 %%%%%%%%
44 %
45 %
46 %
47 % MENSURAL NOTATION
48 %
49 %
50 %
51
52 def draw_neomensural_brevis(expr brevwid) =
53         save beamheight, head_width;
54         save holeheight, stem_width;
55         save serif_size, serif_protrude;
56
57         head_width# = brevwid;
58         holeheight = 3 stafflinethickness;
59         stem_width = 1.4 stafflinethickness;
60
61
62         define_pixels(head_width);
63         set_char_box(0, head_width#, noteheight#/2, noteheight#/2);
64         
65         2 beamheight + holeheight = noteheight;
66         serif_size = (holeheight - stafflinethickness)/2;
67         serif_protrude = 1.5 serif_size;
68         penpos1(stem_width, 0);
69         penpos2(stem_width, 0);
70         penpos3(beamheight, 90);
71         penpos4(beamheight, 90);
72         penpos5(stem_width, 180);
73
74         z1l = (0, 0);
75         z2l = (0, -stafflinethickness/2);
76         z3r = z2r + serif_size *(1,-1);
77         y4r = y3r;
78         x4r = head_width/2;
79         z5l = z3l + (-serif_size, -serif_protrude);
80
81         penlabels(1,2,3,4, 5);
82         fill z1r -- z1l -- z5r{down} .. z5l{up} .. z3l{right}
83                 -- z4l -- z4r -- z3r{left} .. z2r{up} -- cycle;
84
85         addto currentpicture also currentpicture yscaled -1;
86         show z4r; show z4l;
87         addto currentpicture also currentpicture 
88                 shifted (-x4r,0) xscaled -1 shifted (x4l,0);
89
90 enddef;
91
92
93 def draw_neomensural_left_stemmed_head (expr wid) =
94         draw_neomensural_brevis(wid);
95
96         x6 = x7 = head_width - stem_width/2;
97         y6 = y5;
98         y7 = y5 - 2.25 staff_space;
99         pickup pencircle scaled stem_width;
100         draw z6 .. z7;
101 enddef;
102
103 fet_beginchar("Left stemmed notehead", "lneomensural", "mensuralleftstemmedhead");
104         draw_neomensural_left_stemmed_head (2 staff_space#);
105 fet_endchar;
106
107 %
108 % Some sources (eg Musix/OpusTeX think that the appendage should be on
109 % the left, some say right. Right wins democratically.
110 %
111 def draw_neomensural_longa (expr wid) =
112         draw_neomensural_brevis(wid);
113         save theta;
114
115         x7r = head_width;
116         y7 = y5;
117 %       z7 = z5;
118         z6 - z7 = (stem_width/2, -staff_space);
119         theta = angle(z6-z7)+ 90;
120         penpos7(stem_width, theta);
121         penpos6(1.2 stem_width, theta);
122         
123         fill z7r .. z6r{z6-z7} .. {z7-z6} z6l -- z7l -- cycle;
124         penlabels(6,7);
125 enddef;
126
127 fet_beginchar("Left stemmed notehead", "lneomensural", "mensuralleftstemmedhead");
128         draw_neomensural_left_stemmed_head (2 staff_space#);
129 fet_endchar;
130
131 %
132 % En wij presenteren U: de opvolgster van Emily
133 %
134 % (ze is wel breed)
135
136 fet_beginchar("Neo-mensural maxima notehead", "-3neomensural", "neomensuralmaximahead");
137         draw_neomensural_longa (2.6 staff_space#)
138 fet_endchar;
139
140 fet_beginchar("Neo-mensural longa notehead", "-2neomensural", "neomensurallongahead");
141         draw_neomensural_longa (2 staff_space#)
142 fet_endchar;
143
144 fet_beginchar("Neo-mensural brevis notehead", "-1neomensural", "neomensuralbrevishead")
145         draw_neomensural_brevis(2 staff_space#);
146 fet_endchar;
147
148 def draw_neomensural_black_head (expr wid, height) =
149         save head_width;
150         head_width# = wid;
151         set_char_box (0, head_width#, height/2, height/2);
152         
153         charwx := head_width# / 2;
154         charwy := height / 2;
155
156         y3 = y1 =0;
157         x2 = x4 = (x1 + x3) /2;
158         define_pixels (head_width);
159         pickup pencircle scaled blot_diameter;
160         top y2 = h;
161         bot y4 = -d;
162         lft x1 = 0;
163         rt x3 = w;
164
165         filldraw z1 -- z2 -- z3 -- z4 -- cycle;
166 enddef;
167
168 def draw_neomensural_open_head (expr wid, height)=
169         draw_neomensural_black_head (wid, height);
170         save diamNW, diamSW;
171         diamNW = length (z2 - z1) + blot_diameter;
172         diamSW = length (z4 - z1) + blot_diameter;
173         
174         save hole_widthNW, hole_widthSW;
175         hole_widthNW = 0.34 diamNW ;
176         hole_widthSW + 2.6 linethickness = diamSW;
177
178         (z7 + z5)/2 = (w/2, 0);
179         (z8 + z6)/2 = (w/2, 0);
180         (z6 - z5) = hole_widthNW * unitvector (z2 - z1);
181         (z7 - z6) = hole_widthSW * unitvector (z4 - z1);
182
183         labels (1,2,3,4,5,6,7,8);
184
185         unfill z5 -- z6 -- z7 -- z8 --cycle;
186 enddef;
187
188 fet_beginchar("Neo-mensural open head","0neomensural","neomensuralsemibrevishead")
189       draw_neomensural_open_head (staff_space#, noteheight#);
190 fet_endchar;
191
192 %
193 % WL says the thin lines should be thinner.
194 %
195
196 fet_beginchar("Harmonic notehead (Neo-mensural open)",
197                 "0harmonic","harmonichead")
198
199         draw_neomensural_open_head (1.3 staff_space#, 1.3 noteheight#);
200         charwx := head_width#;
201         charwy := 0;
202 fet_endchar;
203
204
205 fet_beginchar("Neo-mensural open head","1neomensural","neomensuralminimahead")
206       draw_neomensural_open_head (staff_space#, noteheight#);
207 fet_endchar;
208
209 fet_beginchar("Neo-mensural black head","2neomensural","neomensuralsemiminimahead")
210       draw_neomensural_black_head (staff_space#, noteheight#);
211 fet_endchar;
212
213
214
215 def draw_mensural_brevis (expr wid) =
216         % TODO.  For the moment, fall back to draw_neomensural_brevis.
217         draw_neomensural_brevis(wid);
218 enddef;
219
220 def draw_mensural_left_stemmed_head (expr wid) =
221         draw_mensural_brevis(wid);
222         x6 = x7 = stem_width/2;
223         y6 = y5;
224         y7 = y5 - 2.25staff_space;
225         pickup pencircle scaled stem_width;
226         draw z6 .. z7;
227 enddef;
228
229 def draw_mensural_longa (expr wid) =
230         draw_mensural_brevis(wid);
231         x6 = x7 = head_width - stem_width/2;
232         y6 = y5;
233         y7 = y5 - 2.25staff_space;
234         pickup pencircle scaled stem_width;
235         draw z6 .. z7;
236 enddef;
237
238 fet_beginchar("Mensural left stemmed notehead", "lmensural", "mensuralleftstemmedhead");
239         draw_mensural_left_stemmed_head (staff_space#)
240 fet_endchar;
241
242 fet_beginchar("Mensural maxima notehead", "-3mensural", "mensuralmaximahead");
243         draw_mensural_longa (2.0 staff_space#)
244 fet_endchar;
245
246 fet_beginchar("Mensural longa notehead", "-2mensural", "mensurallongahead");
247         draw_mensural_longa (staff_space#)
248 fet_endchar;
249
250 fet_beginchar("Mensural brevis notehead", "-1mensural", "mensuralbrevishead")
251         draw_mensural_brevis(staff_space#);
252 fet_endchar;
253
254 def draw_diamond_head (expr head_h, pen_w, pen_h, angle, open) =
255       save head_width, head_height;
256       head_height# = head_h;
257       head_width# / head_height# = tand(angle);
258
259       set_char_box (0, head_width#,
260         head_height#/2, head_height#/2);
261       
262       charwx := head_width# / 2;
263       charwy := head_height# / 2 - linethickness#;
264
265       define_pixels(head_width, head_height);
266       pickup pencircle
267              xscaled (max(blot_diameter, pen_w * head_width))
268              yscaled (max(blot_diameter, pen_h * head_width))
269              rotated -angle;
270
271       %% FIXME: replace "xpart (top z2)" (and, analogously,
272       %% "ypart (rt z3)") with an expression that really delivers the
273       %% x coordinate of the uppermost pixel that is drawn with respect
274       %% to the pencircle (this requires some elliptical computations).
275       %% MF obviously interprets "xpart (top z2)" as "top (xpart z2)",
276       %% i.e. "top x2", which is not what we want.
277
278       xpart (top z2) = ypart (rt z3) = 0;
279       top y2 = head_height/2;
280       rt x3 = head_width/2;
281       z2 = - z4;
282       z3 = - z1;
283
284       if open:
285               draw z1 -- z2 -- z3 -- z4 -- cycle;
286       else:
287               filldraw z1 -- z2 -- z3 -- z4 -- cycle;
288       fi;
289
290       currentpicture := currentpicture shifted (head_width/2, 0);
291
292 enddef;
293
294
295 fet_beginchar("Mensural open head","0mensural","mensuralsemibrevishead")
296         draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
297 fet_endchar;
298
299 fet_beginchar("Mensural open head","1mensural","mensuralminimahead")
300         draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
301 fet_endchar;
302
303 fet_beginchar("Mensural black head","2mensural","mensuralsemiminimahead")
304         draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
305 fet_endchar;
306
307
308 %%%%%%%%
309 %
310 %
311 %
312 % EDITIO VATICANA (including solesmes extensions)
313 %
314 %
315 %
316
317 % parameterized punctum
318 def punctum_char (expr verbose_name, internal_name, ly_name,
319                   left_stem, right_stem, linea, cavum,
320                   straight, auctum, direction_up, excentric, up_shift, down_shift, mag) =
321
322         fet_beginchar(verbose_name, internal_name, ly_name)
323                 save b_h, a_w;
324                 a_b := 1.54; % b_h*a_b/a_w = wd/ht
325                 b_h := 0.85;
326                 a_w := 1.09;
327
328                 save a, beta, ht, wd;
329                 ht# = noteheight# * mag;
330                 2beta# = ht# * b_h;
331                 a# = beta# * a_b;
332                 wd# = 2a# / a_w;
333                 black_notehead_width# := wd#;
334
335                 % direction
336                 save direction, direction_sign;
337                 pair direction;
338                 if direction_up:
339                         direction = up;
340                         direction_sign# = 1;
341                 else:
342                         direction = down;
343                         direction_sign# = -1;
344                 fi;
345
346                 % convexity and excentricity
347                 save u_convexity, u_excentricity;
348                 if straight:
349                         u_convexity# = -0.01ht#;
350                         u_excentricity# = 0.0ht#; % dummy
351                 elseif auctum:
352                         u_convexity# = -0.03ht#;
353                         u_excentricity# = +0.25ht#;
354                 else:
355                         u_convexity# = -0.05ht#;
356                         u_excentricity# = 0.0ht#; % dummy
357                 fi;
358                 save convexity, excentricity;
359                 convexity# = direction_sign# * u_convexity#;
360                 excentricity# = direction_sign# * u_excentricity#;
361
362                 % y shift offset
363                 save yoffs;
364                 if up_shift:
365                         yoffs# = 0.08ht#;
366                 elseif down_shift:
367                         yoffs# = -0.11ht#;
368                 else:
369                         yoffs# = 0.00ht#;
370                 fi
371
372                 define_pixels(convexity, excentricity, yoffs, ht, wd);
373                 pickup pencircle scaled linethickness;
374
375                 path p;
376                 save height, yoffs_bt;
377                 define_pixels (height, yoffs_bt);
378                 height# = 0.47ht#;
379                 yoffs_bt# = yoffs# - 0.5*height# - 0.25*convexity#;
380                 xpart z1a = xpart z1b;
381                 xpart z2a = xpart z2b;
382                 xpart z3a = xpart z3b;
383                 ypart z1a + height = ypart z1b;
384                 ypart z2a + height = ypart z2b;
385                 ypart z3a + height = ypart z3b;
386
387                 save box_top, box_bt;
388
389                 if auctum:
390                         z1a = (0.00wd + linethickness/2, yoffs_bt);
391                         z2a = (0.21wd, yoffs_bt + 1.0*convexity);
392                         z3a = (0.42wd - linethickness/2,
393                                yoffs_bt + 1.0*excentricity);
394                         box_top# = height# + yoffs_bt# +
395                                 max(0, 1.0*convexity#, 1.0*excentricity#);
396                         box_bt# = yoffs_bt# +
397                                 min(0, 1.0*convexity#, 1.0*excentricity#);
398                         p = z1a .. {right}z2a .. {direction}z3a --
399                             z3b{-direction} .. z2b{left} .. z1b -- cycle;
400                 elseif excentric:
401                         z1a = (0.00wd + linethickness/2,
402                                yoffs_bt - 1.0*convexity);
403                         z2a = (0.08wd, yoffs_bt + 1.4*convexity);
404                         z3a = (0.42wd - linethickness/2,
405                                yoffs_bt - 1.0*convexity);
406                         box_top# = height# + yoffs_bt# +
407                                 max(-1.0*convexity#, 1.4*convexity#, 0);
408                         box_bt# = yoffs_bt# +
409                                 min(-1.0*convexity#, 1.4*convexity#, 0);
410                         p = z1a{direction} .. z2a{right} .. z3a --
411                             z3b .. {left}z2b .. {-direction}z1b -- cycle;
412                 else:
413                         z1a = (0.00wd + linethickness/2, yoffs_bt);
414                         z2a = (0.21wd, yoffs_bt + 1.0*convexity);
415                         z3a = (0.42wd - linethickness/2, yoffs_bt);
416                         box_top# = height# + yoffs_bt# +
417                                 max(0, 1.0*convexity#);
418                         box_bt# = yoffs_bt# +
419                                 min(0, 1.0*convexity#);
420                         p = z1a .. z2a .. z3a --
421                             z3b .. z2b .. z1b -- cycle;
422                 fi;
423
424                 if cavum:
425                         draw p;
426                 else:
427                         filldraw p;
428                 fi;
429
430                 pickup pencircle scaled 0.6linethickness;
431
432                 save stem_bt;
433
434                 if left_stem:
435                         z5=(0.00wd + 0.6linethickness/2, yoffs);
436                         z6=(0.00wd + 0.6linethickness/2, yoffs - 1.1ht);
437                         draw z5 -- z6;
438                         stem_bt# = yoffs# - 1.1ht#;
439                 elseif right_stem:
440                         z5=(0.42wd - 0.6linethickness/2, yoffs);
441                         z6=(0.42wd - 0.6linethickness/2, yoffs - 1.5ht);
442                         draw z5 -- z6;
443                         stem_bt# = yoffs# - 1.5ht#;
444                 else:
445                         stem_bt# = 0;
446                 fi;
447
448                 set_char_box(0.00wd#, 0.42wd#,
449                              max(0, -box_bt#, -stem_bt#) + linethickness#/2,
450                              max(0, box_top#) + linethickness#/2);
451
452                 if linea:
453                         save linea_width, linea_height;
454                         linea_width# = 0.6 linethickness#;
455                         linea_height# = 0.7 ht#;
456                         define_pixels (linea_width, linea_height);
457                         draw_block ((-0.10wd - linea_width/2,
458                                      -linea_height/2),
459                                     (-0.10wd + linea_width/2,
460                                      +linea_height/2));
461                         draw_block ((+0.52wd - linea_width/2,
462                                      -linea_height/2),
463                                     (+0.52wd + linea_width/2,
464                                      +linea_height/2));
465                         set_char_box(0,
466                                      0.62wd# + linea_width#,
467                                      linea_height#/2,
468                                      linea_height#/2);
469                         currentpicture := currentpicture
470                                 shifted (0.10wd + linea_width/2, 0);
471                 fi;
472         fet_endchar;
473 enddef;
474
475 % parameterized punctum inclinatum
476 def inclinatum_char(expr verbose_name, internal_name, ly_name,
477                     small, stropha, auctum) =
478
479         fet_beginchar(verbose_name, internal_name, ly_name)
480                 save ht, alpha;
481                 alpha# = 35;
482                 if small:
483                         ht# = 0.50 noteheight#;
484                 else:
485                         ht# = 0.80 noteheight#;
486                 fi;
487
488                 draw_diamond_head (ht#, 0, 0, alpha#, false);
489
490                 if stropha:
491                         pickup pencircle
492                                 xscaled (0.25*head_height)
493                                 yscaled (0.55*head_height)
494                                 rotated alpha#;
495                         save za, off_angle; pair za;
496                         off_angle := 15;
497                         za = (0, -0.25*head_height)
498                                 rotated -(alpha# + off_angle)
499                                 shifted (0.48 head_width, -0.02 head_width);
500                         undraw za;
501                 fi;
502
503                 if auctum:
504                         pickup pencircle scaled linethickness;
505                         save za, zb, zc;
506                         pair za, zb, zc;
507                         za = (0, -0.5 head_height + linethickness);
508                         zb = 0.6 (za + zc);
509                         zc = za + (0.52 head_width, 0);
510                         draw za{(0,-1) rotated alpha#} .. {right}zb{right} ..
511                              {(0,1) rotated -alpha#}zc;
512                 fi;
513         fet_endchar;
514 enddef;
515
516 % punctum
517 punctum_char("Ed. Vat. punctum", "vaticana-punctum", "vatpunctumhead",
518              false, false, false, false, false,
519              false, false, false, false, false, 1.0);
520
521 % punctum cavum (for OpusTeX compatibility)
522 punctum_char("Ed. Vat. punctum cavum", "vaticana-punctum-cavum",
523              "vatpunctumcavumhead",
524              false, false, false, true, false,
525              false, false, false, false, false, 1.0);
526
527 % linea punctum (for OpusTeX compatibility)
528 punctum_char("Ed. Vat. linea punctum", "vaticana-linea-punctum",
529              "vatlineapunctumhead",
530              false, false, true, false, false,
531              false, false, false, false, false, 1.0);
532
533 % linea punctum cavum (for OpusTeX compatibility)
534 punctum_char("Ed. Vat. linea punctum cavum", "vaticana-linea-punctum-cavum",
535              "vatlineapunctumcavumhead",
536              false, false, true, true, false,
537              false, false, false, false, false, 1.0);
538
539 % punctum inclinatum
540 inclinatum_char("Ed. Vat. inclinatum", "vaticana-inclinatum",
541                 "vatinclinatumhead",
542                 false, false, false);
543
544 % pes lower punctum
545 punctum_char("Ed. Vat. pes lower punctum", "vaticana-lpes", "vatlpeshead",
546              false, false, false, false, true,
547              false, true, false, false, false, 1.0);
548
549 % pes lower punctum
550 punctum_char("Ed. Vat. pes var lower punctum", "vaticana-vlpes", "vatvlpeshead",
551              false, false, false, false, true,
552              false, true, false, false, true, 1.0);
553
554 % pes upper punctum
555 punctum_char("Ed. Vat. pes upper punctum", "vaticana-upes", "vatupeshead",
556              false, false, false, false, true,
557              false, false, false, false, false, 1.0);
558
559 % pes upper punctum (shifted variation)
560 %
561 % This note head is used instead of the regular pes upper punctum to
562 % avoid collision with the lower punctum note of the pes when the upper
563 % punctum sits directly on top of the lower punctum.
564 %
565 punctum_char("Ed. Vat. var pes upper punctum", "vaticana-vupes",
566              "vatvupeshead",
567              false, false, false, false, true,
568              false, false, false, true, false, 1.0);
569
570 % small punctum as used in epiphonus
571 punctum_char("Ed. Vat. plica", "vaticana-plica", "vatplicahead",
572              false, false, false, false, false,
573              false, false, false, false, false, 0.6);
574
575 % excentric punctum as used in epiphonus
576 punctum_char("Ed. Vat. epiphonus", "vaticana-epiphonus", "vatepiphonushead",
577              false, false, false, false, false,
578              false, true, true, false, false, 1.0);
579
580 % excentric punctum as used in epiphonus (shifted variation)
581 %
582 % This note head is used instead of the regular epiphonus punctum to
583 % avoid collision with the plica head when the plica sits directly on
584 % top of the lower head.
585 %
586 punctum_char("Ed. Vat. var epiphonus", "vaticana-vepiphonus", "vatvepiphonushead",
587              false, false, false, false, false,
588              false, true, true, false, true, 1.0);
589
590 % small punctum as used in cephalicus
591 punctum_char("Ed. Vat. rev. plica", "vaticana-reverse-plica", "vatrplicahead",
592              false, false, false, false, false,
593              false, true, false, false, false, 0.6);
594
595 % excentric punctum as used in cephalicus; without left stem
596 punctum_char("Ed. Vat. cephalicus", "vaticana-inner-cephalicus",
597              "vatinnercephalicushead",
598              false, false, false, false, false,
599              false, false, true, false, false, 1.0);
600
601 % excentric punctum as used in cephalicus; with left stem
602 punctum_char("Ed. Vat. cephalicus", "vaticana-cephalicus",
603              "vatcephalicushead",
604              true, false, false, false, false,
605              false, false, true, false, false, 1.0);
606
607 % quilisma
608 fet_beginchar("Ed. Vat. quilisma", "vaticana-quilisma", "vatquilismahead")
609         save b_h,a_w;
610         a_b:=1.54; % b_h*a_b/a_w = wd/ht
611         b_h:=0.85;
612         a_w:=1.09;
613
614         save a, beta, ht, wd;
615         ht# = noteheight#;
616         2beta# = ht#*b_h;
617         a# = beta#*a_b;
618         wd# = 2a# / a_w;
619         set_char_box(0, 0.42wd#, 0.28 ht#, 0.36 ht#);
620         black_notehead_width# := wd#;
621
622         define_pixels(ht, wd);
623         pickup pencircle xscaled linethickness yscaled 0.44ht;
624         lft x1 = 0.00wd; bot y1 = -0.28ht;
625         x2 = 0.11wd;     y2 = -0.14ht;
626         x3 = 0.12wd;     y3 = +0.03ht;
627         x4 = 0.25wd;     y4 = -0.09ht;
628         x5 = 0.26wd;     y5 = +0.08ht;
629         x6 = 0.40wd;     y6 = -0.04ht;
630         rt x7 = 0.42wd;  top y7 = +0.36ht;
631         draw z1 .. z2 -- z3 .. z4 -- z5 .. z6 -- z7;
632 fet_endchar;
633
634 % solesmes punctum inclinatum parvum
635 inclinatum_char("Solesmes punctum inclinatum parvum", "solesmes-incl-parvum",
636                 "solinclparvumhead",
637                 true, false, false);
638
639 % solesmes punctum auctum ascendens
640 punctum_char("Solesmes punctum auctum ascendens", "solesmes-auct-asc",
641              "solauctaschead",
642              false, false, false, false, false,
643              true, true, false, false, false, 1.0);
644
645 % solesmes punctum auctum descendens
646 punctum_char("Solesmes punctum auctum descendens", "solesmes-auct-desc",
647              "solauctdeschead",
648              false, false, false, false, false,
649              true, false, false, false, false, 1.0);
650
651 % solesmes punctum inclinatum auctum
652 inclinatum_char("Solesmes punctum incl. auctum", "solesmes-incl-auctum",
653                 "solpunctuminclinatumauctumhead",
654                 false, false, true);
655
656 % solesmes stropha
657 inclinatum_char("Solesmes stropha", "solesmes-stropha",
658                 "solstrophahead",
659                 false, true, false);
660
661 % solesmes stropha aucta
662 inclinatum_char("Solesmes stropha aucta", "solesmes-stropha-aucta",
663                 "solstrophaauctahead",
664                 false, true, true);
665
666 % solesmes oriscus
667 fet_beginchar("Solesmes oriscus", "solesmes-oriscus",
668         "soloriscushead")
669         save b_h, a_w;
670         a_b := 1.54; % b_h*a_b/a_w = wd/ht
671         b_h := 0.85;
672         a_w := 1.09;
673
674         save a, beta, ht, wd;
675         ht# = noteheight#;
676         2beta# = ht# * b_h;
677         a# = beta# * a_b;
678         wd# = 2a# / a_w;
679         black_notehead_width# := wd#;
680
681         save convexity;
682         convexity# = +0.05ht#;
683
684         define_pixels(ht, wd, convexity);
685         pickup pencircle xscaled blot_diameter yscaled 0.50ht;
686         lft x1 = 0.00wd; y1 = -convexity;
687         x2 = 0.16wd;     y2 = +convexity;
688         x3 = 0.33wd;     y3 = -convexity;
689         rt x4 = 0.50wd;  y4 = +convexity;
690         draw z1 .. z2 .. z3 .. z4;
691         set_char_box(0.00wd#, 0.50wd#,
692                      0.25ht# + convexity#, 0.25ht# + convexity#);
693 fet_endchar;
694
695 %%%%%%%%
696 %
697 %
698 %
699 % EDITIO MEDICAEA
700 %
701 %
702 %
703
704 % inclinatum
705 fet_beginchar("Ed. Med. inclinatum", "medicaea-inclinatum",
706         "medinclinatumhead")
707         draw_diamond_head (1.2staff_space#, 0, 0, 35, false);
708 fet_endchar;
709
710 % parametrized punctum
711 def punctum_char (expr verbose_name, internal_name, ly_name,
712         left_up_stem, left_down_stem) =
713
714         fet_beginchar(verbose_name, internal_name, ly_name)
715
716                 save a, beta, ht, wd;
717                 ht# = 2 staff_space#;
718                 wd# = ht#;
719                 black_notehead_width# := wd#;
720
721                 define_pixels(ht, wd);
722                 pickup pencircle
723                         xscaled blot_diameter
724                         yscaled 0.50ht;
725                 z1 = (0.00wd + blot_diameter/2, 0);
726                 z2 = (0.4wd - blot_diameter/2, 0);
727                 draw z1 .. z2;
728
729                 pickup pencircle
730                         xscaled linethickness
731                         yscaled blot_diameter;
732
733                 if left_down_stem:
734                         z4=(0.00wd + linethickness/2, blot_diameter/2);
735                         z5=(0.00wd + linethickness/2, - 1.25ht);
736                         draw z4 .. z5;
737                         set_char_box(0.0, 0.4wd#, 1.25ht#, 0.25ht#);
738                 elseif left_up_stem:
739                         z4=(0.00wd + linethickness/2, blot_diameter/2);
740                         z5=(0.00wd + linethickness/2, + 1.25ht);
741                         draw z4 .. z5;
742                         set_char_box(0.0, 0.4wd#, 0.25ht#, 1.25ht#);
743                 else:
744                         set_char_box(0.0, 0.4wd#, 0.25ht#, 0.25ht#);
745                 fi;
746
747         fet_endchar;
748 enddef;
749
750 % punctum
751 punctum_char("Ed. Med. punctum", "medicaea-punctum", "medpunctumhead",
752         false, false);
753
754 % left up-stemmed punctum
755 punctum_char("Ed. Med. reverse virga", "medicaea-rvirga", "medrvirgahead",
756         true, false);
757
758 % virga (i.e. left down-stemmed punctum)
759 punctum_char("Ed. Med. virga", "medicaea-virga", "medvirgahead",
760         false, true);
761
762 %%%%%%%%
763 %
764 %
765 %
766 % HUFNAGEL
767 %
768 %
769 %
770
771 % punctum
772 % parametrized punctum
773 def punctum_char (expr verbose_name, internal_name, ly_name,
774         down_stem) =
775         fet_beginchar(verbose_name, internal_name, ly_name)
776                 save alpha;
777                 alpha# = 55;
778                 draw_diamond_head (staff_space#, 0, 0, alpha#, false);
779                 if down_stem:
780                         pickup pencircle
781                                 xscaled blot_diameter
782                                 yscaled (0.7*staff_space)
783                                 rotated -alpha#;
784                         save za, zb; pair za, zb;
785                         za = (head_width/2, 0);
786                         bot zb = (head_width/2, -1.5staff_space);
787                         draw za -- zb;
788                         set_char_box (0, head_width#,
789                                       1.5staff_space#, head_height#/2);
790                 fi;
791         fet_endchar;
792 enddef;
793
794 % punctum
795 punctum_char("Hufnagel punctum", "hufnagel-punctum", "hufpunctumhead", false)
796
797 % virga
798 punctum_char("Hufnagel virga", "hufnagel-virga", "hufvirgahead", true)
799
800 % pes lower punctum
801 fet_beginchar("Hufnagel pes lower punctum", "hufnagel-lpes", "huflpeshead")
802         save width, height, alpha;
803         width# = 2*staff_space#;
804         height# = 0.7*staff_space#;
805         alpha# = 35;
806
807         set_char_box(0, width#, height#/2, height#/2);
808
809         pickup pencircle scaled linethickness;
810         define_pixels(width, height);
811
812         rt x3 = -lft x1 = width/2;
813         y2 = y3 = height/2;
814         y1 = y4 = -height/2;
815         tand(alpha#) * (y2 - y1) = x2 - x1 = x3 - x4;
816
817         filldraw z1 -- z2 -- z3 -- z4 -- cycle;
818
819         currentpicture := currentpicture shifted (width/2, 0);
820 fet_endchar;
821
822 fet_endgroup ("noteheads")