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