]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-schrift.mf
*** empty log message ***
[lilypond.git] / mf / feta-schrift.mf
1 % -*- Fundamental -*-  (emacs-20 mf mode mucks
2 % feta-schrift.mf --  implement scripts
3
4 % source file of the Feta (defintively not an abbreviation for Font-En-Tja)
5 % music font
6
7 % (c) 1997 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 %       Jan Nieuwenhuizen <janneke@gnu.org>
9
10
11
12 fet_begingroup("scripts")
13
14 def draw_fermata =
15   save alpha, radius, crook_thinness, crook_fatness, dot_radius;
16   
17         % [Wanske] and some  Baerenreiter editions
18         % suggest ca 80 degrees iso half-circle
19   alpha := 10;
20
21   radius# = 1.25 staff_space#;
22   crook_thinness# = 1.5stafflinethickness#;
23   crook_fatness# = 4 stafflinethickness#;
24
25   radius# + crook_fatness#/2 = h#;
26   radius# + crook_thinness#/2 = w#;
27   set_char_box(w#, w#, crook_thinness#/2, h#);
28   
29   define_pixels(radius, crook_thinness, crook_fatness);
30   dot_radius = round (4/6 crook_fatness);
31
32
33   penpos1(crook_thinness, 0);
34   penpos2(crook_fatness, -90);
35   z1 = (-radius,0);
36   z2 = (0, radius);
37
38   fill z1l{dir (-alpha-90)}..{dir (90-alpha)}z1r..
39   {right}z2r -- z2l{left} .. cycle;
40
41   addto currentpicture also 
42   currentpicture xscaled -1;
43
44   pickup pencircle scaled 2dot_radius;
45   x4 =0;
46   bot y4 = - crook_thinness/2;
47   drawdot z4;
48 enddef;
49
50 fet_beginchar("fermata up", "ufermata", "ufermata")
51         draw_fermata;   
52         penlabels(1,2,4);
53 fet_endchar;
54
55 fet_beginchar("fermata down", "dfermata", "dfermata")
56         draw_fermata;
57         y_mirror_char;
58 fet_endchar;
59
60 %
61 % Thumbs are used in cello music.
62 % TODO : thumbs should look like the finger-font and should be placed in
63 % the same way in the score.
64 %
65
66 fet_beginchar("Thumb", "thumb", "thumb")
67         save thin, height, width, thick;
68         height# = 5/4 width#;
69         height# = staff_space#;
70         thin = 1.2 stafflinethickness;
71         thick =  2 thin;
72         set_char_box(width#/2, width#/2, height#/2, height#/2);
73         
74         penpos1(thick, 0);
75         penpos2(thin, 90);
76         z1r = (w, 0);
77         z2r = (0, h);
78         penlabels(1,2);
79         penstroke z1e{up} .. {left}z2e;
80         addto currentpicture also currentpicture xscaled -1;
81         addto currentpicture also currentpicture yscaled -1;
82
83         z3 = (0, -h);
84         z4 = (0, -1.5h);
85         penlabels(3,4);
86         draw_brush(z3,1.4*thin, z4,0.9*thick);
87 fet_endchar;
88
89 %
90 % FIXME: rounded endings
91 %
92 % `\accent' is TeX reserved.
93 fet_beginchar("> accent", "sforzato", "sforzatoaccent")
94         set_char_box(.9 staff_space#, .9 staff_space#, .5 staff_space#, .5 staff_space#);
95         save thickness, diminish;
96
97         thickness = 3/2 stafflinethickness;
98         pickup pencircle scaled thickness;
99
100         % prevent blobs at crossing lines
101         diminish = .75;
102
103         top y1 = h;
104         lft x1 = -b;
105         rt x2 = w;
106         y2 = .25 thickness* diminish;
107
108         rt z4 = (w,0);
109         x3 =0;
110         z3 = whatever [z1, z4];
111
112         penpos2(thickness*(2 - diminish)/2 , 90);
113         penpos1(thickness, 90);
114         penpos3(thickness, 90);
115
116         draw z1 .. z3;
117         draw (z1 .. z3) yscaled -1;
118         draw z4;
119         penstroke z3e .. z2e;
120         penstroke (z3e .. z2e) yscaled -1;
121
122         penlabels(1,2,3);
123         labels(4);
124 fet_endchar;
125
126 fet_beginchar("staccato dot", "staccato", "staccato")
127         save radius;
128         radius# =   0.20 * staff_space#;
129         define_whole_pixels(radius);
130         pickup pencircle scaled 2 radius;
131         drawdot (0,0);
132         set_char_box(radius#, radius#, radius#, radius#);
133 fet_endchar;
134
135 def draw_staccatissimo =
136         save radius, height;
137         height# = .8 staff_space#;
138         radius# = 2 stafflinethickness#;
139         define_whole_pixels(radius);
140         define_pixels(height);
141
142         draw_brush((0,0), stafflinethickness, (0, height),2 radius);
143         set_char_box(radius#,radius#, blot_diameter#/2, height# + radius#);
144 enddef;
145
146 fet_beginchar("staccatissimo/martellato up", "ustaccatissimo", 
147                 "ustaccatissimo")
148         draw_staccatissimo;
149 fet_endchar;
150
151 fet_beginchar("staccatissimo/martellato down", "dstaccatissimo", "dstaccatissimo")
152         draw_staccatissimo;
153         y_mirror_char;
154 fet_endchar;
155
156 fet_beginchar("portato/single tenuto", "tenuto", "tenuto")
157         save thick;
158         thick# = 1.6 stafflinethickness#;
159         define_whole_pixels(thick);
160
161         set_char_box(.6 staff_space#, .6 staff_space#, thick#/2,thick#/2);
162         pickup pencircle scaled thick;
163         draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
164 fet_endchar;
165
166
167 %
168 % Portato by Heikki Junes <heikki.junes@hut.fi>
169 %
170
171 def draw_portato = 
172         save thick, radius;
173         thick# = 1.4 stafflinethickness#;
174         radius# = 1.4 stafflinethickness#;
175         define_whole_pixels(thick,radius);
176         
177         set_char_box(.6 staff_space#, .6 staff_space#, thick#/2,.5 staff_space#+ radius#);
178         draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
179
180         pickup pencircle scaled 2 radius;
181         drawdot (0,h);
182 enddef;
183
184
185 fet_beginchar("portato/tenuto with staccato", "uportato", 
186                 "uportato")
187         draw_portato;
188 fet_endchar;
189
190
191 fet_beginchar("portato/tenuto with staccato", "dportato", 
192                 "dportato")
193         draw_portato;
194         y_mirror_char
195 fet_endchar;
196
197
198 def draw_marcato = 
199         save fat_factor, thinness;
200         set_char_box(staff_space#/2, staff_space#/2, 0, 1.1 staff_space#);
201
202         fat_factor = .3;
203         thinness =  stafflinethickness;
204
205         pickup pencircle scaled thinness;
206         rt x2 = w;
207         lft x5 = -b;
208         bot y5 = 0;
209         top y3 = h;
210         y1 = y2 = y5;
211
212         x3 =0;
213         z1 - z4 = whatever * (charwd, -charht);
214         z4 = fat_factor [z3, z5];
215
216         filldraw z1 -- z2 -- z3 -- z4 -- cycle;
217         draw z3 .. z5;
218 enddef;
219
220 fet_beginchar("marcato up", "umarcato", "umarcato")
221         draw_marcato;
222         labels(1,2,3,4,5);
223 fet_endchar;
224
225
226 %
227 % The down marcato char (not very much used). 
228 % Contrary to what some MF/TeX `gurus' believe
229 % it is *point*-symmetric with the "up" version
230 fet_beginchar("marcato down", "dmarcato", "dmarcato")
231         draw_marcato;
232         xy_mirror_char;
233 fet_endchar;
234  
235
236 %
237 % used in french horn music todo
238 %
239 % TODO: too light at 20pt
240 fet_beginchar("open (unstopped)", "open", "ouvert")
241         save thin, height, width, thick;
242         height# = 5/4 width#;
243         height# = staff_space#;
244         thin = 1.2 stafflinethickness;
245         thick =  1.4 thin;
246         set_char_box(width#/2, width#/2, height#/2, height#/2);
247         
248         penpos1(thick, 0);
249         penpos2(thin, 90);
250         z1r = (w, 0);
251         z2r = (0, h);
252         penlabels(1,2);
253         penstroke z1e{up} .. {left}z2e;
254         addto currentpicture also currentpicture xscaled -1;
255         addto currentpicture also currentpicture yscaled -1;
256 fet_endchar;
257
258
259 fet_beginchar("plus (stopped)", "stopped", "plusstop")
260         save thick, size;
261         thick = 2 stafflinethickness;
262         size# = 1.1 staff_space#;
263
264         set_char_box(size#/2, size#/2, size#/2, size#/2);
265         draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
266         addto currentpicture also currentpicture rotated 90;
267 fet_endchar;
268
269
270 %
271 % A vee with tapered insides to prevent visual blotting
272 %
273
274 def draw_vee (expr width, height, thickness) =
275 begingroup
276         save diminish;
277
278         diminish = 0.75;
279
280         pickup pencircle scaled thickness;
281         
282         x1 = 0;
283         bot y1 = 0;
284         rt x2 =  w;
285         top y2 = h;
286
287         z3 = 0.6 [z2, z1];
288         penpos3(thickness, 0);
289         penpos4(thickness * diminish, 0);
290         x4r = thickness/2;
291         y4 = thickness/2;
292         labels(1,2);
293         penlabels(3,4);
294
295         draw z1;
296         draw z3 -- z2;
297         penstroke z3e .. z4e;
298         addto currentpicture also currentpicture xscaled -1;
299 endgroup;
300 enddef;
301
302 fet_beginchar("Upbow", "upbow", "upbow")
303         save ht, wd, thick, diminish;
304         
305         thick = 1.4 stafflinethickness;
306         wd# = 1.3 staff_space#;
307         ht# = 1.6 wd#; 
308         set_char_box(wd#/2, wd#/2, 0, ht#);
309         draw_vee (wd, ht, thick);
310 fet_endchar;
311
312
313 fet_beginchar("Downbow", "downbow", "downbow")
314         save stemthick, beamheight;
315         save wd,round;
316         define_pixels(wd)
317
318         wd# = 1.5 staff_space#;
319         stemthick = 1.2 stafflinethickness;
320         set_char_box(wd#/2, wd#/2, 0, 4/3 staff_space#);
321
322         beamheight = 4/10 h;
323
324         draw_rounded_block((-b,h-beamheight),(w,h),blot_diameter);
325         draw_rounded_block((-b,-d),(-b+stemthick,h-stemthick),stemthick);
326         addto currentpicture also currentpicture xscaled -1;
327 fet_endchar;
328
329 %
330 % Inspired by a computer-set version of Auf dem Strom by Baerenreiter. 
331 %
332
333 def draw_turn =
334         save thin, thick, ball_diam, darkness;
335         save wd, ht, thick_nibangle, ball_nib_thick;
336         save turndir;
337         pair turndir;
338
339         wd# = 35/16 staff_space#;
340         ht# = 18/17 staff_space#;
341         darkness = 1.20 stafflinethickness;
342
343         set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);       
344
345         thick_nibangle = 60;
346         thick = 3 darkness;
347         thin = darkness;
348         ball_nib_thick = 2.7 darkness;
349         ball_diam = ball_nib_thick + (h - ball_nib_thick) / 10;
350
351         
352         x3l = w;
353         y3 = 0;
354         y4l = h;
355         x4 = x2;
356         x2l = w/2;
357         y2l = -d;
358         z1 = (0,0);
359
360         penpos1(1.1 thick, thick_nibangle);
361         penpos2(thick, thick_nibangle);
362         penpos3(thin, 180);
363         penpos4(ball_nib_thick, -90);
364
365         path swoosh, ploop;
366         swoosh :=  z1l{curl 0} .. z2l .. z3l{up} .. {left}z4l 
367           -- z4r .. z3r{down} .. z2r{left} ;
368         fill swoosh .. (swoosh scaled -1) .. cycle;
369
370         x5r = x4;
371         y5r = y4l - ball_diam /2;
372         z6r = z5r;
373
374         penpos5(1.6 ball_diam/2, 10);
375         penpos6(ball_diam/2, 150);
376
377         ploop := z4l{left} .. z5l .. z6l -- cycle;
378         fill ploop;
379         fill ploop scaled -1;
380
381
382 enddef;
383
384 fet_beginchar("Reverse turn","reverseturn","reverseturn")
385         draw_turn;
386         currentpicture := currentpicture yscaled -1;
387         penlabels(5,6,7);
388         penlabels(2,3,4);
389 fet_endchar;
390
391
392 fet_beginchar("Turn","turn","turn")
393         draw_turn;
394                 
395         penlabels(5,6,7);
396         penlabels(1,2,3,4);
397 fet_endchar;
398
399
400
401 %
402 % Inspired by a (by now) PD edition of Durand & C'ie edition of 
403 % Saint-Saens' Celloconcerto no. 1 
404 %
405 % FIXME take out hardcoded vars.
406 % FIXME the two loops on the `t' should be smoother (and the left one bigger).
407 % FIXME generic macros for serifs: top of the t and bottom of r
408 %
409
410
411 fet_beginchar("Trill (`tr')","trill","trill")
412         
413         save start_nib_angle,  ascender_extra, ex, hair_thick, fatness,
414           slant_angle, slant, t_fatness, r_fatness, kerning, t_overshoot, 
415           uitschieter, bulb_size;
416         ;
417         pair slant_vec;
418
419         ascender_extra# = 1/2 ex#;
420         ascender# = ascender_extra# + ex#;
421         ex# = 1.4 staff_space#;
422         kerning# = .60 ex#;
423         start_nib_angle = 20;
424         bulb_size = 0.70;
425         define_pixels(ex, ascender_extra, ascender, kerning);
426
427         t_overshoot = 0.03 ex;
428         fatness = 12/40 ex;
429         t_fatness = 0.78 fatness;
430         t_width =  1.9 t_fatness;
431         r_fatness = 0.78 fatness;
432         uitschieter = 0.48 ex;
433         hair_thick =  blot_diameter;
434         r_flare = 0.45  r_fatness;
435         r_width =  2 r_fatness + 0.25 kerning;
436         slant = .2;
437
438 %       slant = .0;
439
440         local_copy(transform)(currenttransform);
441         currenttransform := currenttransform slanted slant shifted (- staff_space, 0)  ;
442
443         y1 = ascender;
444
445         % try to position in such a way that the center is the visual
446         % center
447
448         x1l = 0.2 staff_space;
449         x1r - x1l = t_fatness;
450         penpos1(start_nib_wid, start_nib_angle);
451         
452         z2 = (x1, 7/18 ex);
453         penpos2(start_nib_wid, start_nib_angle);
454
455         z3l = (x2l + 0.5 t_width, - t_overshoot);
456
457         z4l = (x2l + t_width, 0.23 ex);
458         penpos4(whatever, 200);
459         x4l - x4r = hair_thick;
460
461         x3r = 0.5 [x4r, x2r];
462 %       1.7 [x3l, x3r] = x4r;
463         y3r - y3l = 0.6 t_fatness;
464
465         
466         save t_p, krul_p;
467         path t_p, krul_p, r_p;
468
469         z5 = (x2l + t_fatness/2, 2/3 ex);
470 %       penpos5(hair_thick, ); 
471
472         t_p := z1r{dir (angle(z1l-z1r) + 30)} .. z1l{-dir (angle(z1r-z1l) - 45)}
473                 -- z2l {down}
474                 .. tension (1 + .5 slant)
475                 .. z3l{right} 
476                 
477                 .. z4l{up} -- z4r{down} 
478                 .. z3r{left}
479                 .. tension (1.5 + .7 slant)
480                 .. z2r{up} .. z1r -- cycle;
481         fill t_p ;
482
483         krul_ang = 32;
484
485         pickup pencircle scaled hair_thick;
486         
487         lft x6 = x2l - uitschieter;
488         y6 =  y5 ; % - 1/20 ex;
489
490         z7 = z5 + whatever*dir krul_ang;
491         up_angle = krul_ang;
492         % angle (z7-z5)
493         x7 = 5/10 kerning + x5;
494         
495         penpos7(hair_thick, up_angle + 90);
496
497         
498         y9 = 3/4 ex;
499         x9 = x1 + kerning;
500         penpos9(r_fatness, 0);
501
502         x10 = x9;
503         y10 =  -0.3 stafflinethickness;
504         penpos10(r_fatness, 0);
505
506         krul_p := z4{up}
507                 .. tension 0.98
508                 .. z5
509                 .. z6
510                 .. z5 --- z7;
511         draw krul_p;
512         r_p := z7l{z7-z5} .. z9l{down} --- simple_serif (z10l, z10r, -30)
513                 --- z9r{up} 
514                  ..  z7r{z5-z7} -- cycle;
515         fill r_p;
516
517         set_char_box(.85 staff_space# , .85 staff_space#, 0,ascender#);
518
519
520         penpos11(1/4 r_fatness, -4);
521         z11r = z9r;
522         
523         z13l = (x9l + r_width, y11 -  stafflinethickness );
524         penpos13(r_flare, 180);
525
526         z15 = z13r  - (bulb_size * r_fatness,0);
527         z14 = 0.5 [z13l, z15] - (0,bulb_size* r_fatness);
528         z16 = 0.5 [z13l, z15] + (0,bulb_size* r_fatness);
529
530
531         fill z11r{up} .. tension 0.94 .. z13r{down} -- z15{down}
532                 .. tension 1.0 .. z13l{up}
533                 .. z11l{down} -- cycle;
534
535         fill z15{up} .. tension 1.06 .. z13l{down} .. z14 .. cycle;
536
537
538
539         penlabels(range 1 thru 15);
540
541 fet_endchar;
542
543
544 def draw_heel =
545         save radius, thickness, wall;
546
547         radius# := .5 staff_space#;
548
549         define_pixels(radius);
550         set_char_box(radius#, radius#, radius#, 2/3 staff_space#);
551
552         thickness := 1.5 stafflinethickness;    
553         pickup pencircle scaled thickness;
554         rt x1 = b;
555         top y1 = h;
556         
557         x2 =x1;
558         y2 = 0;
559
560         x3 = 0;
561         bot y3 = -d;
562
563         draw z1{down} .. z2{down} .. z3{left};
564         addto currentpicture also currentpicture xscaled -1;
565         
566 enddef;
567
568
569 fet_beginchar("left heel", "upedalheel", "upedalheel")
570         draw_heel;
571         labels(1,2,3);
572 fet_endchar;
573
574 fet_beginchar("right heel", "dpedalheel", "dpedalheel")
575         draw_heel;
576         y_mirror_char;
577 fet_endchar;
578
579 def draw_toe =
580         save ht,wd;
581
582         thickness := 1.5 stafflinethickness;
583         ht# := 1.5 staff_space#;
584         wd# := 1/3 ht#;
585         define_pixels(ht,wd);
586
587
588         set_char_box(wd#, wd#, 0, ht#);
589         draw_vee (wd, ht, thickness);
590 enddef;
591         
592 fet_beginchar("left toe", "upedaltoe", "upedaltoe")
593         draw_toe;
594         labels(1,2,3);
595 fet_endchar;
596 fet_beginchar("right toe", "dpedaltoe", "dpedaltoe")
597         draw_toe;
598         y_mirror_char;
599 fet_endchar;
600
601 fet_beginchar("Flageolet", "flageolet", "flageolet")
602         save height,width,thickness;
603         height#=4/15 staffsize#;
604         width#=height#;
605         thickness#=blot_diameter#;
606         define_pixels(height,width,thickness);
607         set_char_box(width#/2,width#/2,height#/2,height#/2);
608         
609         pickup pencircle scaled thickness;
610         x1= .5 [x2, x4];
611         x1 = 0;
612         top y1=height/2;
613         rt x4  - lft x2 =width; 
614         y2 = 0;
615         y4=y2;
616         x3=x1;
617         bot y3=-height/2;
618
619         penlabels(1,2,3,4);
620         draw z1..z2..z3..z4..cycle;
621 fet_endchar;
622
623 fet_beginchar("Segno", "segno", "segno")
624         save thin, thick, ball_diam, darkness, pointheight;
625         save wd, ht, thick_nibangle, ball_nib_thick;
626         save turndir;
627         pair turndir;
628
629         ht# = 3 staff_space#;
630         wd# = 2 staff_space#;
631         darkness = 1.20 stafflinethickness;
632
633         set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);       
634
635         thick_nibangle = 30;
636         thick = 3 darkness;
637         thin = darkness;
638         ball_nib_thick = 2.7 darkness;
639         ball_diam = ball_nib_thick + (w - ball_nib_thick) / 10;
640         pointheight = 2 stafflinethickness;
641         
642         y3l = h;
643         2 x3 = x2 + x4;
644         x4 = 0;
645         y4 = y2;
646         y2l = .6 h;
647         x2l = -b;
648         z1 = (0,0);
649
650         penpos1(thick, 2 thick_nibangle);
651         penpos2(thick, thick_nibangle);
652         penpos3(thin, -90);
653         penpos4(ball_nib_thick, 180-thick_nibangle);
654
655         path swoosh, ploop;
656         swoosh :=  z1l{curl 0} .. z2l .. z3l{right} .. {down}z4l 
657           -- z4r .. z3r{left} .. z2r{down} ;
658         fill swoosh .. (swoosh scaled -1) .. cycle;
659         penlabels(1,2,3,4);
660
661         y5r = y4;
662         x5r = x4l - ball_diam /2;
663         z6r = z5r;
664
665         penpos5(1.6 ball_diam/2, 100);
666         penpos6(ball_diam/2, 240);
667
668         ploop := z4l{down} .. z5l .. z6l -- cycle;
669         fill ploop;
670         fill ploop scaled -1;
671         penlabels(4,5,6);
672
673         penpos7(2 thin,0);
674         z7l=(-b,-d);
675         penpos8(2 thin,0);
676         z8r=(w,h);
677         filldraw z7l--z8l{right}--z8r{down}--z7r{right}--cycle;
678         pickup pencircle scaled 2 thin;
679         draw (-x2r,pointheight);
680         draw (x2r,-pointheight);
681 fet_endchar;
682
683 fet_beginchar("Coda", "coda", "coda")
684         save thin, thick, codawidth, codaheight;
685         thin# = 1.2 stafflinethickness#;
686         thick# = 3.5 stafflinethickness#;
687         codawidth# = 2/3 staff_space#;
688         codaheight# = 1 staff_space#;
689         define_pixels(thin, thick, codawidth, codaheight);
690
691         set_char_box(codawidth#+thick#, codawidth#+thick#,
692                 codaheight#+thick#, codaheight#+thick#);
693
694         penpos1(thick,0);
695         penpos2(thin,-90);
696         penpos3(thick,180);
697         x1l=-codawidth;
698         y2l=codaheight;
699         y1=0;
700         x2=0;
701         z3 = - z1;
702         penlabels(1,2,3);
703
704         path halfcoda;
705         halfcoda := z1l{up} .. z2l{right} .. z3l{down} -- 
706                 z3r{up} .. z2r{left} .. z1r{down} .. cycle;
707         fill halfcoda;
708         fill (halfcoda scaled -1);
709
710         draw_gridline((0,-h),(0,h),thin);
711         draw_gridline((-w,0),(w,0),thin);
712
713 fet_endchar;
714
715 def draw_comma = 
716         save alpha, thick, thin, ht;
717         alpha:=35;
718         thin# = 1.2 stafflinethickness#;
719         thick# = 3 stafflinethickness#;
720         ht# = .6staff_space#;
721         define_pixels(thin, thick,ht);
722         set_char_box(0, .5staff_space#, ht#, ht#);
723
724         penpos1(thick, alpha);
725         penpos2(thick, alpha+90);
726         penpos3(thin, 180-alpha);
727         penpos4(thin, 90-alpha);
728         x3r=0;
729         x1l=x3l;
730         y2r=-y4l=h;
731         z1=z2;
732         z3=z4;
733         penlabels(1,2,3,4);
734         fill z1l{dir (alpha+90)} .. z2r{dir alpha} .. z1r{dir (alpha-90)} .. 
735         z3l{dir (270-alpha)} .. z4l{dir (alpha+180)} .. 
736         z3r{dir (90-alpha)} .. cycle;
737 enddef;
738
739 fet_beginchar("Right Comma","rcomma","rcomma");
740         draw_comma;
741 fet_endchar;
742
743 fet_beginchar("Left Comma","lcomma","lcomma");
744         draw_comma;
745         xy_mirror_char;
746 fet_endchar;
747
748 thick#:=1/24designsize;
749 define_blacker_pixels(thick);
750
751 rthin:=1/8*staff_space;
752 rthick:=2thick+rthin;
753
754 def draw_arpeggio =
755         save alpha;
756         alpha:=-40;
757         save ne,nw,se,sw; pair ne,nw,se,sw;
758         save x,y;
759         
760         se=dir alpha; nw=dir (alpha+180);
761         ne=dir (alpha+90); sw=dir (alpha-90);
762         penpos1(rthin,alpha+90);
763         penpos2(5/4rthick,alpha);
764         penpos4(5/4rthick,alpha);
765         penpos5(rthin,alpha+90);
766         penpos3(3/4rthick,alpha);
767
768         z1=(width/2, height) - overshoot*se;
769         z2=2[z4,(width/2,height/2)];
770         z3=1/2[z2,z4];
771         x4=2/8staff_space;
772         y4=rthin;
773
774         z5=2[z1,(width/2,height/2)];
775         z6=z2l+1/2rthin*sw;
776         z7=z4l+1/2rthin*sw+1/2rthin*se;
777         z8=2[z6,(width/2,height/2)];
778         z9=2[z7,(width/2,height/2)];
779         
780         fill z1l{se}..{se}z6..z3l..z7{se}..{se}z5l..z5r{nw}..{nw}z8..z3r..z9{nw}..{nw}z1r.. cycle;
781         penlabels(1,2,3,4,5,6,7,8,9);
782         enddef;
783
784 fet_beginchar("Arpeggio","arpeggio","arpeggio");
785         %draw_staff (-2, 2, 0.0);       
786         save height, overshoot, width;
787         height# = staff_space#;
788         width# = 0.8height#;
789         overshoot# = 0.25 staff_space#;
790         define_pixels (height,overshoot,width);
791         set_char_box(0, width#, 0, height#);
792         draw_arpeggio;
793         fet_endchar;
794
795 % Extendable Trill symbol.
796 % Not yet used
797 % Rename me to Trill, rename Trill to Tr?
798 fet_beginchar("Trill-element","trill-element","trillelement");
799         save height, overshoot;
800         height# = staff_space#;
801         width# = 0.8height#;
802         overshoot# = 0.25 staff_space#;
803         define_pixels (height,overshoot,width);
804         set_char_box(0, height#, 0, width#);
805         draw_arpeggio;
806         currentpicture := currentpicture shifted -(width/2, height/2);
807         currentpicture := currentpicture rotated 90;
808         currentpicture := currentpicture shifted (height/2, width/2);
809         fet_endchar;
810
811
812
813 %
814 % Arpeggio arrow by Chris Jackson <chris@fluffhouse.org.uk>
815 %
816
817 def draw_arpeggio_arrow =
818         save thinness, height, width, overshoot, se, sw, ne, nw, alpha;
819         pair ne, nw, se, sw;
820         height# = staff_space#;
821         width# = 0.8height#;
822         overshoot# = 0.25 staff_space#;
823         define_pixels (height,overshoot,width);
824         set_char_box(0, width#, 0, height#);
825         alpha := -40;
826         nw = dir (alpha+180);
827         sw = dir (alpha-90); se = dir alpha;
828
829         penpos1(rthin,     alpha+90);
830         penpos2(5/4 rthick, alpha);
831         penpos3(5/4 rthick,     0);
832
833         z1 = (width/2, height) - overshoot*se; % numbering is consistent with the arpeggio symbol
834         z2 = 2[z4,(width/2,height/2)];
835         z3 = (0.5 width, 0.5 height);
836         z4 = (0.25 staff_space, rthin);
837         z6 = z2l + 1/2rthin*sw;
838         z9 = (width/2, height) + overshoot*se;
839         fill z1l {se}..{se} z6 .. z3l .. z3r.. z9{nw} ..{nw} z1r.. cycle;
840
841         bot z10 = ( 0.5w,  0   );
842         lft z11 = (-0.3w,  0.8h);
843         rt z12  = ( 1.3w,  0.8h);
844         pickup pencircle scaled 0.5 rthin;
845         filldraw z3 -- z12 {dir -130} ..  {dir -110} z10 {dir 110} ..  {dir 130} z11 -- cycle;
846 enddef;
847
848 fet_beginchar("Arpeggio arrow down", "arpeggio-arrow--1", "arpeggioarrowdown");
849         draw_arpeggio_arrow;
850 fet_endchar;
851
852
853 fet_beginchar("Arpeggio arrow up", "arpeggio-arrow-1", "arpeggioarrowup");
854         draw_arpeggio_arrow;
855         currentpicture := currentpicture scaled -1 shifted (0.8staff_space, staff_space);
856 fet_endchar;
857
858
859
860
861 % Hmm
862 input feta-slag;
863
864
865
866 fet_endgroup("scripts");
867