]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-banier.mf
release: 1.5.9
[lilypond.git] / mf / feta-banier.mf
1 % flags 
2 %
3
4
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;
12
13 right_upflag_space# = .2 upflag_width#;
14 right_downflag_space# = .2 downflag_width#;
15
16 %
17 % Flags pointing down cannot overlap with the notehead in y-direction,
18 % so they have less slant.
19
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)
24 %
25
26 save hip_thickness, foot_thickness;
27 hip_thickness# = 1.3 stemthickness#;
28 foot_thickness# =  hip_thickness#;
29
30 %
31 % Inspired by Adobe Sonata and [Wanske]
32 % for example, see POSTSCRIPT Language -- program design, 
33 % page 119, and [Wanske], p 41,42
34 %
35 def draw_flag(expr center, flare, 
36         dims, hip_depth, foot_wid, hip_thickness, foot_thickness)=
37         clearxy;
38
39         penpos1(flare, 90);
40         penpos2(whatever, 0);
41         x2r - x2l = hip_thickness;
42         penpos3(foot_thickness, 0) ;
43
44         z1r  = center;
45         z2r = center + (xpart dims, -ypart(dims) * hip_depth);
46         z3r = center + (xpart(dims) * foot_wid, -ypart dims);
47
48         outer_path := z3r{curl 0} .. z2r{up} .. {up}z1r;
49
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;
56
57 %
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;
80
81         wid = prev_hipwid * hip_wid_multiplier;
82         hip_dep = prev_hipdep * hip_dep_multiplier;
83
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;
89
90         draw_flag(center, flare, 
91                 (wid, dep), hip_dep_ratio, foot_wid_ratio, 
92                 hip_thickness, foot_thickness);
93         endgroup
94 enddef;
95
96 fet_beginchar("8th Flag (up)", "u3", "eighthflag")
97         save flare, 
98                 hip_depth_ratio, hip_width,
99                 foot_depth, foot_width_ratio;
100
101         flare# = 1.0 staff_space#;
102         hip_depth_ratio = .72; 
103         foot_width_ratio = .8;
104         hip_width# = upflag_width# - hip_thickness#/2;
105
106         foot_depth# =  3 staff_space#;
107
108         set_char_box(stemthickness# /2, hip_width# 
109                 + stemthickness#/2 + right_upflag_space#, 
110                  foot_depth# + foot_thickness#/2, stemthickness#/2)
111
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);
117
118         pickup pencircle scaled stemthickness;
119         draw (0, 0) .. (0,-2 staff_space);
120 fet_endchar;
121
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#;
134
135         foot_width_ratio = .8;
136
137         set_char_box(stemthickness# /2, hip_width#
138                 + stemthickness#/2 + right_upflag_space#, 
139                 total_depth# + foot_thickness#/2, stemthickness#/2)
140
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);
147
148         add_flag(flagspace, flare,
149                 .97, 1.00, 1.25, hip_thickness, foot_thickness);  
150
151         pickup pencircle scaled stemthickness;
152         draw (0, 0) .. (0,-2 staff_space);
153 fet_endchar;
154
155
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#;
168
169         foot_width_ratio = .8;
170
171         set_char_box(stemthickness# /2, hip_width#
172                 + stemthickness#/2 + right_upflag_space#, 
173                 total_depth# + foot_thickness#/2, stemthickness#/2)
174
175         define_pixels(flare, hip_width, hip_thickness,
176                 flagspace,
177                 foot_depth,  foot_thickness);
178
179         draw_flag((stemthickness/2,- 2 flagspace), flare, 
180                 (hip_width, foot_depth), 
181                 hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness);
182
183         add_flag(flagspace, flare,
184                 .97, 1.00, 1.25, hip_thickness, foot_thickness);  
185
186         add_flag(flagspace, flare,
187                 .95, 1.05, 1.25, hip_thickness, foot_thickness);  
188
189         pickup pencircle scaled stemthickness;
190         draw (0, 0) .. (0,-2 staff_space);
191 fet_endchar;
192
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#;
206
207         foot_width_ratio = .8;
208
209         set_char_box(stemthickness# /2, hip_width#
210                 + stemthickness#/2 + right_upflag_space#, 
211                 total_depth# + foot_thickness#/2, stemthickness#/2)
212
213         define_pixels(flare, hip_width, hip_thickness,
214                 flagspace,
215                 foot_depth,  foot_thickness);
216
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);
220
221         add_flag(flagspace, flare,
222                 .97, 1.00, 1.3, hip_thickness, foot_thickness);  
223
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;
231
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#;
245
246         foot_width_ratio = .8;
247
248         set_char_box(stemthickness# /2, hip_width#
249                 + stemthickness#/2 + right_downflag_space#,
250                 total_depth# + foot_thickness#/2, stemthickness#/2)
251
252         define_pixels(flare, hip_width, hip_thickness,
253                 flagspace,
254                 foot_depth,  foot_thickness);
255
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);
259
260         pickup pencircle scaled stemthickness;
261         draw (0, 0) .. (0,-2 staff_space);
262         y_mirror_char;
263 fet_endchar;
264
265 %%%%%%%%
266 %
267 %
268 %
269 % Mensural Notation
270 %
271 %
272 %
273
274 def draw_mensural_outermost_flag_i =
275         define_pixels(stafflinethickness, staff_space)
276
277         pickup pencircle
278                 xscaled 1.00 stafflinethickness
279                 yscaled 0.22 staff_space
280                 rotated -35;
281
282         save za, zb, zc, zd, ze;
283         pair za, zb, zc, zd, ze;
284
285         za = (+0.00 staff_space, -0.00 staff_space);
286         zb = (+0.15 staff_space, -0.00 staff_space);
287         zc = (+0.45 staff_space, -0.35 staff_space);
288         zd = (+0.45 staff_space, -0.85 staff_space);
289         ze = (+0.00 staff_space, -2.00 staff_space);
290
291         draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
292 enddef;
293
294 def draw_mensural_outermost_flag_ii =
295         define_pixels(stafflinethickness, staff_space)
296
297         pickup pencircle
298                 xscaled 1.00 stafflinethickness
299                 yscaled 0.22 staff_space
300                 rotated -35;
301
302         save za, zb, zc, zd, ze;
303         pair za, zb, zc, zd, ze;
304
305         za = (+0.00 staff_space, -0.00 staff_space);
306         zb = (+0.15 staff_space, -0.00 staff_space);
307         zc = (+0.20 staff_space, -0.05 staff_space);
308         zd = (+0.20 staff_space, -1.15 staff_space);
309         ze = (+0.00 staff_space, -1.40 staff_space);
310
311         draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
312 enddef;
313
314 def draw_mensural_inner_flag(expr il_shift) =
315         define_pixels(stafflinethickness, staff_space)
316
317         pickup pencircle
318                 xscaled 1.00 stafflinethickness
319                 yscaled 0.22 staff_space
320                 rotated -35;
321
322         save zs, za, zb, zc, zd;
323         pair zs, za, zb, zc, zd;
324
325         zs = (0, -il_shift * staff_space);
326         za = zs + (+0.00 staff_space, -0.10 staff_space);
327         zb = zs + (+0.33 staff_space, -0.30 staff_space);
328         zc = zs + (+0.33 staff_space, -0.70 staff_space);
329         zd = zs + (+0.00 staff_space, -0.90 staff_space);
330
331         draw za{2,1} .. zb .. zc .. {-2,-1}zd;
332 enddef;
333
334 fet_beginchar("8th Mensural Flag (up)", "mensuralu03", "menseighthflag")
335         set_char_box(0, 0.60 staff_space#, 2.00 staff_space#, 0)
336         draw_mensural_outermost_flag_i
337 fet_endchar;
338
339 fet_beginchar("8th Mensural Flag (up)", "mensuralu13", "mens1eighthflag")
340         set_char_box(0, 0.60 staff_space#, 1.50 staff_space#, 0)
341         draw_mensural_outermost_flag_ii
342 fet_endchar;
343
344 fet_beginchar("8th Mensural Flag (down)", "mensurald03", "mensdeighthflag")
345         set_char_box(0.60 staff_space#, 0, 0, 2.00 staff_space#)
346         draw_mensural_outermost_flag_i
347         currentpicture := currentpicture xscaled -1 yscaled -1;
348 fet_endchar;
349
350 fet_beginchar("8th Mensural Flag (down)", "mensurald13", "mensd1eighthflag")
351         set_char_box(0.60 staff_space#, 0, 0, 1.50 staff_space#)
352         draw_mensural_outermost_flag_ii
353         currentpicture := currentpicture xscaled -1 yscaled -1;
354 fet_endchar;
355
356 fet_beginchar("16th Mensural Flag (up)", "mensuralu04", "menssixteenthflag")
357         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
358         draw_mensural_outermost_flag_i
359         draw_mensural_inner_flag(2.0)
360 fet_endchar;
361
362 fet_beginchar("16th Mensural Flag (up)", "mensuralu14", "mens1sixteenthflag")
363         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
364         draw_mensural_outermost_flag_ii
365         draw_mensural_inner_flag(1.5)
366 fet_endchar;
367
368 fet_beginchar("16th Mensural Flag (down)", "mensurald04", "mensdsixteenthflag")
369         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
370         draw_mensural_outermost_flag_i
371         draw_mensural_inner_flag(2.0)
372         currentpicture := currentpicture xscaled -1 yscaled -1;
373 fet_endchar;
374
375 fet_beginchar("16th Mensural Flag (down)", "mensurald14", "mensd1sixteenthflag")
376         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
377         draw_mensural_outermost_flag_ii
378         draw_mensural_inner_flag(1.5)
379         currentpicture := currentpicture xscaled -1 yscaled -1;
380 fet_endchar;
381
382 fet_beginchar("32th Mensural Flag (up)", "mensuralu05", "mensthirtysecondflag")
383         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
384         draw_mensural_outermost_flag_i
385         draw_mensural_inner_flag(2.0)
386         draw_mensural_inner_flag(3.0)
387 fet_endchar;
388
389 fet_beginchar("32th Mensural Flag (up)", "mensuralu15", "mens1thirtysecondflag")
390         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
391         draw_mensural_outermost_flag_ii
392         draw_mensural_inner_flag(1.5)
393         draw_mensural_inner_flag(2.5)
394 fet_endchar;
395
396 fet_beginchar("32th Mensural Flag (down)", "mensurald05", "mensdthirtysecondflag")
397         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
398         draw_mensural_outermost_flag_i
399         draw_mensural_inner_flag(2.0)
400         draw_mensural_inner_flag(3.0)
401         currentpicture := currentpicture xscaled -1 yscaled -1;
402 fet_endchar;
403
404 fet_beginchar("32th Mensural Flag (down)", "mensurald15", "mensd1thirtysecondflag")
405         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
406         draw_mensural_outermost_flag_ii
407         draw_mensural_inner_flag(1.5)
408         draw_mensural_inner_flag(2.5)
409         currentpicture := currentpicture xscaled -1 yscaled -1;
410 fet_endchar;
411
412 fet_beginchar("64th Mensural Flag (up)", "mensuralu06", "menssixtyfourthflag")
413         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
414         draw_mensural_outermost_flag_i
415         draw_mensural_inner_flag(1.5)
416         draw_mensural_inner_flag(2.5)
417         draw_mensural_inner_flag(3.5)
418 fet_endchar;
419
420 fet_beginchar("64th Mensural Flag (up)", "mensuralu16", "mens1sixtyfourthflag")
421         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
422         draw_mensural_outermost_flag_ii
423         draw_mensural_inner_flag(1.17)
424         draw_mensural_inner_flag(2.08)
425         draw_mensural_inner_flag(3.00)
426 fet_endchar;
427
428 fet_beginchar("64th Mensural Flag (down)", "mensurald06", "mensdsixtyfourthflag")
429         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
430         draw_mensural_outermost_flag_i
431         draw_mensural_inner_flag(1.5)
432         draw_mensural_inner_flag(2.5)
433         draw_mensural_inner_flag(3.5)
434         currentpicture := currentpicture xscaled -1 yscaled -1;
435 fet_endchar;
436
437 fet_beginchar("64th Mensural Flag (down)", "mensurald16", "mensd1sixtyfourthflag")
438         set_char_box(0, 0.60 staff_space#, 3.00 staff_space#, 0)
439         draw_mensural_outermost_flag_ii
440         draw_mensural_inner_flag(1.17)
441         draw_mensural_inner_flag(2.08)
442         draw_mensural_inner_flag(3.00)
443         currentpicture := currentpicture xscaled -1 yscaled -1;
444 fet_endchar;
445
446 %%%%%%%%
447 %
448 %
449 %
450 % Single Stroke for Short Appogiatura
451 %
452 %
453 %
454
455 fet_beginchar("grace dash (up)", "ugrace", "gracedash")
456         save flare, 
457                 hip_depth_ratio, hip_width,
458                 foot_depth;
459
460         flare# = 1.0 staff_space#;
461         hip_depth_ratio = .72; 
462         hip_width# = upflag_width# - hip_thickness#/2;
463
464         foot_depth# =  3 staff_space#;
465
466         define_pixels(flare, hip_width, hip_thickness,
467                 foot_depth, foot_thickness);
468
469         set_char_box(hip_width# * hip_depth_ratio,
470           hip_width# + stemthickness#/2 + right_upflag_space#, 
471           foot_depth# * hip_depth_ratio, -flare#)
472
473         pickup pencircle scaled 1.5 stemthickness;
474         draw (-b ,-d) ..
475           (w, h);
476 fet_endchar;
477
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#;
491
492         foot_width_ratio = .95;
493
494         set_char_box(stemthickness# /2, hip_width#
495                 + stemthickness#/2 + right_downflag_space#, 
496                 total_depth# + foot_thickness#/2, stemthickness#/2)
497
498         define_pixels(flare, hip_width, hip_thickness,
499                 flagspace,
500                 foot_depth,  foot_thickness);
501
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);  
507
508         
509
510         pickup pencircle scaled stemthickness;
511         draw (0, 0) .. (0,-2 staff_space);
512         y_mirror_char;
513 fet_endchar;
514
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#;
528
529         foot_width_ratio = .95;
530
531         set_char_box(stemthickness# /2, hip_width#
532                 + stemthickness#/2 + right_downflag_space#, 
533                 total_depth# + foot_thickness#/2, stemthickness#/2)
534
535         define_pixels(flare, hip_width, hip_thickness,
536                 flagspace,
537                 foot_depth,  foot_thickness);
538
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);  
544
545         add_flag(flagspace, flare,
546                 .95, 1.05, 1.25, hip_thickness, foot_thickness);  
547
548         
549
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#;
567
568         foot_width_ratio = .98;
569
570         set_char_box(stemthickness# /2, hip_width#
571                 + stemthickness#/2 + right_downflag_space#, 
572                 total_depth# + foot_thickness#/2, stemthickness#/2)
573
574         define_pixels(flare, hip_width, hip_thickness,
575                 flagspace,
576                 foot_depth,  foot_thickness);
577
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);  
585
586         add_flag(.98 flagspace, flare,
587                 .91, 1.05, 1.2, hip_thickness, foot_thickness);  
588
589         
590
591         pickup pencircle scaled stemthickness;
592         draw (0, 0) .. (0,-2 staff_space);
593         y_mirror_char;
594 fet_endchar;
595
596 %%%%%%%%
597 %
598 %
599 %
600 % Mensural Notation
601 %
602 %
603 %
604
605 def draw_mensural_outermost_flag_i =
606         define_pixels(stafflinethickness, staff_space)
607
608         pickup pencircle
609                 xscaled 1.00 stafflinethickness
610                 yscaled 0.22 staff_space
611                 rotated -35;
612
613         save za, zb, zc, zd, ze;
614         pair za, zb, zc, zd, ze;
615
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);
621
622         draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
623 enddef;
624
625 def draw_mensural_outermost_flag_ii =
626         define_pixels(stafflinethickness, staff_space)
627
628         pickup pencircle
629                 xscaled 1.00 stafflinethickness
630                 yscaled 0.22 staff_space
631                 rotated -35;
632
633         save za, zb, zc, zd, ze;
634         pair za, zb, zc, zd, ze;
635
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);
641
642         draw za .. zb -- zc{zc-zb} .. {ze-zd}zd -- ze;
643 enddef;
644
645 def draw_mensural_inner_flag(expr il_shift) =
646         define_pixels(stafflinethickness, staff_space)
647
648         pickup pencircle
649                 xscaled 1.00 stafflinethickness
650                 yscaled 0.22 staff_space
651                 rotated -35;
652
653         save zs, za, zb, zc, zd;
654         pair zs, za, zb, zc, zd;
655
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);
661
662         draw za{2,1} .. zb .. zc .. {-2,-1}zd;
663 enddef;
664
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;
669
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;
674
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;
680
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;
686
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;
692
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;
698
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;
705
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;
712
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;
719
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;
726
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;
734
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;
742
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;
750
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;
758
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;
767
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;
776
777 %%%%%%%%
778 %
779 %
780 %
781 % Single Stroke for Short Appogiatura
782 %
783 %
784 %
785
786 fet_beginchar("grace dash (up)", "ugrace", "gracedash")
787         save flare, 
788                 hip_depth_ratio, hip_width,
789                 foot_depth;
790
791         flare# = 1.0 staff_space#;
792         hip_depth_ratio = .72; 
793         hip_width# = upflag_width# - hip_thickness#/2;
794
795         foot_depth# =  3 staff_space#;
796
797         define_pixels(flare, hip_width, hip_thickness,
798                 foot_depth, foot_thickness);
799
800         set_char_box(hip_width# * hip_depth_ratio,
801           hip_width# + stemthickness#/2 + right_upflag_space#, 
802           foot_depth# * hip_depth_ratio, -flare#)
803
804         pickup pencircle scaled 1.5 stemthickness;
805         draw (-b ,-d) ..
806           (w, h);
807 fet_endchar;
808
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#;
820
821         foot_width_ratio = .8;
822
823         define_pixels(flare, hip_width, hip_thickness,
824                 flagspace, foot_depth);
825
826         set_char_box(hip_width# * hip_depth_ratio,
827           hip_width# + stemthickness#/2 + right_downflag_space#,
828           foot_depth# * hip_depth_ratio, -flare#)
829
830         pickup pencircle scaled 1.5 stemthickness;
831         draw (-b, -d) .. (w,h);
832         y_mirror_char;
833 fet_endchar;
834
835 % ustem?
836 %
837 %
838 % Stem characters so we can compose metronome markings with Feta
839 % entirely.
840 %
841
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;
847
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;
854
855
856 fet_endgroup("flags");