]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-bolletjes.mf
release: 1.5.5
[lilypond.git] / mf / feta-bolletjes.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--2001 Jan Nieuwenhuizen <janneke@gnu.org>
7 % & Han-Wen Nienhuys <hanwen@cs.uu.nl>
8
9
10
11 % most beautiful noteheads are pronounced, not circular, 
12 % and not even symmetric.
13 % These examples are inspired by [Wanske], see literature list
14
15
16 save black_notehead_width;
17 numeric black_notehead_width;
18
19 fet_begingroup("noteheads");
20
21 noteheight#:=staff_space#+ (1 + overdone_heads) *stafflinethickness#;
22 define_pixels(noteheight);
23
24
25 %%%%%%%%
26 %
27 %
28 %
29 % MENSURAL NOTATION
30 %
31 %
32 %
33 brevis_wid# := 2 staff_space#;
34
35 def draw_brevis(expr brevwid) =
36         save beamheight, head_width;
37         save holeheight, stem_width;
38         save serif_size, serif_protrude;
39
40         head_width# = brevwid;
41         holeheight = 3 stafflinethickness;
42         stem_width = 1.4 stafflinethickness;
43
44
45         define_pixels(head_width);
46         set_char_box(0, head_width#, noteheight#/2, noteheight#/2);
47         
48         2 beamheight + holeheight = noteheight;
49         serif_size = (holeheight - stafflinethickness)/2;
50         serif_protrude = 1.5 serif_size;
51         penpos1(stem_width, 0);
52         penpos2(stem_width, 0);
53         penpos3(beamheight, 90);
54         penpos4(beamheight, 90);
55         penpos5(stem_width, 180);
56
57         z1l = (0, 0);
58         z2l = (0, -stafflinethickness/2);
59         z3r = z2r + serif_size *(1,-1);
60         y4r = y3r;
61         x4r = head_width/2;
62         z5l = z3l + (-serif_size, -serif_protrude);
63
64         penlabels(1,2,3,4, 5);
65         fill z1r -- z1l -- z5r{down} .. z5l{up} .. z3l{right}
66                 -- z4l -- z4r -- z3r{left} .. z2r{up} -- cycle;
67
68         addto currentpicture also currentpicture yscaled -1;
69         show z4r; show z4l;
70         addto currentpicture also currentpicture 
71                 shifted (-x4r,0) xscaled -1 shifted (x4l,0);
72
73 enddef;
74
75
76 %
77 % Some sources (eg Musix/OpusTeX think that the appendage should be on
78 % the left, some say right. Right wins democratically.
79 %
80 def draw_longa (expr wid) =
81         draw_brevis(wid);
82         save theta;
83
84         x7r = head_width;
85         y7 = y5;
86 %       z7 = z5;
87         z6 - z7 = (stem_width/2, -staff_space);
88         theta = angle(z6-z7)+ 90;
89         penpos7(stem_width, theta);
90         penpos6(1.2 stem_width, theta);
91         
92         fill z7r .. z6r{z6-z7} .. {z7-z6} z6l -- z7l -- cycle;
93         penlabels(6,7);
94 enddef;
95
96 %
97 % En wij presenteren U: de opvolgster van Emily
98 %
99 % (ze is wel breed)
100
101 fet_beginchar("Maxima notehead", "-3mensural", "mensuralmaximahead");
102         draw_longa (1.3 brevis_wid#)
103 fet_endchar;
104
105 fet_beginchar("Longa notehead", "-2mensural", "mensurallongahead");
106         draw_longa (brevis_wid#)
107 fet_endchar;
108
109 fet_beginchar("Brevis notehead", "-1mensural", "mensuralbrevishead")
110         draw_brevis(brevis_wid#);
111 fet_endchar;
112
113 def draw_mensural_black_head (expr wid) =
114         save head_width;
115         head_width# = wid;
116         set_char_box (0, head_width#, noteheight#/2, noteheight#/2);
117
118
119         y3 = y1 =0;
120         x2 = x4 = (x1 + x3) /2;
121         define_pixels (head_width);
122         pickup pencircle scaled blot_diameter;
123         top y2 = h;
124         bot y4 = -d;
125         lft x1 = 0;
126         rt x3 = w;
127
128         filldraw z1 -- z2 -- z3 -- z4 -- cycle;
129 enddef;
130
131 def draw_mensural_open_head (expr wid)=
132         draw_mensural_black_head (wid);
133         save diamNW, diamSW;
134         diamNW = length (z2 - z1) + blot_diameter;
135         diamSW = length (z4 - z1) + blot_diameter;
136         
137         save hole_widthNW, hole_widthSW;
138         hole_widthNW = 0.34 diamNW ;
139         hole_widthSW + 2.6 stafflinethickness = diamSW;
140
141         (z7 + z5)/2 = (w/2, 0);
142         (z8 + z6)/2 = (w/2, 0);
143         (z6 - z5) = hole_widthNW * unitvector (z2 - z1);
144         (z7 - z6) = hole_widthSW * unitvector (z4 - z1);
145
146         labels (1,2,3,4,5,6,7,8);
147
148         unfill z5 -- z6 -- z7 -- z8 --cycle;
149 enddef;
150
151 fet_beginchar("Mensural open head","0mensural","mensuralminimhead")
152         draw_mensural_open_head (staff_space#);
153 fet_endchar;
154
155 fet_beginchar("Mensural open head","1mensural","mensuralsemiminimhead")
156         draw_mensural_open_head (staff_space#);
157 fet_endchar;
158
159 fet_beginchar("Mensural black head","2mensural","fusahead")
160         draw_mensural_black_head (staff_space#);
161 fet_endchar;
162
163
164 %%%%%%%%%%%%
165 %
166 %
167 % ledger (leger) lines
168 %
169 fet_beginchar("Ledger ending", "ledgerending", "ledgerending")
170 set_char_box (5/2 ledgerlinethickness#, 5/2 ledgerlinethickness#,
171                 ledgerlinethickness#/2,ledgerlinethickness#/2);
172         pickup pencircle scaled 1.3 blot_diameter;
173
174         rt x2 = w;
175         lft x1 = -b;
176         x3 = x2;
177         bot y1 = -d;
178         y2 = y1;
179
180         top y3 = h;
181         y4 = y3;
182         x4 = x1;
183
184         filldraw z1 --- z2 --- z3 --- z4 --- cycle ;
185 fet_endchar;
186
187
188
189 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
190 %
191 %
192 %
193 %
194 %
195 % TODO: Document these!
196
197 % setup user vars
198 def setup_notehead_vars =
199         save a_b,err_y_a,tilt,superness;
200         save ai_a,ai_bi,err_y_ai,err_x_bi,inner_tilt,inner_superness;
201         save b_h,a_w;
202         enddef;
203
204 % setup addititional vars and calc them
205 def notehead_calc =
206         save a,beta,ai,bi, ht, wd;
207         ht# =noteheight#;
208         2beta#=ht#*b_h;
209         a# = beta#*a_b;
210         wd# = 2a# / a_w;
211         ai# = a# * ai_a;
212         bi# = ai#/ai_bi;
213         define_pixels(a,beta);
214         define_pixels(ai,bi);
215         set_char_box(0, wd#, .5 ht#, .5 ht#);
216         enddef;
217
218
219 % draw the outer and inner ellipse.
220 def notehead_draw =
221         path black,white;
222         black=distorted_ellipse(a,beta,a*err_y_a,0,superness);
223         white=distorted_ellipse(ai,bi,ai*err_y_ai,bi*err_x_bi,inner_superness);
224 if test>1: %fixme
225                 save x;
226                 x1=-x3=a; x2=x4=0; y1=y3=0; y2=-y4=b;
227                 penlabels(1,2,3,4);
228                 test_grid;
229 else:
230                 black:=black rotated tilt;
231                 black:=black shifted (w/2,0);
232                 white:=white rotated inner_tilt;
233                 white:=white shifted (w/2,0);
234 fi
235                 fill black;
236                 unfill white;
237
238                 
239         enddef;
240
241 def draw_whole_head =
242         setup_notehead_vars;
243         
244         a_b:=1.80;
245         err_y_a:=0; % no slant
246         tilt:=0;
247         superness:=0.707;
248         ai_a:=0.508;
249         % ai_bi:=1.23;
250         ai_bi:=1.30; % jcn
251         % err_y_ai:=0.0938;
252         % err_x_bi:=0;
253         err_y_ai:=0;
254         err_x_bi:=0.115;
255         % inner_tilt:=135;
256         inner_tilt:=125; % jcn
257         % inner_superness:=0.69;
258         inner_superness:=0.68; % jcn
259         b_h:=1; %no rotate-> no height correction
260         a_w:=1; % no rotate-> no width correction
261
262         notehead_calc;
263         whole_notehead_width# := wd#;
264         notehead_draw;
265 enddef;
266
267
268 %
269 % dimensions aren't entirely right.
270 %
271 fet_beginchar ("Brevis notehead", "-1", "brevishead");
272         save stemthick, fudge;
273         define_pixels (stemthick);
274         fudge = blot_diameter /2;
275         stemthick# = 2 stafflinethickness#;
276
277         draw_whole_head;
278
279         pickup pencircle scaled stemthick;
280
281         bot y1 = -d;
282         top y2 = h;
283         rt x1 - fudge = 0;
284         x1 = x2;
285
286         fudge + lft x3 = w;
287         x4 = x3;
288         y4 = y2;
289         y3 = y1;
290
291         draw z1 -- z2;
292         draw z3 -- z4;
293 fet_endchar;
294
295 % whole note
296 % Wanske, p.38
297 fet_beginchar("Whole notehead", "0", "wholehead")
298         draw_whole_head;
299 fet_endchar;
300
301
302
303 % half note
304 % Wanske, p.39
305 fet_beginchar("Half notehead", "1", 
306         "halfhead")
307         setup_notehead_vars;
308                 % a_b:=1.49; % after text
309         a_b:=1.50; % after drawing
310         err_y_a:=0.157;
311         tilt:=34;
312         % superness:=0.66;
313         superness:=0.67; % jcn
314         % ai_a:=0.863;
315         ai_a:=0.850; % jcn
316         % ai_bi:=3.14;
317         ai_bi:=3.30; % jcn
318         err_y_ai:=0;
319         err_x_bi:=-0.12;
320         inner_tilt:=tilt;
321         inner_superness:=0.80;
322         b_h:=0.935;
323         a_w:=1.12;
324
325         notehead_calc;
326         half_notehead_width# := wd#;
327         notehead_draw;
328 fet_endchar;
329
330
331
332 % quarter note
333 % Wanske p.38
334 fet_beginchar("Quart notehead", "2", "quarthead")
335         setup_notehead_vars;
336         % a_b:=1.57; % after text
337         a_b:=1.54; % after drawing
338         err_y_a:=0.044;
339         tilt:=32;
340         superness:=0.707;
341         ai_a:=0;
342         ai_bi:=1;
343         err_y_ai:=0;
344         err_x_bi:=0;
345         inner_tilt:=0;
346         inner_superness:=0.707;
347         b_h:=0.85;
348         a_w:=1.09;
349
350         notehead_calc;
351         black_notehead_width# := wd#;
352         notehead_draw;
353 fet_endchar;
354
355
356 % whole note
357 % Wanske, p.38
358 fet_beginchar("Whole diamondhead", "0diamond", "wholediamondhead")
359         setup_notehead_vars;
360         
361         a_b:=1.80;
362         err_y_a:=0; % no slant
363         tilt:=0;
364         superness:=0.495;
365         ai_a:=0.350;
366         % ai_bi:=1.23;
367         ai_bi:=1.30; % jcn
368         % err_y_ai:=0.0938;
369         % err_x_bi:=0;
370         err_y_ai:=0;
371         err_x_bi:=0.115;
372         % inner_tilt:=135;
373         inner_tilt:=125; % jcn
374         % inner_superness:=0.69;
375         inner_superness:=0.6; % jcn
376         b_h:=1; %no rotate-> no height correction
377         a_w:=1; % no rotate-> no width correction
378
379         notehead_calc;
380         whole_notehead_width# := wd#;
381         notehead_draw;
382 fet_endchar;
383
384
385 % half note
386 % Wanske, p.39
387 fet_beginchar("Half diamondhead", "1diamond", 
388         "halfdiamondhead")
389         setup_notehead_vars;
390
391         a_b := 1.50; % after drawing
392         err_y_a:=0.157;
393
394         tilt:=34;
395         superness:=0.49; % jcn
396         ai_a:=0.550; % jcn
397         ai_bi:=3.30; % jcn
398
399         err_y_ai:=0;
400         err_x_bi:=-0.12;
401         inner_tilt:=tilt;
402         inner_superness:=0.80;
403
404         b_h:= 1.03;
405         a_w:= 1.2;
406
407         notehead_calc;
408         half_notehead_width# := wd#;
409         notehead_draw;
410 fet_endchar;
411
412
413 % quarter note
414 % Wanske p.38
415 fet_beginchar("Quart diamondhead", "2diamond", "diamondhead")
416         set_char_box(0, black_notehead_width#, noteheight#/2, noteheight#/2);
417         save a_b,err_y_a,tilt,superness;
418         save b_h,a_w;
419         save a,beta,ai,bi, ht, wd;
420
421         a_b:= 1.8;
422         err_y_a:=-0.044;
423         b_h:=0.90;
424         a_w:=1.1;
425         tilt:=35;
426         superness:=0.495;
427
428         ht# =noteheight#;
429         2beta#=ht#*b_h;
430         a# = beta#*a_b;
431
432         define_pixels(a,beta);
433
434         black := distorted_ellipse(.72 noteheight, .45 noteheight, -.2 noteheight ,   0, superness)
435                                 
436 %                       beta,a*err_y_a,0,superness);
437
438         black:=black rotated tilt;
439         black:=black shifted (w/2,0);
440         fill black;
441 fet_endchar;
442
443 save triangle; path triangle;
444 triangle = (-sqrt3/4,-1/2) -- (0,1) -- (sqrt3/4,-1/2) -- cycle;
445
446 fet_beginchar("Whole trianglehead", "0triangle", "wholetrianglehead")
447         set_char_box(0, 2(noteheight#+stafflinethickness#)/sqrt3*7/8,
448           (noteheight#+stafflinethickness#)/2,(noteheight#+stafflinethickness#)/2);
449         fill triangle scaled (7h/6) shifted (w/2,-h/6);
450         unfill triangle scaled 0.72h shifted (w/2,-h/6);
451 fet_endchar;
452 fet_beginchar("Half trianglehead", "1triangle", "halftrianglehead")
453         thick := 1.2stafflinethickness;
454         set_char_box(0, 2noteheight#/sqrt3*7/8,noteheight#/2,noteheight#/2);
455         fill triangle scaled (7h/6) shifted (w/2,-h/6);
456         unfill triangle scaled 0.7h shifted (w/2,-h/6);
457 fet_endchar;
458 fet_beginchar("Quart trianglehead", "2triangle", "trianglehead")
459         thick := 1.2stafflinethickness;
460         set_char_box(0, 2noteheight#/sqrt3*7/8,noteheight#/2,noteheight#/2);
461         fill triangle scaled (7h/6) shifted (w/2,-h/6);
462 fet_endchar;
463
464 %%% Editable values:
465 slope := 1.7; % slope of slash. From scm/grob-description.scm. How to auto-copy?
466 slt := 2/3*0.48staff_space; % thickness of lines. quarter notes get 1.5slt width.
467 slh := 2staff_space; % height of char.
468
469 %%% Calculated values:
470 sxa := 0; % how much the char exceeds the boundingbox horizontally:
471 slxt := sqrt(slt*slt+(slt/slope)*(slt/slope)); % Width of hor. pen - with thanks to Pythagoras
472 slw := slh/slope; % width of sloping part of slash:
473
474 % is this really nessesary? -rz
475 fac# := staff_space#/staff_space;
476 slt# := fac#*slt;
477 slh# := fac#*slh;
478 sxa# := fac#*sxa;
479 slxt# := fac#*slxt;
480 slw# := fac#*slw;
481
482 def draw_slash(expr hwid) =
483         wid# := slw#+2slxt#+hwid*fac#;
484         set_char_box(0,wid#-2sxa#,slh#/2,slh#/2);
485         define_pixels (wid#);
486         pickup penrazor scaled slxt;
487         draw (-b+slxt/2-sxa,-d) -- (-b+slxt/2+slw-sxa,h);
488         draw (w-slxt/2-slw+sxa,-d) -- (w-slxt/2+sxa,h);
489         pickup penrazor scaled slt rotated 90;
490         draw (-b+slxt-sxa,-d+slt/2) -- (w-slw+sxa,-d+slt/2);
491         draw (-b+slw-sxa,h-slt/2) -- (w-slxt+sxa,h-slt/2);
492 enddef;
493
494 fet_beginchar("Whole slashhead","0slash","wholeslashhead")
495         draw_slash(staff_space);
496 fet_endchar;
497
498 fet_beginchar("Half slashhead","1slash","halfslashhead")
499         draw_slash(0.6staff_space);
500 fet_endchar;
501
502 fet_beginchar("Quart slashhead","2slash","quartslashhead")
503         draw_slash(-slxt/2);
504 fet_endchar;
505
506 % thick is the distance between the two parallel lines in the cross (distance between centres of lines)
507 def draw_cross(expr thick) =
508         pent := 1.2stafflinethickness;
509         pickup pencircle scaled pent;
510         % alfa is the slant of the lines (i.e. 1 means 45 degrees)
511         alfa := (2h-pent)/(w-pent);
512         % llen is the length of the little outer lines
513         % llen = thick / sin(2atan(alfa))
514         llen := thick/(ypart(dir(2angle(1,alfa))));
515         xa := llen/sqrt(1+alfa**2);
516         ya := xa*alfa;
517         xl := w/2-xa-pent/2;
518         yl := h-ya-pent/2;
519         save crz; path crz;
520         crz = (xa,0) -- (xa+xl,yl) -- (xl,yl+ya) -- (0,ya);
521         draw crz shifted(w/2,0);
522         draw crz xscaled -1 shifted(w/2,0);
523         draw crz yscaled -1 shifted(w/2,0);
524         draw crz scaled -1 shifted(w/2,0);
525 enddef;
526
527 fet_beginchar("Whole Crossed notehead", "0cross", "wholecrossedhead")
528         wid# := black_notehead_width#+4stafflinethickness#;
529         hei# := noteheight#+stafflinethickness#;
530         set_char_box(0, wid#,hei#/2,hei#/2);
531         draw_cross(3.75stafflinethickness);
532 fet_endchar;
533
534 fet_beginchar("Half Crossed notehead", "1cross", "halfcrossedhead")
535         wid# := black_notehead_width#+2stafflinethickness#;
536         hei# := noteheight#+stafflinethickness#/2;
537         set_char_box(0, wid#,hei#/2,hei#/2);
538         draw_cross(3stafflinethickness);
539 fet_endchar;
540
541 fet_beginchar("Crossed notehead", "2cross", "crossedhead")
542         wid# := black_notehead_width#;
543         hei# := noteheight#;
544         set_char_box(0, wid#,hei#/2,hei#/2);
545         draw_cross(stafflinethickness/4);
546 fet_endchar;
547
548 fet_beginchar("X-Circled notehead", "2xcircle", "xcircledhead")
549         wid# := black_notehead_width#;
550         hei# := noteheight#+stafflinethickness#;
551         set_char_box(0, wid#,hei#/2,hei#/2);
552         cthick := 1.2stafflinethickness;
553         cxr := w/2-cthick/2;
554         cyr := h-cthick/2;
555         pickup pencircle scaled cthick;
556         draw fullcircle xscaled 2cxr yscaled 2cyr shifted (w/2,0);
557         xpos := cxr/sqrt2;
558         ypos := cyr/sqrt2;
559         draw (-xpos+w/2,-ypos) -- (xpos+w/2,ypos);
560         draw (-xpos+w/2,ypos) -- (xpos+w/2,-ypos);
561 fet_endchar;
562
563 %%%%%%%%
564 %
565 %
566 %
567 % EDITIO VATICANA
568 %
569 %
570 %
571
572 % subbipunctum
573 fet_beginchar("Ed. Vat. subbipunctum", "0vaticana_subbipunctum",
574         "vatsubbipunctumhead")
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#;
582         2beta# = ht# * b_h;
583         a# = beta# * a_b;
584         wd# = 2a# / a_w;
585         set_char_box(0, wd#, 0.5 ht#, 0.5 ht#);
586         black_notehead_width# := wd#;
587
588         save za, alpha, size;
589         pair za;
590         define_pixels(ht, wd);
591         alpha = 35;
592         size = 0.45ht;
593         pickup pencircle
594                 xscaled 0
595                 yscaled size rotated -alpha;
596         za = (0, size) / 2 rotated alpha;
597         draw -za .. za;
598
599 fet_endchar;
600
601
602 % parametrized punctum
603 def punctum_char (expr verbose_name, internal_name, mudela_name,
604         left_stem, right_stem,
605         straight, reverse_convexity, excentric, up_shift, mag) =
606
607         fet_beginchar(verbose_name, internal_name, mudela_name)
608                 save b_h, a_w;
609                 a_b := 1.54; % b_h*a_b/a_w = wd/ht
610                 b_h := 0.85;
611                 a_w := 1.09;
612
613                 save a, beta, ht, wd;
614                 ht# = noteheight# * mag;
615                 2beta# = ht# * b_h;
616                 a# = beta# * a_b;
617                 wd# = 2a# / a_w;
618                 set_char_box(0.0, 0.4wd#, 0.5ht#, 0.5ht#);
619                 black_notehead_width# := wd#;
620
621                 save convexity;
622                 if straight:
623                         if reverse_convexity:
624                                 convexity# = -0.02ht#;
625                         else:
626                                 convexity# = +0.02ht#;
627                         fi;
628                 else:
629                         if reverse_convexity:
630                                 convexity# = -0.05ht#;
631                         else:
632                                 convexity# = +0.05ht#;
633                         fi;
634                 fi;
635
636                 save yoffs;
637                 if up_shift:
638                         yoffs# = 0.08ht#;
639                 else:
640                         yoffs# = 0.00ht#;
641                 fi
642
643                 define_pixels(ht, wd, convexity, yoffs);
644                 pickup pencircle scaled stafflinethickness;
645
646                 if excentric:
647                         z1 = (0.00wd, yoffs - 1.0convexity);
648                         z2 = (0.08wd, yoffs + 1.4convexity);
649                         z3 = (0.40wd, yoffs);
650                         penpos1(0.50ht, 90);
651                         penpos2(0.50ht, 90);
652                         penpos3(0.50ht, 90);
653                         if reverse_convexity:
654                                 penstroke z1e{up} .. z2e{right} .. z3e;
655                         else:
656                                 penstroke z1e{down} .. z2e{right} ..z3e;
657                         fi;
658                 else:
659                         z1 = (0.00wd, yoffs);
660                         z2 = (0.20wd, yoffs + convexity);
661                         z3 = (0.40wd, yoffs);
662                         penpos1(0.50ht, 90);
663                         penpos2(0.50ht, 90);
664                         penpos3(0.50ht, 90);
665                         penstroke z1e .. z2e .. z3e;
666                 fi;
667
668                 if left_stem:
669                         z5=(0.00wd + 0.5 stafflinethickness, yoffs);
670                         z6=(0.00wd + 0.5 stafflinethickness, yoffs - 1.5ht);
671                         draw z5 -- z6;
672                 elseif right_stem:
673                         z5=(0.40wd - 0.25 stafflinethickness, yoffs);
674                         z6=(0.40wd - 0.25 stafflinethickness, yoffs - 1.5ht);
675                         draw z5 -- z6;
676                 fi;
677
678         fet_endchar;
679 enddef;
680
681
682 % punctum
683 punctum_char("Ed. Vat. punctum", "0vaticana_punctum", "vatpunctumhead",
684         false, false, false, false, false, false, 1.0);
685
686 % virga (i.e. right stemmed punctum)
687 punctum_char("Ed. Vat. virga", "0vaticana_virga", "vatvirgahead",
688         false, true, false, false, false, false, 1.0);
689
690 % left stemmed punctum as used in clivis (flexa) ligature
691 punctum_char("Ed. Vat. reverse virga", "0vaticana_rvirga", "vatrvirgahead",
692         true, false, false, false, false, false, 1.0);
693
694 % pes lower punctum
695 punctum_char("Ed. Vat. pes lower punctum", "0vaticana_lpes", "vatlpeshead",
696         false, false, true, true, false, false, 1.0);
697
698 % pes upper punctum
699 punctum_char("Ed. Vat. pes upper punctum", "0vaticana_upes", "vatupeshead",
700         false, false, true, false, false, false, 1.0);
701
702 % pes upper punctum (shifted variation)
703 %
704 % Note: This note head is used instead of the regular pes upper
705 % punctum to avoid collision with the lower punctum note of the pes when
706 % the upper punctum sits directly on top of the lower punctum.
707 punctum_char("Ed. Vat. var pes upper punctum", "0vaticana_vupes",
708         "vatvupeshead",
709         false, false, true, false, false, true, 1.0);
710
711 % small punctum as used in epiphonus/cephalicus
712 punctum_char("Ed. Vat. plica", "0vaticana_plica", "vatplicahead",
713         false, false, true, false, false, false, 0.5);
714
715 % excentric punctum as used in epiphonus
716 punctum_char("Ed. Vat. epiphonus", "0vaticana_epiphonus", "vatepiphonushead",
717         false, false, false, true, true, false, 1.0);
718
719 % excentric punctum as used in cephalicus
720 punctum_char("Ed. Vat. cephalicus", "0vaticana_cephalicus",
721         "vatcephalicushead",
722         false, false, false, false, true, false, 1.0);
723
724 % quilisma
725 fet_beginchar("Ed. Vat. quilisma", "0vaticana_quilisma", "vatquilismahead")
726         save b_h,a_w;
727         a_b:=1.54; % b_h*a_b/a_w = wd/ht
728         b_h:=0.85;
729         a_w:=1.09;
730
731         save a, beta, ht, wd;
732         ht# =noteheight#;
733         2beta#=ht#*b_h;
734         a# = beta#*a_b;
735         wd# = 2a# / a_w;
736         set_char_box(0, wd#, 0.5 ht#, 0.5 ht#);
737         black_notehead_width# := wd#;
738
739         define_pixels(ht, wd);
740         pickup pencircle xscaled stafflinethickness yscaled 0.4ht;
741         z1=(0.00wd,-0.10ht);
742         z2=(0.00wd,+0.05ht);
743         z3=(0.15wd,-0.05ht);
744         z4=(0.15wd,+0.10ht);
745         z5=(0.30wd,+0.00ht);
746         z6=(0.30wd,+0.15ht);
747         draw z1 -- z2 -- z3 -- z4 -- z5 -- z6;
748
749 fet_endchar;
750
751 %%%%%%%%
752 %
753 %
754 %
755 % EDITIO MEDICAEA
756 %
757 %
758 %
759
760 % subbipunctum
761 fet_beginchar("Ed. Med. subbipunctum", "0medicaea_subbipunctum",
762         "medsubbipunctumhead")
763         save b_h, a_w;
764         a_b := 1.54; % b_h*a_b/a_w = wd/ht
765         b_h := 0.85;
766         a_w := 1.09;
767
768         save a, beta, ht, wd;
769         ht# = noteheight#;
770         2beta# = ht# * b_h;
771         a# = beta# * a_b;
772         wd# = 2a# / a_w;
773         set_char_box(0, wd#, 0.5 ht#, 0.5 ht#);
774         black_notehead_width# := wd#;
775
776         save za, alpha, size;
777         pair za;
778         define_pixels(ht, wd);
779         alpha = 35;
780         size = 0.7ht;
781         pickup pencircle
782                 xscaled 0
783                 yscaled size rotated -alpha;
784         za = (0, size) / 2 rotated alpha;
785         draw -za .. za;
786
787 fet_endchar;
788
789 % parametrized punctum
790 def punctum_char (expr verbose_name, internal_name, mudela_name,
791         left_up_stem, left_down_stem) =
792
793         fet_beginchar(verbose_name, internal_name, mudela_name)
794
795                 save a, beta, ht, wd;
796                 ht# = 2 staff_space#;
797                 wd# = ht#;
798                 set_char_box(0.0, 0.4wd#, 0.5ht#, 0.5ht#);
799                 black_notehead_width# := wd#;
800
801                 define_pixels(ht, wd);
802                 pickup pencircle scaled stafflinethickness;
803
804                         z1 = (0.00wd, 0);
805                         z2 = (0.20wd, 0);
806                         z3 = (0.40wd, 0);
807                         penpos1(0.50ht, 90);
808                         penpos2(0.50ht, 90);
809                         penpos3(0.50ht, 90);
810                         penstroke z1e .. z2e .. z3e;
811
812                 if left_down_stem:
813                         z5=(0.00wd + 0.5 stafflinethickness, 0);
814                         z6=(0.00wd + 0.5 stafflinethickness, - 1.25ht);
815                         draw z5 -- z6;
816                 elseif left_up_stem:
817                         z5=(0.00wd + 0.5 stafflinethickness, 0);
818                         z6=(0.00wd + 0.5 stafflinethickness, + 1.25ht);
819                         draw z5 -- z6;
820                 fi;
821
822         fet_endchar;
823 enddef;
824
825 % punctum
826 punctum_char("Ed. Med. punctum", "0medicaea_punctum", "medpunctumhead",
827         false, false);
828
829 % left up-stemmed punctum
830 punctum_char("Ed. Med. reverse virga", "0medicaea_rvirga", "medrvirgahead",
831         true, false);
832
833 % virga (i.e. left down-stemmed punctum)
834 punctum_char("Ed. Med. virga", "0medicaea_virga", "medvirgahead",
835         false, true);
836
837 %%%%%%%%
838 %
839 %
840 %
841 % HUFNAGEL
842 %
843 %
844 %
845
846 % punctum
847 % parametrized punctum
848 def punctum_char (expr verbose_name, internal_name, mudela_name,
849         down_stem) =
850
851         fet_beginchar(verbose_name, internal_name, mudela_name)
852                 save b_h, a_w;
853                 a_b := 1.54; % b_h*a_b/a_w = wd/ht
854                 b_h := 0.85;
855                 a_w := 1.09;
856
857                 save a, beta, ht, wd;
858                 ht# = noteheight#;
859                 2beta# = ht# * b_h;
860                 a# = beta# * a_b;
861                 wd# = 2a# / a_w;
862                 set_char_box(wd#/2, wd#/2, 0.5 ht#, 0.5 ht#);
863                 black_notehead_width# := wd#;
864
865                 save za, zb, zc, alpha, size;
866                 pair za, zb, zc;
867                 define_pixels(ht, wd);
868                 alpha = 55;
869                 size = 0.7ht;
870                 pickup pencircle
871                         xscaled 0
872                         yscaled size rotated -alpha;
873                 za = (0, size) / 2 rotated alpha;
874                 draw -za .. za;
875
876                 if down_stem:
877                         zb = (0.00wd, 0);
878                         zc = (0.00wd, - 1.25ht);
879                         draw zb -- zc;
880                 fi;
881         fet_endchar;
882 enddef;
883
884 % punctum
885 punctum_char("Hufnagel punctum", "0hufnagel_punctum", "hufpunctumhead", false)
886
887 % virga
888 punctum_char("Hufnagel virga", "0hufnagel_virga", "hufvirgahead", true)
889
890 % pes lower punctum
891 fet_beginchar("Hufnagel pes lower punctum", "0hufnagel_lpes", "huflpeshead")
892         save b_h, a_w;
893         a_b := 1.54; % b_h*a_b/a_w = wd/ht
894         b_h := 0.85;
895         a_w := 1.09;
896
897         save a, beta, ht, wd;
898         ht# = noteheight#;
899         2beta# = ht# * b_h;
900         a# = beta# * a_b;
901         wd# = 2a# / a_w;
902         set_char_box(wd#/2, wd#/2, 0.7 ht#, 0.7 ht#);
903         black_notehead_width# := wd#;
904
905         save za, zb, zc, alpha, size;
906         pair za, zb, zc;
907         define_pixels(ht, wd);
908         alpha = 35;
909         size = 0.7ht;
910         pickup pencircle
911                 xscaled 0
912                 yscaled size rotated -alpha;
913         za = (size, 0);
914         draw -za .. za;
915 fet_endchar;
916
917 fet_endgroup("noteheads");
918 define_pixels(black_notehead_width);