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