]> git.donarmstrong.com Git - lilypond.git/blob - mf/parmesan-heads.mf
Merge with master
[lilypond.git] / mf / parmesan-heads.mf
1 % -%-Fundamental-%- -*-Metafont-*-
2 % parmesan-heads.mf -- implement ancient note heads
3
4 % source file of LilyPond's pretty-but-neat music font
5
6 % (c) 2001--2006 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 %
18 % character aligment:
19 %
20 %   The head is assumed to be vertically centered around (0, 0).
21 %   The left-most edge of the head should touch the vertical line
22 %   that goes though the point (0, 0).
23 %
24 % set_char_box() conventions:
25 %
26 % * breapth: Ignored (as far as I know).  Should be set to 0.
27 %
28 % * width: Should match the head's width.
29 %
30 % * depth: Should match the bottom edge of the head.  Affects vertical
31 %   collision handling.
32 %
33 % * height: Should match the top edge of the head.  Affects vertical
34 %   collision handling.
35 %
36 % TODO: should depth/height include appendages/stems?
37
38 overdone_heads = 0;
39 noteheight# := staff_space# + (1 + overdone_heads)*stafflinethickness#;
40 define_pixels(noteheight);
41
42
43 %%%%%%%%
44 %
45 %
46 %
47 % MENSURAL NOTATION
48 %
49 %
50 %
51
52 def draw_neomensural_brevis(expr brevwid) =
53         save beamheight, head_width;
54         save holeheight, stem_width;
55         save serif_size, serif_protrude;
56
57         head_width# = brevwid;
58         holeheight = 3 stafflinethickness;
59         stem_width = 1.4 stafflinethickness;
60
61
62         define_pixels(head_width);
63         set_char_box(0, head_width#, noteheight#/2, noteheight#/2);
64         
65         2 beamheight + holeheight = noteheight;
66         serif_size = (holeheight - stafflinethickness)/2;
67         serif_protrude = 1.5 serif_size;
68         penpos1(stem_width, 0);
69         penpos2(stem_width, 0);
70         penpos3(beamheight, 90);
71         penpos4(beamheight, 90);
72         penpos5(stem_width, 180);
73
74         z1l = (0, 0);
75         z2l = (0, -stafflinethickness/2);
76         z3r = z2r + serif_size *(1,-1);
77         y4r = y3r;
78         x4r = head_width/2;
79         z5l = z3l + (-serif_size, -serif_protrude);
80
81         penlabels(1,2,3,4, 5);
82         fill z1r -- z1l -- z5r{down} .. z5l{up} .. z3l{right}
83                 -- z4l -- z4r -- z3r{left} .. z2r{up} -- cycle;
84
85         addto currentpicture also currentpicture yscaled -1;
86         addto currentpicture also currentpicture 
87                 shifted (-x4r,0) xscaled -1 shifted (x4l,0);
88
89 enddef;
90
91
92 %%% This head does not seem to be used anywhere.  Junk me?  -- jr
93 def draw_neomensural_left_stemmed_head (expr wid) =
94         draw_neomensural_brevis(wid);
95
96         x6 = x7 = stem_width/2;
97         y6 = y5;
98         y7 = y5 - 2.25 staff_space;
99         pickup pencircle scaled stem_width;
100         draw z6 .. z7;
101 enddef;
102
103 %%% This head does not seem to be used anywhere.  Junk me?  -- jr
104 fet_beginchar("Left stemmed notehead", "slneomensural");
105         draw_neomensural_left_stemmed_head (2 staff_space#);
106 fet_endchar;
107
108 %
109 % Some sources (eg. Musix/OpusTeX) think that the appendage should be on
110 % the left, some say right. Right wins democratically.
111 %
112 def draw_neomensural_longa (expr wid) =
113         draw_neomensural_brevis(wid);
114         save theta;
115
116         x7r = head_width;
117         y7 = y5;
118 %       z7 = z5;
119         z6 - z7 = (stem_width/2, -staff_space);
120         theta = angle(z6-z7)+ 90;
121         penpos7(stem_width, theta);
122         penpos6(1.2 stem_width, theta);
123         
124         fill z7r .. z6r{z6-z7} .. {z7-z6} z6l -- z7l -- cycle;
125         penlabels(6,7);
126 enddef;
127
128 %
129 % En wij presenteren U: de opvolgster van Emily
130 %
131 % (ze is wel breed)
132
133 fet_beginchar("Neo-mensural maxima notehead", "s-3neomensural");
134         draw_neomensural_longa (2.6 staff_space#)
135 fet_endchar;
136
137 fet_beginchar("Neo-mensural longa notehead", "s-2neomensural");
138         draw_neomensural_longa (2 staff_space#)
139 fet_endchar;
140
141 fet_beginchar("Neo-mensural brevis notehead", "s-1neomensural")
142         draw_neomensural_brevis(2 staff_space#);
143 fet_endchar;
144
145 def draw_neomensural_black_head (expr wid, height) =
146         save head_width;
147         head_width# = wid;
148         set_char_box (0, head_width#, height/2, height/2);
149         
150         charwx := head_width# / 2;
151         charwy := height / 2;
152
153         y3 = y1 =0;
154         x2 = x4 = (x1 + x3) /2;
155         define_pixels (head_width);
156         pickup pencircle scaled blot_diameter;
157         top y2 = h;
158         bot y4 = -d;
159         lft x1 = 0;
160         rt x3 = w;
161
162         filldraw z1 -- z2 -- z3 -- z4 -- cycle;
163 enddef;
164
165 def draw_neomensural_open_head (expr wid, height)=
166         draw_neomensural_black_head (wid, height);
167         save diamNW, diamSW;
168         diamNW = length (z2 - z1) + blot_diameter;
169         diamSW = length (z4 - z1) + blot_diameter;
170         
171         save hole_widthNW, hole_widthSW;
172         hole_widthNW = 0.34 diamNW ;
173         hole_widthSW + 2.6 linethickness = diamSW;
174
175         (z7 + z5)/2 = (w/2, 0);
176         (z8 + z6)/2 = (w/2, 0);
177         (z6 - z5) = hole_widthNW * unitvector (z2 - z1);
178         (z7 - z6) = hole_widthSW * unitvector (z4 - z1);
179
180         labels (1,2,3,4,5,6,7,8);
181
182         unfill z5 -- z6 -- z7 -- z8 --cycle;
183 enddef;
184
185 %
186 % WL says the thin lines should be thinner.
187 %
188 fet_beginchar("Harmonic notehead (Neo-mensural open)",
189               "s0harmonic")
190         draw_neomensural_open_head (1.3 staff_space#, 1.3 noteheight#);
191         charwx := head_width#;
192         charwy := 0;
193 fet_endchar;
194
195 fet_beginchar("Neo-mensural semibrevis head","s0neomensural")
196       draw_neomensural_open_head (staff_space#, noteheight#);
197 fet_endchar;
198
199 fet_beginchar("Neo-mensural minima head","s1neomensural")
200       draw_neomensural_open_head (staff_space#, noteheight#);
201 fet_endchar;
202
203 fet_beginchar("Neo-mensural semiminima head","s2neomensural")
204       draw_neomensural_black_head (staff_space#, noteheight#);
205 fet_endchar;
206
207 def draw_mensural_brevis (expr wid) =
208         % TODO.  For the moment, fall back to draw_neomensural_brevis.
209         draw_neomensural_brevis(wid);
210 enddef;
211
212 %%% This head does not seem to be used anywhere.  Junk me?  -- jr
213 def draw_mensural_left_stemmed_head (expr wid) =
214         draw_mensural_brevis(wid);
215         x6 = x7 = stem_width/2;
216         y6 = y5;
217         y7 = y5 - 2.25staff_space;
218         pickup pencircle scaled stem_width;
219         draw z6 .. z7;
220 enddef;
221
222 def draw_mensural_longa (expr wid) =
223         draw_mensural_brevis(wid);
224         x6 = x7 = head_width - stem_width/2;
225         y6 = y5;
226         y7 = y5 - 2.25staff_space;
227         pickup pencircle scaled stem_width;
228         draw z6 .. z7;
229 enddef;
230
231 %%% This head does not seem to be used anywhere.  Junk me?  -- jr
232 fet_beginchar("Mensural left stemmed notehead", "slmensural");
233         draw_mensural_left_stemmed_head (staff_space#)
234 fet_endchar;
235
236 fet_beginchar("Mensural maxima notehead", "s-3mensural");
237         draw_mensural_longa (2.0 staff_space#)
238 fet_endchar;
239
240 fet_beginchar("Mensural longa notehead", "s-2mensural");
241         draw_mensural_longa (staff_space#)
242 fet_endchar;
243
244 fet_beginchar("Mensural brevis notehead", "s-1mensural")
245         draw_mensural_brevis(staff_space#);
246 fet_endchar;
247
248 def draw_diamond_head (expr head_h, pen_w, pen_h, angle, open) =
249       save head_width, head_height;
250       head_height# = head_h;
251       head_width# / head_height# = tand(angle);
252
253       set_char_box (0, head_width#,
254         head_height#/2, head_height#/2);
255       
256       charwx := head_width# / 2;
257       charwy := head_height# / 2 - linethickness#;
258
259       define_pixels(head_width, head_height);
260       pickup pencircle
261              xscaled (max(blot_diameter, pen_w * head_width))
262              yscaled (max(blot_diameter, pen_h * head_width))
263              rotated -angle;
264
265       %% FIXME: replace "xpart (top z2)" (and, analogously,
266       %% "ypart (rt z3)") with an expression that really delivers the
267       %% x coordinate of the uppermost pixel that is drawn with respect
268       %% to the pencircle (this requires some elliptical computations).
269       %% MF obviously interprets "xpart (top z2)" as "top (xpart z2)",
270       %% i.e. "top x2", which is not what we want.
271
272       xpart (top z2) = ypart (rt z3) = 0;
273       top y2 = head_height/2;
274       rt x3 = head_width/2;
275       z2 = - z4;
276       z3 = - z1;
277
278       if open:
279               draw z1 -- z2 -- z3 -- z4 -- cycle;
280       else:
281               filldraw z1 -- z2 -- z3 -- z4 -- cycle;
282       fi;
283
284       currentpicture := currentpicture shifted (head_width/2, 0);
285
286 enddef;
287
288
289 fet_beginchar("Mensural semibrevis head","s0mensural")
290         draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
291 fet_endchar;
292
293 fet_beginchar("Mensural minima head","s1mensural")
294         draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
295 fet_endchar;
296
297 fet_beginchar("Mensural semiminima head","s2mensural")
298         draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
299 fet_endchar;
300
301 fet_beginchar("Petrucci semibrevis head","s0petrucci")
302 %       draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, true);
303         draw_neomensural_open_head (staff_space#, 1.8 staff_space#);
304 fet_endchar;
305
306 fet_beginchar("Petrucci minima head","s1petrucci")
307 %       draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, true);
308         draw_neomensural_open_head (staff_space#, 1.8 staff_space#);
309 fet_endchar;
310
311 fet_beginchar("Petrucci semiminima head","s2petrucci")
312 %       draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, false);
313         draw_neomensural_black_head (staff_space#, 1.8 staff_space#);
314 fet_endchar;
315
316
317 %%%%%%%%
318 %
319 %
320 %
321 % EDITIO VATICANA (including solesmes extensions)
322 %
323 %
324 %
325
326 % parameterized punctum
327 def punctum_char (expr verbose_name, internal_name,
328                   left_stem, right_stem, linea, cavum,
329                   straight, auctum, rev_auctum, direction_up,
330                   excentric, up_shift, down_shift, mag) =
331
332         fet_beginchar(verbose_name, "s" & internal_name)
333                 save b_h, a_w;
334                 a_b := 1.54; % b_h*a_b/a_w = wd/ht
335                 b_h := 0.85;
336                 a_w := 1.09;
337
338                 save a, beta, ht, wd;
339                 ht# = noteheight# * mag;
340                 2beta# = ht# * b_h;
341                 a# = beta# * a_b;
342                 wd# = 2a# / a_w;
343                 black_notehead_width# := wd#;
344
345                 % direction
346                 save direction, direction_sign;
347                 pair direction;
348                 if direction_up:
349                         direction = up;
350                         direction_sign# = 1;
351                 else:
352                         direction = down;
353                         direction_sign# = -1;
354                 fi;
355
356                 % convexity and eccentricity
357                 save u_convexity, u_eccentricity;
358                 if straight:
359                         u_convexity# = -0.01ht#;
360                         u_eccentricity# = 0.0ht#; % dummy
361                 elseif auctum:
362                         u_convexity# = -0.03ht#;
363                         u_eccentricity# = +0.25ht#;
364                 elseif rev_auctum:
365                         u_convexity# = -0.10ht#;
366                         u_eccentricity# = -0.12ht#;
367                 else:
368                         u_convexity# = -0.05ht#;
369                         u_eccentricity# = 0.0ht#; % dummy
370                 fi;
371                 save convexity, eccentricity;
372                 convexity# = direction_sign# * u_convexity#;
373                 eccentricity# = direction_sign# * u_eccentricity#;
374
375                 % y shift offset
376                 save yoffs;
377                 if up_shift:
378                         yoffs# = 0.08ht#;
379                 elseif down_shift:
380                         yoffs# = -0.11ht#;
381                 else:
382                         yoffs# = 0.00ht#;
383                 fi
384
385                 define_pixels(convexity, eccentricity, yoffs, ht, wd);
386                 pickup pencircle scaled linethickness;
387
388                 path p;
389                 save height, yoffs_bt;
390                 define_pixels (height, yoffs_bt);
391                 height# = 0.47ht#;
392                 yoffs_bt# = yoffs# - 0.5*height# - 0.25*convexity#;
393                 xpart z1a = xpart z1b;
394                 xpart z2a = xpart z2b;
395                 xpart z3a = xpart z3b;
396                 ypart z1a + height = ypart z1b;
397                 ypart z2a + height = ypart z2b;
398                 ypart z3a + height = ypart z3b;
399
400                 save box_top, box_bt;
401
402                 if auctum or rev_auctum:
403                         z1a = (0.00wd + linethickness/2, yoffs_bt);
404                         z2a = (0.21wd, yoffs_bt + 1.0*convexity);
405                         z3a = (0.42wd - linethickness/2,
406                                yoffs_bt + 1.0*eccentricity);
407                         box_top# = height# + yoffs_bt# +
408                                 max(0, 1.0*convexity#, 1.0*eccentricity#);
409                         box_bt# = yoffs_bt# +
410                                 min(0, 1.0*convexity#, 1.0*eccentricity#);
411                         p = z1a .. {right}z2a .. {direction}z3a --
412                             z3b{-direction} .. z2b{left} .. z1b -- cycle;
413                 elseif excentric:
414                         z1a = (0.00wd + linethickness/2,
415                                yoffs_bt - 1.0*convexity);
416                         z2a = (0.08wd, yoffs_bt + 1.4*convexity);
417                         z3a = (0.42wd - linethickness/2,
418                                yoffs_bt - 1.0*convexity);
419                         box_top# = height# + yoffs_bt# +
420                                 max(-1.0*convexity#, 1.4*convexity#, 0);
421                         box_bt# = yoffs_bt# +
422                                 min(-1.0*convexity#, 1.4*convexity#, 0);
423                         p = z1a{direction} .. z2a{right} .. z3a --
424                             z3b .. {left}z2b .. {-direction}z1b -- cycle;
425                 else:
426                         z1a = (0.00wd + linethickness/2, yoffs_bt);
427                         z2a = (0.21wd, yoffs_bt + 1.0*convexity);
428                         z3a = (0.42wd - linethickness/2, yoffs_bt);
429                         box_top# = height# + yoffs_bt# +
430                                 max(0, 1.0*convexity#);
431                         box_bt# = yoffs_bt# +
432                                 min(0, 1.0*convexity#);
433                         p = z1a .. z2a .. z3a --
434                             z3b .. z2b .. z1b -- cycle;
435                 fi;
436
437                 if cavum:
438                         draw p;
439                 else:
440                         filldraw p;
441                 fi;
442
443                 pickup pencircle scaled 0.6linethickness;
444
445                 save stem_bt;
446
447                 if left_stem:
448                         z5=(0.00wd + 0.6linethickness/2, yoffs);
449                         z6=(0.00wd + 0.6linethickness/2, yoffs - 1.1ht);
450                         draw z5 -- z6;
451                         stem_bt# = yoffs# - 1.1ht#;
452                 elseif right_stem:
453                         z5=(0.42wd - 0.6linethickness/2, yoffs);
454                         z6=(0.42wd - 0.6linethickness/2, yoffs - 1.5ht);
455                         draw z5 -- z6;
456                         stem_bt# = yoffs# - 1.5ht#;
457                 else:
458                         stem_bt# = 0;
459                 fi;
460
461                 set_char_box(0.00wd#, 0.42wd#,
462                              max(0, -box_bt#, -stem_bt#) + linethickness#/2,
463                              max(0, box_top#) + linethickness#/2);
464
465                 if linea:
466                         save linea_width, linea_height;
467                         linea_width# = 0.6 linethickness#;
468                         linea_height# = 0.7 ht#;
469                         define_pixels (linea_width, linea_height);
470                         draw_block ((-0.10wd - linea_width/2,
471                                      -linea_height/2),
472                                     (-0.10wd + linea_width/2,
473                                      +linea_height/2));
474                         draw_block ((+0.52wd - linea_width/2,
475                                      -linea_height/2),
476                                     (+0.52wd + linea_width/2,
477                                      +linea_height/2));
478                         set_char_box(0,
479                                      0.62wd# + linea_width#,
480                                      linea_height#/2,
481                                      linea_height#/2);
482                         currentpicture := currentpicture
483                                 shifted (0.10wd + linea_width/2, 0);
484                 fi;
485         fet_endchar;
486 enddef;
487
488 % parameterized punctum inclinatum
489 def inclinatum_char(expr verbose_name, internal_name,
490                     small, stropha, auctum) =
491
492         fet_beginchar(verbose_name, "s"&internal_name)
493                 save ht, alpha;
494                 alpha# = 35;
495                 if small:
496                         ht# = 0.50 noteheight#;
497                 else:
498                         ht# = 0.80 noteheight#;
499                 fi;
500
501                 draw_diamond_head (ht#, 0, 0, alpha#, false);
502
503                 if stropha:
504                         pickup pencircle
505                                 xscaled (0.25*head_height)
506                                 yscaled (0.55*head_height)
507                                 rotated alpha#;
508                         save za, off_angle; pair za;
509                         off_angle := 15;
510                         za = (0, -0.25*head_height)
511                                 rotated -(alpha# + off_angle)
512                                 shifted (0.48 head_width, -0.02 head_width);
513                         undraw za;
514                 fi;
515
516                 if auctum:
517                         pickup pencircle scaled linethickness;
518                         save za, zb, zc;
519                         pair za, zb, zc;
520                         za = (0, -0.5 head_height + linethickness);
521                         zb = 0.6 (za + zc);
522                         zc = za + (0.52 head_width, 0);
523                         draw za{(0,-1) rotated alpha#} .. {right}zb{right} ..
524                              {(0,1) rotated -alpha#}zc;
525                 fi;
526         fet_endchar;
527 enddef;
528
529 % punctum
530 punctum_char("Ed. Vat. punctum", "vaticana.punctum",
531              false, false, false, false, false,
532              false, false, false, false, false, false, 1.0);
533
534 % punctum cavum (for OpusTeX compatibility)
535 punctum_char("Ed. Vat. punctum cavum", "vaticana.punctum.cavum",
536              false, false, false, true, false,
537              false, false, false, false, false, false, 1.0);
538
539 % linea punctum (for OpusTeX compatibility)
540 punctum_char("Ed. Vat. linea punctum", "vaticana.linea.punctum",
541              false, false, true, false, false,
542              false, false, false, false, false, false, 1.0);
543
544 % linea punctum cavum (for OpusTeX compatibility)
545 punctum_char("Ed. Vat. linea punctum cavum", "vaticana.linea.punctum.cavum",
546              false, false, true, true, false,
547              false, false, false, false, false, false, 1.0);
548
549 % punctum inclinatum
550 inclinatum_char("Ed. Vat. inclinatum", "vaticana.inclinatum",
551                 false, false, false);
552
553 % pes lower punctum
554 punctum_char("Ed. Vat. pes lower punctum", "vaticana.lpes",
555              false, false, false, false, true,
556              false, false, true, false, false, false, 1.0);
557
558 % pes lower punctum
559 punctum_char("Ed. Vat. pes var lower punctum", "vaticana.vlpes",
560              false, false, false, false, true,
561              false, false, true, false, false, true, 1.0);
562
563 % pes upper punctum
564 punctum_char("Ed. Vat. pes upper punctum", "vaticana.upes", 
565              false, false, false, false, true,
566              false, false, false, false, false, false, 1.0);
567
568 % pes upper punctum (shifted variation)
569 %
570 % This note head is used instead of the regular pes upper punctum to
571 % avoid collision with the lower punctum note of the pes when the upper
572 % punctum sits directly on top of the lower punctum.
573 %
574 punctum_char("Ed. Vat. var pes upper punctum", "vaticana.vupes",
575              false, false, false, false, true,
576              false, false, false, false, true, false, 1.0);
577
578 % small punctum as used in epiphonus
579 punctum_char("Ed. Vat. plica", "vaticana.plica", 
580              false, false, false, false, false,
581              false, false, false, false, false, false, 0.6);
582
583 % small punctum as used in epiphonus
584 punctum_char("Ed. Vat. var plica", "vaticana.vplica", 
585              false, false, false, false, false,
586              false, true, false, false, false, true, 0.6);
587
588 % excentric punctum as used in epiphonus
589 punctum_char("Ed. Vat. epiphonus", "vaticana.epiphonus", 
590              false, false, false, false, false,
591              false, false, true, true, false, false, 1.0);
592
593 % excentric punctum as used in epiphonus (shifted variation)
594 %
595 % This note head is used instead of the regular epiphonus punctum to
596 % avoid collision with the plica head when the plica sits directly on
597 % top of the lower head.
598 %
599 punctum_char("Ed. Vat. var epiphonus", "vaticana.vepiphonus",
600              false, false, false, false, false,
601              false, false, true, true, false, true, 1.0);
602
603 % small punctum as used in cephalicus
604 punctum_char("Ed. Vat. rev. plica", "vaticana.reverse.plica",
605              false, false, false, false, false,
606              false, false, true, false, false, false, 0.6);
607
608 % small punctum as used in cephalicus
609 punctum_char("Ed. Vat. rev. var plica", "vaticana.reverse.vplica",
610              false, false, false, false, false,
611              false, true, true, false, false, true, 0.6);
612
613 % excentric punctum as used in cephalicus; without left stem
614 punctum_char("Ed. Vat. cephalicus", "vaticana.inner.cephalicus",
615              false, false, false, false, false,
616              false, false, false, true, false, false, 1.0);
617
618 % excentric punctum as used in cephalicus; with left stem
619 punctum_char("Ed. Vat. cephalicus", "vaticana.cephalicus",
620              true, false, false, false, false,
621              false, false, false, true, false, false, 1.0);
622
623 % quilisma
624 fet_beginchar("Ed. Vat. quilisma", "svaticana.quilisma")
625         save b_h,a_w;
626         a_b:=1.54; % b_h*a_b/a_w = wd/ht
627         b_h:=0.85;
628         a_w:=1.09;
629
630         save a, beta, ht, wd;
631         ht# = noteheight#;
632         2beta# = ht#*b_h;
633         a# = beta#*a_b;
634         wd# = 2a# / a_w;
635         set_char_box(0, 0.42wd#, 0.28 ht#, 0.36 ht#);
636         black_notehead_width# := wd#;
637
638         define_pixels(ht, wd);
639         pickup pencircle xscaled linethickness yscaled 0.44ht;
640         lft x1 = 0.00wd; bot y1 = -0.28ht;
641         x2 = 0.11wd;     y2 = -0.14ht;
642         x3 = 0.12wd;     y3 = +0.03ht;
643         x4 = 0.25wd;     y4 = -0.09ht;
644         x5 = 0.26wd;     y5 = +0.08ht;
645         x6 = 0.40wd;     y6 = -0.04ht;
646         rt x7 = 0.42wd;  top y7 = +0.36ht;
647         draw z1 .. z2 -- z3 .. z4 -- z5 .. z6 -- z7;
648 fet_endchar;
649
650 % solesmes punctum inclinatum parvum
651 inclinatum_char("Solesmes punctum inclinatum parvum", "solesmes.incl.parvum",
652                 true, false, false);
653
654 % solesmes punctum auctum ascendens
655 punctum_char("Solesmes punctum auctum ascendens", "solesmes.auct.asc",
656              false, false, false, false, false,
657              true, false, true, false, false, false, 1.0);
658
659 % solesmes punctum auctum descendens
660 punctum_char("Solesmes punctum auctum descendens", "solesmes.auct.desc",
661              false, false, false, false, false,
662              true, false, false, false, false, false, 1.0);
663
664 % solesmes punctum inclinatum auctum
665 inclinatum_char("Solesmes punctum incl. auctum", "solesmes.incl.auctum",
666                 false, false, true);
667
668 % solesmes stropha
669 inclinatum_char("Solesmes stropha", "solesmes.stropha",
670                 false, true, false);
671
672 % solesmes stropha aucta
673 inclinatum_char("Solesmes stropha aucta", "solesmes.stropha.aucta",
674                 false, true, true);
675
676 % solesmes oriscus
677 fet_beginchar("Solesmes oriscus", "ssolesmes.oriscus")
678         save b_h, a_w;
679         a_b := 1.54; % b_h*a_b/a_w = wd/ht
680         b_h := 0.85;
681         a_w := 1.09;
682
683         save a, beta, ht, wd;
684         ht# = noteheight#;
685         2beta# = ht# * b_h;
686         a# = beta# * a_b;
687         wd# = 2a# / a_w;
688         black_notehead_width# := wd#;
689
690         save convexity;
691         convexity# = +0.05ht#;
692
693         define_pixels(ht, wd, convexity);
694         pickup pencircle xscaled blot_diameter yscaled 0.50ht;
695         lft x1 = 0.00wd; y1 = -convexity;
696         x2 = 0.16wd;     y2 = +convexity;
697         x3 = 0.33wd;     y3 = -convexity;
698         rt x4 = 0.50wd;  y4 = +convexity;
699         draw z1 .. z2 .. z3 .. z4;
700         set_char_box(0.00wd#, 0.50wd#,
701                      0.25ht# + convexity#, 0.25ht# + convexity#);
702 fet_endchar;
703
704 %%%%%%%%
705 %
706 %
707 %
708 % EDITIO MEDICAEA
709 %
710 %
711 %
712
713 % inclinatum
714 fet_beginchar("Ed. Med. inclinatum", "smedicaea.inclinatum")
715         draw_diamond_head (1.2staff_space#, 0, 0, 35, false);
716 fet_endchar;
717
718 % parametrized punctum
719 def punctum_char (expr verbose_name, internal_name,
720         left_up_stem, left_down_stem) =
721
722         fet_beginchar(verbose_name, "s"&internal_name)
723
724                 save a, beta, ht, wd;
725                 ht# = 2 staff_space#;
726                 wd# = ht#;
727                 black_notehead_width# := wd#;
728
729                 define_pixels(ht, wd);
730                 pickup pencircle
731                         xscaled blot_diameter
732                         yscaled 0.50ht;
733                 z1 = (0.00wd + blot_diameter/2, 0);
734                 z2 = (0.4wd - blot_diameter/2, 0);
735                 draw z1 .. z2;
736
737                 pickup pencircle
738                         xscaled linethickness
739                         yscaled blot_diameter;
740
741                 if left_down_stem:
742                         z4=(0.00wd + linethickness/2, blot_diameter/2);
743                         z5=(0.00wd + linethickness/2, - 1.25ht);
744                         draw z4 .. z5;
745                         set_char_box(0.0, 0.4wd#, 1.25ht#, 0.25ht#);
746                 elseif left_up_stem:
747                         z4=(0.00wd + linethickness/2, blot_diameter/2);
748                         z5=(0.00wd + linethickness/2, + 1.25ht);
749                         draw z4 .. z5;
750                         set_char_box(0.0, 0.4wd#, 0.25ht#, 1.25ht#);
751                 else:
752                         set_char_box(0.0, 0.4wd#, 0.25ht#, 0.25ht#);
753                 fi;
754
755         fet_endchar;
756 enddef;
757
758 % punctum
759 punctum_char("Ed. Med. punctum", "medicaea.punctum", 
760         false, false);
761
762 % left up-stemmed punctum
763 punctum_char("Ed. Med. reverse virga", "medicaea.rvirga",
764         true, false);
765
766 % virga (i.e. left down-stemmed punctum)
767 punctum_char("Ed. Med. virga", "medicaea.virga", 
768         false, true);
769
770 %%%%%%%%
771 %
772 %
773 %
774 % HUFNAGEL
775 %
776 %
777 %
778
779 % punctum
780 % parametrized punctum
781 def punctum_char (expr verbose_name, internal_name,
782         down_stem) =
783         fet_beginchar(verbose_name, "s" & internal_name)
784                 save alpha;
785                 alpha# = 55;
786                 draw_diamond_head (staff_space#, 0, 0, alpha#, false);
787                 if down_stem:
788                         pickup pencircle
789                                 xscaled blot_diameter
790                                 yscaled (0.7*staff_space)
791                                 rotated -alpha#;
792                         save za, zb; pair za, zb;
793                         za = (head_width/2, 0);
794                         bot zb = (head_width/2, -1.5staff_space);
795                         draw za -- zb;
796                         set_char_box (0, head_width#,
797                                       1.5staff_space#, head_height#/2);
798                 fi;
799         fet_endchar;
800 enddef;
801
802 % punctum
803 punctum_char("Hufnagel punctum", "hufnagel.punctum", false)
804
805 % virga
806 punctum_char("Hufnagel virga", "hufnagel.virga",  true)
807
808 % pes lower punctum
809 fet_beginchar("Hufnagel pes lower punctum", "shufnagel.lpes")
810         save width, height, alpha;
811         width# = 2*staff_space#;
812         height# = 0.7*staff_space#;
813         alpha# = 35;
814
815         set_char_box(0, width#, height#/2, height#/2);
816
817         pickup pencircle scaled linethickness;
818         define_pixels(width, height);
819
820         rt x3 = -lft x1 = width/2;
821         y2 = y3 = height/2;
822         y1 = y4 = -height/2;
823         tand(alpha#) * (y2 - y1) = x2 - x1 = x3 - x4;
824
825         filldraw z1 -- z2 -- z3 -- z4 -- cycle;
826
827         currentpicture := currentpicture shifted (width/2, 0);
828 fet_endchar;
829
830 fet_endgroup ("noteheads")