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