lilypond-1.5.8
[lilypond.git] / mf / feta-banier.mf
blob2bb37f8d653cc25468b2a2b6c2e4a43c024d7fd7
1 % flags 
5 fet_begingroup("flags")
6 save outer_path;
7 path outer_path;
8 % Flags pointing down overlap with  the notehead (in x-direction), so 
9 % the down-flag can be bigger
10 upflag_width# = .750 black_notehead_width# + stemthickness#/2;
11 downflag_width# = .833 black_notehead_width# + stemthickness#/2;
13 right_upflag_space# = .2 upflag_width#;
14 right_downflag_space# = .2 downflag_width#;
17 % Flags pointing down cannot overlap with the notehead in y-direction,
18 % so they have less slant.
20 % Because of optical illusion, the utmost flag (bottom for
21 % down-pointing, top for up-pointing) should be smaller than the other
22 % flags.  Adobe Sonata doesn't do this correctly.  (Instead they have
23 % an extension flag, which looks less elegant)
26 save hip_thickness, foot_thickness;
27 hip_thickness# = 1.3 stemthickness#;
28 foot_thickness# =  hip_thickness#;
31 % Inspired by Adobe Sonata and [Wanske]
32 % for example, see POSTSCRIPT Language -- program design, 
33 % page 119, and [Wanske], p 41,42
35 def draw_flag(expr center, flare, 
36         dims, hip_depth, foot_wid, hip_thickness, foot_thickness)=
37         clearxy;
39         penpos1(flare, 90);
40         penpos2(whatever, 0);
41         x2r - x2l = hip_thickness;
42         penpos3(foot_thickness, 0) ;
44         z1r  = center;
45         z2r = center + (xpart dims, -ypart(dims) * hip_depth);
46         z3r = center + (xpart(dims) * foot_wid, -ypart dims);
48         outer_path := z3r{curl 0} .. z2r{up} .. {up}z1r;
50         penlabels(1, 2, 3);
51         fill z1l{curl 0}
52                 ..tension 1.1 .. z2l{down} .. 
53                 {curl 0} simple_serif(z3l, z3r, 80) &
54                 outer_path & z1r -- cycle;
55 enddef;
58 % TODO: calc intersectpoint
59 % TODO: calc incision_depth
60
61 def add_flag(expr yoff, flare, hip_wid_multiplier, 
62                 hip_dep_multiplier,
63                 intersectpoint, hip_thickness, foot_thickness) =
64         begingroup
65         save prev_center, prev_xextreme, prev_yextreme;
66         save rel_foot, ip, center, incision_depth;
67         save prev_hipwid, prev_footdep, prev_hipdep, wid, dep, hip_dep;
68         save hip_dep_ratio, foot_wid_ratio;
69         pair prev_center, center, foot, prev_xextreme, prev_yextreme;
70         pair ip, rel_foot;
71         
72         incision_depth = 1.013;
73         prev_center = point 2 of outer_path;
74         prev_xextreme = point 1 of outer_path;
75         prev_yextreme = point 0 of outer_path;
76         prev_hipwid = xpart (prev_xextreme - prev_center);
77         prev_footdep = -ypart (prev_yextreme - prev_center);
78         prev_hipdep = -ypart(prev_xextreme - prev_center);
79         ip = point intersectpoint of outer_path;
81         wid = prev_hipwid * hip_wid_multiplier;
82         hip_dep = prev_hipdep * hip_dep_multiplier;
84         center = prev_center + (0,yoff);
85         rel_foot = incision_depth [(wid, hip_dep), ip - center];
86         dep = -ypart(rel_foot);
87         foot_wid_ratio = xpart(rel_foot ) / wid;
88         hip_dep_ratio = hip_dep / dep;
90         draw_flag(center, flare, 
91                 (wid, dep), hip_dep_ratio, foot_wid_ratio, 
92                 hip_thickness, foot_thickness);
93         endgroup
94 enddef;
96 fet_beginchar("8th Flag (up)", "u3", "eighthflag")
97         save flare, 
98                 hip_depth_ratio, hip_width,
99                 foot_depth, foot_width_ratio;
101         flare# = 1.0 staff_space#;
102         hip_depth_ratio = .72; 
103         foot_width_ratio = .8;
104         hip_width# = upflag_width# - hip_thickness#/2;
106         foot_depth# =  3 staff_space#;
108         set_char_box(stemthickness# /2, hip_width# 
109                 + stemthickness#/2 + right_upflag_space#, 
110                  foot_depth# + foot_thickness#/2, stemthickness#/2)
112         define_pixels(flare, hip_width, hip_thickness,
113                 foot_depth, foot_thickness);
114         draw_flag((stemthickness/2,0), flare, 
115                 (hip_width, foot_depth), 
116                 hip_depth_ratio, foot_width_ratio, hip_thickness, foot_thickness);
118         pickup pencircle scaled stemthickness;
119         draw (0, 0) .. (0,-2 staff_space);
120 fet_endchar;
122 fet_beginchar("16th Flag (up)", "u4", "sixteenthflag")
123         save flare, 
124                 hip_depth_ratio, hip_width,
125                 foot_depth, foot_width_ratio;
126         save flagspace, total_depth, flag_count;
127         total_depth# = 3.5 staff_space#;
128         flag_count = 2;
129         flare# = .85 staff_space#;
130         flagspace# = .85 staff_space#;  
131         hip_depth_ratio = .72 ;
132         hip_width# = upflag_width# - hip_thickness#/2;
133         flagspace# + foot_depth# = total_depth#;
135         foot_width_ratio = .8;
137         set_char_box(stemthickness# /2, hip_width#
138                 + stemthickness#/2 + right_upflag_space#, 
139                 total_depth# + foot_thickness#/2, stemthickness#/2)
141         define_pixels(flare, hip_width, hip_thickness,
142                 flagspace,
143                 foot_depth,  foot_thickness);
144         draw_flag((stemthickness/2,- flagspace), flare, 
145                 (hip_width, foot_depth), 
146                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
148         add_flag(flagspace, flare,
149                 .97, 1.00, 1.25, hip_thickness, foot_thickness);  
151         pickup pencircle scaled stemthickness;
152         draw (0, 0) .. (0,-2 staff_space);
153 fet_endchar;
156 fet_beginchar("32nd Flag (up)", "u5", "thirtysecondflag")
157         save flare, 
158                 hip_depth_ratio, hip_width,
159                 foot_depth, foot_width_ratio;
160         save flagspace, total_depth, flag_count;
161         flag_count = 3;
162         total_depth#=4.25 staff_space#;
163         flare# = .85 staff_space#;
164         flagspace# = .87 staff_space#;  
165         hip_depth_ratio = .72 ;
166         hip_width# = upflag_width# - hip_thickness#/2;
167         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
169         foot_width_ratio = .8;
171         set_char_box(stemthickness# /2, hip_width#
172                 + stemthickness#/2 + right_upflag_space#, 
173                 total_depth# + foot_thickness#/2, stemthickness#/2)
175         define_pixels(flare, hip_width, hip_thickness,
176                 flagspace,
177                 foot_depth,  foot_thickness);
179         draw_flag((stemthickness/2,- 2 flagspace), flare, 
180                 (hip_width, foot_depth), 
181                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
183         add_flag(flagspace, flare,
184                 .97, 1.00, 1.25, hip_thickness, foot_thickness);  
186         add_flag(flagspace, flare,
187                 .95, 1.05, 1.25, hip_thickness, foot_thickness);  
189         pickup pencircle scaled stemthickness;
190         draw (0, 0) .. (0,-2 staff_space);
191 fet_endchar;
193 fet_beginchar("64th Flag (up)", "u6", "sixtyfourthflag")
194         save flare, 
195                 hip_depth_ratio, hip_width,
196                 foot_depth, foot_width_ratio;
197         save flagspace, total_depth, flag_count;
198         
199         flag_count = 4;
200         flare# = .85 staff_space#;
201         flagspace# = .9 staff_space#;   
202         hip_depth_ratio = .72 ;
203         hip_width# = upflag_width# - hip_thickness#/2;
204         total_depth# = 5.25 staff_space#;
205         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
207         foot_width_ratio = .8;
209         set_char_box(stemthickness# /2, hip_width#
210                 + stemthickness#/2 + right_upflag_space#, 
211                 total_depth# + foot_thickness#/2, stemthickness#/2)
213         define_pixels(flare, hip_width, hip_thickness,
214                 flagspace,
215                 foot_depth,  foot_thickness);
217         draw_flag((stemthickness/2,- (flag_count-1)* flagspace), flare, 
218                 (hip_width, foot_depth), 
219                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
221         add_flag(flagspace, flare,
222                 .97, 1.00, 1.3, hip_thickness, foot_thickness);  
224         add_flag(flagspace, flare,
225                 1.00, 1.00, 1.25, hip_thickness, foot_thickness);  
226         add_flag(flagspace, flare,
227                 .95, 1.05, 1.25, hip_thickness, foot_thickness);  
228         pickup pencircle scaled stemthickness;
229         draw (0, 0) .. (0,-2 staff_space);
230 fet_endchar;
232 fet_beginchar("8th (down)", "d3", "deighthflag")
233         save flare, 
234                 hip_depth_ratio, hip_width,
235                 foot_depth, foot_width_ratio;
236         save flagspace, total_depth, flag_count;
237         
238         flag_count = 1;
239         flare# = .99 staff_space#;
240         flagspace# = .9 staff_space#;   
241         hip_depth_ratio = .72 ;
242         hip_width# = downflag_width# - hip_thickness#/2;
243         total_depth# = 2.85 staff_space#;
244         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
246         foot_width_ratio = .8;
248         set_char_box(stemthickness# /2, hip_width#
249                 + stemthickness#/2 + right_downflag_space#,
250                 total_depth# + foot_thickness#/2, stemthickness#/2)
252         define_pixels(flare, hip_width, hip_thickness,
253                 flagspace,
254                 foot_depth,  foot_thickness);
256         draw_flag((stemthickness/2,- (flag_count-1) *flagspace), flare, 
257                 (hip_width, foot_depth), 
258                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
260 %%%%%%%%
264 % Mensural Notation
269 def draw_mensural_outermost_flag_i =
270         define_pixels(stafflinethickness, staff_space)
272         pickup pencircle
273                 xscaled 1.00 stafflinethickness
274                 yscaled 0.22 staff_space
275                 rotated -35;
277         save za, zb, zc, zd, ze;
278         pair za, zb, zc, zd, ze;
280         za = (+0.00 staff_space, -0.00 staff_space);
281         zb = (+0.15 staff_space, -0.00 staff_space);
282         zc = (+0.45 staff_space, -0.35 staff_space);
283         zd = (+0.45 staff_space, -0.85 staff_space);
284         ze = (+0.00 staff_space, -2.00 staff_space);
286         draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
287 enddef;
289 def draw_mensural_outermost_flag_ii =
290         define_pixels(stafflinethickness, staff_space)
292         pickup pencircle
293                 xscaled 1.00 stafflinethickness
294                 yscaled 0.22 staff_space
295                 rotated -35;
297         save za, zb, zc, zd, ze;
298         pair za, zb, zc, zd, ze;
300         za = (+0.00 staff_space, -0.00 staff_space);
301         zb = (+0.15 staff_space, -0.00 staff_space);
302         zc = (+0.20 staff_space, -0.05 staff_space);
303         zd = (+0.20 staff_space, -1.15 staff_space);
304         ze = (+0.00 staff_space, -1.40 staff_space);
306         draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
307 enddef;
309 def draw_mensural_inner_flag(expr il_shift) =
310         define_pixels(stafflinethickness, staff_space)
312         pickup pencircle
313                 xscaled 1.00 stafflinethickness
314                 yscaled 0.22 staff_space
315                 rotated -35;
317         save zs, za, zb, zc, zd;
318         pair zs, za, zb, zc, zd;
320         zs = (0, -il_shift * staff_space);
321         za = zs + (+0.00 staff_space, -0.10 staff_space);
322         zb = zs + (+0.33 staff_space, -0.30 staff_space);
323         zc = zs + (+0.33 staff_space, -0.70 staff_space);
324         zd = zs + (+0.00 staff_space, -0.90 staff_space);
326         draw za{2,1} .. zb .. zc .. {-2,-1}zd;
327 enddef;
329 fet_beginchar("8th Mensural Flag (up)", "mensuralu03", "menseighthflag")
330         set_char_box(0, 0.60 staff_space#, 2.00 staff_space#, 0)
331         draw_mensural_outermost_flag_i
332 fet_endchar;
334 fet_beginchar("8th Mensural Flag (up)", "mensuralu13", "mens1eighthflag")
335         set_char_box(0, 0.60 staff_space#, 1.50 staff_space#, 0)
336         draw_mensural_outermost_flag_ii
337 fet_endchar;
339 fet_beginchar("8th Mensural Flag (down)", "mensurald03", "mensdeighthflag")
340         set_char_box(0.60 staff_space#, 0, 0, 2.00 staff_space#)
341         draw_mensural_outermost_flag_i
342         currentpicture := currentpicture xscaled -1 yscaled -1;
343 fet_endchar;
345 fet_beginchar("8th Mensural Flag (down)", "mensurald13", "mensd1eighthflag")
346         set_char_box(0.60 staff_space#, 0, 0, 1.50 staff_space#)
347         draw_mensural_outermost_flag_ii
348         currentpicture := currentpicture xscaled -1 yscaled -1;
349 fet_endchar;
351 fet_beginchar("16th Mensural Flag (up)", "mensuralu04", "menssixteenthflag")
352         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
353         draw_mensural_outermost_flag_i
354         draw_mensural_inner_flag(2.0)
355 fet_endchar;
357 fet_beginchar("16th Mensural Flag (up)", "mensuralu14", "mens1sixteenthflag")
358         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
359         draw_mensural_outermost_flag_ii
360         draw_mensural_inner_flag(1.5)
361 fet_endchar;
363 fet_beginchar("16th Mensural Flag (down)", "mensurald04", "mensdsixteenthflag")
364         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
365         draw_mensural_outermost_flag_i
366         draw_mensural_inner_flag(2.0)
367         currentpicture := currentpicture xscaled -1 yscaled -1;
368 fet_endchar;
370 fet_beginchar("16th Mensural Flag (down)", "mensurald14", "mensd1sixteenthflag")
371         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
372         draw_mensural_outermost_flag_ii
373         draw_mensural_inner_flag(1.5)
374         currentpicture := currentpicture xscaled -1 yscaled -1;
375 fet_endchar;
377 fet_beginchar("32th Mensural Flag (up)", "mensuralu05", "mensthirtysecondflag")
378         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
379         draw_mensural_outermost_flag_i
380         draw_mensural_inner_flag(2.0)
381         draw_mensural_inner_flag(3.0)
382 fet_endchar;
384 fet_beginchar("32th Mensural Flag (up)", "mensuralu15", "mens1thirtysecondflag")
385         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
386         draw_mensural_outermost_flag_ii
387         draw_mensural_inner_flag(1.5)
388         draw_mensural_inner_flag(2.5)
389 fet_endchar;
391 fet_beginchar("32th Mensural Flag (down)", "mensurald05", "mensdthirtysecondflag")
392         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
393         draw_mensural_outermost_flag_i
394         draw_mensural_inner_flag(2.0)
395         draw_mensural_inner_flag(3.0)
396         currentpicture := currentpicture xscaled -1 yscaled -1;
397 fet_endchar;
399 fet_beginchar("32th Mensural Flag (down)", "mensurald15", "mensd1thirtysecondflag")
400         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
401         draw_mensural_outermost_flag_ii
402         draw_mensural_inner_flag(1.5)
403         draw_mensural_inner_flag(2.5)
404         currentpicture := currentpicture xscaled -1 yscaled -1;
405 fet_endchar;
407 fet_beginchar("64th Mensural Flag (up)", "mensuralu06", "menssixtyfourthflag")
408         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
409         draw_mensural_outermost_flag_i
410         draw_mensural_inner_flag(1.5)
411         draw_mensural_inner_flag(2.5)
412         draw_mensural_inner_flag(3.5)
413 fet_endchar;
415 fet_beginchar("64th Mensural Flag (up)", "mensuralu16", "mens1sixtyfourthflag")
416         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
417         draw_mensural_outermost_flag_ii
418         draw_mensural_inner_flag(1.17)
419         draw_mensural_inner_flag(2.08)
420         draw_mensural_inner_flag(3.00)
421 fet_endchar;
423 fet_beginchar("64th Mensural Flag (down)", "mensurald06", "mensdsixtyfourthflag")
424         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
425         draw_mensural_outermost_flag_i
426         draw_mensural_inner_flag(1.5)
427         draw_mensural_inner_flag(2.5)
428         draw_mensural_inner_flag(3.5)
429         currentpicture := currentpicture xscaled -1 yscaled -1;
430 fet_endchar;
432 fet_beginchar("64th Mensural Flag (down)", "mensurald16", "mensd1sixtyfourthflag")
433         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
434         draw_mensural_outermost_flag_ii
435         draw_mensural_inner_flag(1.17)
436         draw_mensural_inner_flag(2.08)
437         draw_mensural_inner_flag(3.00)
438         currentpicture := currentpicture xscaled -1 yscaled -1;
439 fet_endchar;
441 %%%%%%%%
445 % Single Stroke for Short Appogiatura
450 fet_beginchar("grace dash (up)", "ugrace", "gracedash")
451         save flare, 
452                 hip_depth_ratio, hip_width,
453                 foot_depth;
455         flare# = 1.0 staff_space#;
456         hip_depth_ratio = .72; 
457         hip_width# = upflag_width# - hip_thickness#/2;
459         foot_depth# =  3 staff_space#;
461         define_pixels(flare, hip_width, hip_thickness,
462                 foot_depth, foot_thickness);
464         set_char_box(hip_width# * hip_depth_ratio,
465           hip_width# + stemthickness#/2 + right_upflag_space#, 
466           foot_depth# * hip_depth_ratio, -flare#)
468         pickup pencircle scaled 1.5 stemthickness;
469         draw (-b ,-d) ..
470           (w, h);
471 fet_endchar;
473         pickup pencircle scaled stemthickness;
474         draw (0, 0) .. (0,-2 staff_space);
475         y_mirror_char;
476 fet_endchar;
478 fet_beginchar("16th (down)", "d4", "dsixteenthflag")
479         save flare, 
480                 hip_depth_ratio, hip_width,
481                 foot_depth, foot_width_ratio;
482         save flagspace, total_depth, flag_count;
483         
484         flag_count = 2;
485         flare# = .8 staff_space#;
486         flagspace# = .9 staff_space#;   
487         hip_depth_ratio = .85 ;
488         hip_width# = downflag_width# - hip_thickness#/2;
489         total_depth# = 3.0 staff_space#;
490         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
492         foot_width_ratio = .95;
494         set_char_box(stemthickness# /2, hip_width#
495                 + stemthickness#/2 + right_downflag_space#, 
496                 total_depth# + foot_thickness#/2, stemthickness#/2)
498         define_pixels(flare, hip_width, hip_thickness,
499                 flagspace,
500                 foot_depth,  foot_thickness);
502         draw_flag((stemthickness/2,- (flag_count-1) *flagspace), flare, 
503                 (hip_width, foot_depth), 
504                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
505         add_flag(flagspace, flare,
506                 .95, 1.00, 1.25, hip_thickness, foot_thickness);  
508         
510         pickup pencircle scaled stemthickness;
511         draw (0, 0) .. (0,-2 staff_space);
512         y_mirror_char;
513 fet_endchar;
515 fet_beginchar("32nd (down)", "d5", "dthirtysecondflag")
516         save flare, 
517                 hip_depth_ratio, hip_width,
518                 foot_depth, foot_width_ratio;
519         save flagspace, total_depth, flag_count;
520         
521         flag_count = 3;
522         flare# = .84 staff_space#;
523         flagspace# = .9 staff_space#;   
524         hip_depth_ratio = .85 ;
525         hip_width# = downflag_width# - hip_thickness#/2;
526         total_depth# = 3.85 staff_space#;
527         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
529         foot_width_ratio = .95;
531         set_char_box(stemthickness# /2, hip_width#
532                 + stemthickness#/2 + right_downflag_space#, 
533                 total_depth# + foot_thickness#/2, stemthickness#/2)
535         define_pixels(flare, hip_width, hip_thickness,
536                 flagspace,
537                 foot_depth,  foot_thickness);
539         draw_flag((stemthickness/2,- (flag_count-1) *flagspace), flare, 
540                 (hip_width, foot_depth), 
541                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
542         add_flag(flagspace, flare,
543                 .97, 1.00, 1.25, hip_thickness, foot_thickness);  
545         add_flag(flagspace, flare,
546                 .95, 1.05, 1.25, hip_thickness, foot_thickness);  
548         
550         pickup pencircle scaled stemthickness;
551         draw (0, 0) .. (0,-2 staff_space);
552         y_mirror_char;
553 fet_endchar;
554 fet_beginchar("64th (down)", "d6", "dsixtyfourthflag")
555         save flare, 
556                 hip_depth_ratio, hip_width,
557                 foot_depth, foot_width_ratio;
558         save flagspace, total_depth, flag_count;
559         
560         flag_count = 4;
561         flare# = .8 staff_space#;
562         flagspace# = .9 staff_space#;   
563         hip_depth_ratio = .85 ;
564         hip_width# = downflag_width# - hip_thickness#/2;
565         total_depth# = 4.35 staff_space#;
566         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
568         foot_width_ratio = .98;
570         set_char_box(stemthickness# /2, hip_width#
571                 + stemthickness#/2 + right_downflag_space#, 
572                 total_depth# + foot_thickness#/2, stemthickness#/2)
574         define_pixels(flare, hip_width, hip_thickness,
575                 flagspace,
576                 foot_depth,  foot_thickness);
578         draw_flag((stemthickness/2,- (flag_count-1) *flagspace), flare, 
579                 (hip_width, foot_depth), 
580                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
581         add_flag(flagspace, flare,
582                 .97, 1.20, 1.175, hip_thickness, foot_thickness);  
583         add_flag(flagspace, flare,
584                 .97, 1.10, 1.175, hip_thickness, foot_thickness);  
586         add_flag(.98 flagspace, flare,
587                 .91, 1.05, 1.2, hip_thickness, foot_thickness);  
589         
591         pickup pencircle scaled stemthickness;
592         draw (0, 0) .. (0,-2 staff_space);
593         y_mirror_char;
594 fet_endchar;
596 %%%%%%%%
600 % Mensural Notation
605 def draw_mensural_outermost_flag_i =
606         define_pixels(stafflinethickness, staff_space)
608         pickup pencircle
609                 xscaled 1.00 stafflinethickness
610                 yscaled 0.22 staff_space
611                 rotated -35;
613         save za, zb, zc, zd, ze;
614         pair za, zb, zc, zd, ze;
616         za = (+0.00 staff_space, -0.00 staff_space);
617         zb = (+0.15 staff_space, -0.00 staff_space);
618         zc = (+0.45 staff_space, -0.35 staff_space);
619         zd = (+0.45 staff_space, -0.85 staff_space);
620         ze = (+0.00 staff_space, -2.00 staff_space);
622         draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
623 enddef;
625 def draw_mensural_outermost_flag_ii =
626         define_pixels(stafflinethickness, staff_space)
628         pickup pencircle
629                 xscaled 1.00 stafflinethickness
630                 yscaled 0.22 staff_space
631                 rotated -35;
633         save za, zb, zc, zd, ze;
634         pair za, zb, zc, zd, ze;
636         za = (+0.00 staff_space, -0.00 staff_space);
637         zb = (+0.15 staff_space, -0.00 staff_space);
638         zc = (+0.20 staff_space, -0.05 staff_space);
639         zd = (+0.20 staff_space, -1.15 staff_space);
640         ze = (+0.00 staff_space, -1.40 staff_space);
642         draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
643 enddef;
645 def draw_mensural_inner_flag(expr il_shift) =
646         define_pixels(stafflinethickness, staff_space)
648         pickup pencircle
649                 xscaled 1.00 stafflinethickness
650                 yscaled 0.22 staff_space
651                 rotated -35;
653         save zs, za, zb, zc, zd;
654         pair zs, za, zb, zc, zd;
656         zs = (0, -il_shift * staff_space);
657         za = zs + (+0.00 staff_space, -0.10 staff_space);
658         zb = zs + (+0.33 staff_space, -0.30 staff_space);
659         zc = zs + (+0.33 staff_space, -0.70 staff_space);
660         zd = zs + (+0.00 staff_space, -0.90 staff_space);
662         draw za{2,1} .. zb .. zc .. {-2,-1}zd;
663 enddef;
665 fet_beginchar("8th Mensural Flag (up)", "mensuralu03", "menseighthflag")
666         set_char_box(0, 0.60 staff_space#, 2.00 staff_space#, 0)
667         draw_mensural_outermost_flag_i
668 fet_endchar;
670 fet_beginchar("8th Mensural Flag (up)", "mensuralu13", "mens1eighthflag")
671         set_char_box(0, 0.60 staff_space#, 1.50 staff_space#, 0)
672         draw_mensural_outermost_flag_ii
673 fet_endchar;
675 fet_beginchar("8th Mensural Flag (down)", "mensurald03", "mensdeighthflag")
676         set_char_box(0.60 staff_space#, 0, 0, 2.00 staff_space#)
677         draw_mensural_outermost_flag_i
678         currentpicture := currentpicture xscaled -1 yscaled -1;
679 fet_endchar;
681 fet_beginchar("8th Mensural Flag (down)", "mensurald13", "mensd1eighthflag")
682         set_char_box(0.60 staff_space#, 0, 0, 1.50 staff_space#)
683         draw_mensural_outermost_flag_ii
684         currentpicture := currentpicture xscaled -1 yscaled -1;
685 fet_endchar;
687 fet_beginchar("16th Mensural Flag (up)", "mensuralu04", "menssixteenthflag")
688         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
689         draw_mensural_outermost_flag_i
690         draw_mensural_inner_flag(2.0)
691 fet_endchar;
693 fet_beginchar("16th Mensural Flag (up)", "mensuralu14", "mens1sixteenthflag")
694         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
695         draw_mensural_outermost_flag_ii
696         draw_mensural_inner_flag(1.5)
697 fet_endchar;
699 fet_beginchar("16th Mensural Flag (down)", "mensurald04", "mensdsixteenthflag")
700         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
701         draw_mensural_outermost_flag_i
702         draw_mensural_inner_flag(2.0)
703         currentpicture := currentpicture xscaled -1 yscaled -1;
704 fet_endchar;
706 fet_beginchar("16th Mensural Flag (down)", "mensurald14", "mensd1sixteenthflag")
707         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
708         draw_mensural_outermost_flag_ii
709         draw_mensural_inner_flag(1.5)
710         currentpicture := currentpicture xscaled -1 yscaled -1;
711 fet_endchar;
713 fet_beginchar("32th Mensural Flag (up)", "mensuralu05", "mensthirtysecondflag")
714         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
715         draw_mensural_outermost_flag_i
716         draw_mensural_inner_flag(2.0)
717         draw_mensural_inner_flag(3.0)
718 fet_endchar;
720 fet_beginchar("32th Mensural Flag (up)", "mensuralu15", "mens1thirtysecondflag")
721         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
722         draw_mensural_outermost_flag_ii
723         draw_mensural_inner_flag(1.5)
724         draw_mensural_inner_flag(2.5)
725 fet_endchar;
727 fet_beginchar("32th Mensural Flag (down)", "mensurald05", "mensdthirtysecondflag")
728         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
729         draw_mensural_outermost_flag_i
730         draw_mensural_inner_flag(2.0)
731         draw_mensural_inner_flag(3.0)
732         currentpicture := currentpicture xscaled -1 yscaled -1;
733 fet_endchar;
735 fet_beginchar("32th Mensural Flag (down)", "mensurald15", "mensd1thirtysecondflag")
736         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
737         draw_mensural_outermost_flag_ii
738         draw_mensural_inner_flag(1.5)
739         draw_mensural_inner_flag(2.5)
740         currentpicture := currentpicture xscaled -1 yscaled -1;
741 fet_endchar;
743 fet_beginchar("64th Mensural Flag (up)", "mensuralu06", "menssixtyfourthflag")
744         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
745         draw_mensural_outermost_flag_i
746         draw_mensural_inner_flag(1.5)
747         draw_mensural_inner_flag(2.5)
748         draw_mensural_inner_flag(3.5)
749 fet_endchar;
751 fet_beginchar("64th Mensural Flag (up)", "mensuralu16", "mens1sixtyfourthflag")
752         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
753         draw_mensural_outermost_flag_ii
754         draw_mensural_inner_flag(1.17)
755         draw_mensural_inner_flag(2.08)
756         draw_mensural_inner_flag(3.00)
757 fet_endchar;
759 fet_beginchar("64th Mensural Flag (down)", "mensurald06", "mensdsixtyfourthflag")
760         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
761         draw_mensural_outermost_flag_i
762         draw_mensural_inner_flag(1.5)
763         draw_mensural_inner_flag(2.5)
764         draw_mensural_inner_flag(3.5)
765         currentpicture := currentpicture xscaled -1 yscaled -1;
766 fet_endchar;
768 fet_beginchar("64th Mensural Flag (down)", "mensurald16", "mensd1sixtyfourthflag")
769         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
770         draw_mensural_outermost_flag_ii
771         draw_mensural_inner_flag(1.17)
772         draw_mensural_inner_flag(2.08)
773         draw_mensural_inner_flag(3.00)
774         currentpicture := currentpicture xscaled -1 yscaled -1;
775 fet_endchar;
777 %%%%%%%%
781 % Single Stroke for Short Appogiatura
786 fet_beginchar("grace dash (up)", "ugrace", "gracedash")
787         save flare, 
788                 hip_depth_ratio, hip_width,
789                 foot_depth;
791         flare# = 1.0 staff_space#;
792         hip_depth_ratio = .72; 
793         hip_width# = upflag_width# - hip_thickness#/2;
795         foot_depth# =  3 staff_space#;
797         define_pixels(flare, hip_width, hip_thickness,
798                 foot_depth, foot_thickness);
800         set_char_box(hip_width# * hip_depth_ratio,
801           hip_width# + stemthickness#/2 + right_upflag_space#, 
802           foot_depth# * hip_depth_ratio, -flare#)
804         pickup pencircle scaled 1.5 stemthickness;
805         draw (-b ,-d) ..
806           (w, h);
807 fet_endchar;
809 fet_beginchar("grace dash (down)", "dgrace", "dgracedash")
810         save flare, hip_depth_ratio, hip_width, foot_depth;
811         save flagspace, total_depth, flag_count;
812         
813         flag_count = 1;
814         flare# = .99 staff_space#;
815         flagspace# = .9 staff_space#;   
816         hip_depth_ratio = .72 ;
817         hip_width# = downflag_width# - hip_thickness#/2;
818         total_depth# = 2.85 staff_space#;
819         (flag_count-1) * flagspace# + foot_depth# = total_depth#;
821         foot_width_ratio = .8;
823         define_pixels(flare, hip_width, hip_thickness,
824                 flagspace, foot_depth);
826         set_char_box(hip_width# * hip_depth_ratio,
827           hip_width# + stemthickness#/2 + right_downflag_space#,
828           foot_depth# * hip_depth_ratio, -flare#)
830         pickup pencircle scaled 1.5 stemthickness;
831         draw (-b, -d) .. (w,h);
832         y_mirror_char;
833 fet_endchar;
835 % ustem?
838 % Stem characters so we can compose metronome markings with Feta
839 % entirely.
842 fet_beginchar("stem (up)", "stem", "stem")
843         set_char_box(stemthickness#/2, stemthickness#/2, 0, 3.5staff_space#);
844         pickup pencircle scaled stemthickness;
845         draw (0, 0.2staff_space) .. (0, 3.5staff_space);
846 fet_endchar;
848 % do we want this?
849 fet_beginchar("stem (down)", "dstem", "dstem")
850         set_char_box(stemthickness#/2, stemthickness#/2, 3.5staff_space#, 0);
851         pickup pencircle scaled stemthickness;
852         draw (0, -0.2staff_space) .. (0, -3.5staff_space);
853 fet_endchar;
856 fet_endgroup("flags");