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