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