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