1 % -*- Fundamental -*- (emacs-20 mf mode mucks
2 % feta-schrift.mf -- implement scripts
4 % source file of the Feta (defintively not an abbreviation for Font-En-Tja)
7 % (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 % Jan Nieuwenhuizen <janneke@gnu.org>
12 fet_begingroup("scripts")
15 save alpha, radius, crook_thinness, crook_fatness, dot_radius;
17 % [Wanske] and some Baerenreiter editions
18 % suggest ca 80 degrees iso half-circle
21 radius# = 1.25 staff_space#;
22 crook_thinness# = 1.5linethickness#;
23 crook_fatness# = 0.25 staff_space# + 1.5 linethickness#;
25 radius# + crook_fatness#/2 = h#;
26 radius# + crook_thinness#/2 = w#;
27 set_char_box(w#, w#, crook_thinness#/2, h#);
29 define_pixels(radius, crook_thinness, crook_fatness);
30 dot_radius = round (4/6 crook_fatness);
33 penpos1(crook_thinness, 0);
34 penpos2(crook_fatness, -90);
38 fill z1l{dir (-alpha-90)}..{dir (90-alpha)}z1r..
39 {right}z2r -- z2l{left} .. cycle;
41 addto currentpicture also
42 currentpicture xscaled -1;
44 pickup pencircle scaled 2dot_radius;
46 bot y4 = - crook_thinness/2;
50 fet_beginchar("fermata up", "ufermata", "ufermata")
55 fet_beginchar("fermata down", "dfermata", "dfermata")
60 def draw_short_fermata =
61 save fat_factor, thinness, dot_radius;
62 set_char_box(staff_space#, staff_space#, 0, 2.2 staff_space#);
64 dot_radius# = 0.133 staff_space# + 1.33 linethickness#;
65 define_pixels(dot_radius)
68 thinness = 1.5 linethickness;
70 pickup pencircle scaled thinness;
78 z1 - z4 = whatever * (charwd, -charht);
79 z4 = fat_factor [z3, z5];
81 filldraw z1 -- z2 -- z3 -- z4 -- cycle;
84 pickup pencircle scaled 2dot_radius;
90 fet_beginchar("short fermata up", "ushortfermata", "ushortfermata")
94 fet_beginchar("short fermata down", "dshortfermata", "dshortfermata")
99 def draw_long_fermata =
100 save stemthick, beamheight, dot_radius, wd;
101 define_pixels(wd, dot_radius)
103 wd# = 2.5 staff_space#;
104 stemthick = 1.5 linethickness;
105 beamheight = 0.3 staff_space+ linethickness;
106 dot_radius# = 0.133 staff_space#+ + 1.333 *linethickness#;
107 set_char_box(wd#/2, wd#/2, 0, 3/2 staff_space#);
109 draw_rounded_block((-b, h-beamheight), (w, h), blot_diameter);
110 draw_rounded_block((-b, -d),(-b+stemthick, h-stemthick), stemthick);
111 addto currentpicture also currentpicture xscaled -1;
113 pickup pencircle scaled 2dot_radius;
119 fet_beginchar("long fermata up", "ulongfermata", "ulongfermata")
123 fet_beginchar("long fermata down", "dlongfermata", "dlongfermata")
128 def draw_very_long_fermata =
129 save ibeamheight, obeamheight;
130 save ihwd, ohwd, iht, oht; % inner/outer half_width/height
131 save stemthick, dot_radius;
132 define_pixels(ihwd, ohwd, iht, oht)
134 ihwd# = 1.0 staff_space#;
135 ohwd# = 1.5 staff_space#;
136 iht# = 0.9 staff_space#;
137 oht# = 1.6 staff_space#;
139 stemthick = 1.5 linethickness;
140 ibeamheight = 0.3 staff_space;
141 obeamheight = 0.5 staff_space;
142 dot_radius = ((iht - ibeamheight) * 4/10) ;
144 set_char_box(ohwd#, ohwd#, 0, oht#);
146 draw_rounded_block((-ohwd, oht-obeamheight), (ohwd, oht), blot_diameter);
147 draw_rounded_block((-ohwd, 0),(-ohwd+stemthick, ohwd-stemthick), stemthick);
148 draw_rounded_block((-ihwd, iht-ibeamheight), (ihwd, iht), blot_diameter);
149 draw_rounded_block((-ihwd, 0),(-ihwd+stemthick, ihwd-stemthick), stemthick);
150 addto currentpicture also currentpicture xscaled -1;
152 pickup pencircle scaled 2dot_radius;
158 fet_beginchar("very long fermata up", "uverylongfermata", "uverylongfermata")
159 draw_very_long_fermata;
162 fet_beginchar("very long fermata down", "dverylongfermata", "dverylongfermata")
163 draw_very_long_fermata;
168 % Thumbs are used in cello music.
169 % TODO : thumbs should look like the finger-font and should be placed in
170 % the same way in the score.
173 fet_beginchar("Thumb", "thumb", "thumb")
174 save thin, height, width, thick, depth;
175 height# = 5/4 width#;
176 height# = staff_space#;
177 depth# = 1.6 (height# / 2);
178 set_char_box(width#/2, width#/2, depth#, height#/2);
179 define_pixels (height, width)
181 thin = .6 linethickness + 0.06 staff_space;
182 2 thick + 0.5 (height - 2 thin) = width;
189 penstroke z1e{up} .. {left}z2e;
190 addto currentpicture also currentpicture xscaled -1;
191 addto currentpicture also currentpicture yscaled -1;
195 y4 = - d + brush_thick / 2;
196 brush_thick = 0.9*thick;
199 draw_brush(z3,1.4*thin, z4, brush_thick);
203 % FIXME: rounded endings
205 % `\accent' is TeX reserved.
206 fet_beginchar("> accent", "sforzato", "sforzatoaccent")
207 set_char_box(.9 staff_space#, .9 staff_space#, .5 staff_space#, .5 staff_space#);
208 save thickness, diminish;
210 thickness = 0.05 staff_space + linethickness;
211 pickup pencircle scaled thickness;
213 % prevent blobs at crossing lines
219 y2 = .25 thickness* diminish;
222 x3 = - linethickness + 0.1 staff_space;
223 z3 = whatever [z1, z4];
225 penpos2(thickness*(2 - diminish)/2 , 90);
226 penpos1(thickness, 90);
227 penpos3(thickness, 90);
230 draw (z1 .. z3) yscaled -1;
232 penstroke z3e .. z2e;
233 penstroke (z3e .. z2e) yscaled -1;
239 fet_beginchar("espr", "espr", "espressivo")
240 set_char_box(1.9 staff_space#, 1.9 staff_space#, .5 staff_space#, .5 staff_space#);
241 save thickness, diminish;
242 thickness = 0.05 staff_space + linethickness;
243 pickup pencircle scaled thickness;
246 top z1 =(0.2 staff_space,h);
249 y4 = y3 + .25 t * diminish;
251 z2 = whatever[z1,z3];
254 penpos4((2-diminish)*t*.5,90);
256 penstroke z2e .. z4e;
260 addto currentpicture also currentpicture xscaled -1;
261 addto currentpicture also currentpicture yscaled -1;
265 fet_beginchar("staccato dot", "staccato", "staccato")
267 radius# = 0.20 * staff_space#;
268 define_whole_pixels(radius);
269 pickup pencircle scaled 2 radius;
271 set_char_box(radius#, radius#, radius#, radius#);
274 def draw_staccatissimo =
276 height# = .8 staff_space#;
277 radius# = linethickness# + .1 staff_space#;
278 define_whole_pixels(radius);
279 define_pixels(height);
281 draw_brush((0,0), linethickness, (0, height),2 radius);
282 set_char_box(radius#,radius#, blot_diameter#/2, height# + radius#);
285 fet_beginchar("staccatissimo/martellato up", "ustaccatissimo",
290 fet_beginchar("staccatissimo/martellato down", "dstaccatissimo", "dstaccatissimo")
295 fet_beginchar("portato/single tenuto", "tenuto", "tenuto")
297 thick# = 1.6 linethickness#;
298 define_whole_pixels(thick);
300 set_char_box(.6 staff_space#, .6 staff_space#, thick#/2,thick#/2);
301 pickup pencircle scaled thick;
302 draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
307 thick# = 1.4 linethickness#;
308 radius# = 1.2 linethickness# + 0.04 staff_space#;
309 define_whole_pixels(thick,radius);
311 set_char_box(.6 staff_space#, .6 staff_space#, thick#/2,.5 staff_space#+ radius#);
312 draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
314 pickup pencircle scaled 2 radius;
319 fet_beginchar("portato/tenuto with staccato", "uportato",
325 fet_beginchar("portato/tenuto with staccato", "dportato",
333 save fat_factor, thinness;
334 set_char_box(staff_space#/2, staff_space#/2, 0, 1.1 staff_space#);
337 thinness = linethickness;
339 pickup pencircle scaled thinness;
347 z1 - z4 = whatever * (charwd, -charht);
348 z4 = fat_factor [z3, z5];
350 filldraw z1 -- z2 -- z3 -- z4 -- cycle;
354 fet_beginchar("marcato up", "umarcato", "umarcato")
361 % The down marcato char (not very much used).
362 % Contrary to what some MF/TeX `gurus' believe
363 % it is *point*-symmetric with the "up" version
365 fet_beginchar("marcato down", "dmarcato", "dmarcato")
372 % used in french horn music todo
374 % TODO: too light at 20pt
375 fet_beginchar("open (unstopped)", "open", "ouvert")
376 save thin, height, width, thick;
377 height# = 5/4 width#;
378 height# = staff_space#;
379 thin = .6 linethickness + 0.06 staff_space;
380 set_char_box(width#/2, width#/2, height#/2, height#/2);
381 define_pixels (width,height);
382 2 thick + 0.6 (height - 2 thin) = width;
389 penstroke z1e{up} .. {left}z2e;
390 addto currentpicture also currentpicture xscaled -1;
391 addto currentpicture also currentpicture yscaled -1;
395 fet_beginchar("plus (stopped)", "stopped", "plusstop")
397 thick = 2 linethickness;
398 size# = 1.1 staff_space#;
400 set_char_box(size#/2, size#/2, size#/2, size#/2);
401 draw_rounded_block((-b,-thick/2),(w,thick/2),thick);
402 addto currentpicture also currentpicture rotated 90;
407 % A vee with tapered insides to prevent visual blotting
410 def draw_vee (expr width, height, thickness) =
416 pickup pencircle scaled thickness;
423 z3 = whatever [z2, z1];
424 y3 = 0.6 [y2, y1] + thickness;
426 penpos3(thickness, 0);
427 penpos4(thickness * diminish, 0);
435 penstroke z3e .. z4e;
436 addto currentpicture also currentpicture xscaled -1;
440 fet_beginchar("Upbow", "upbow", "upbow")
441 save ht, wd, thick, diminish;
443 thick = 1.4 linethickness;
444 wd# = 1.3 staff_space#;
446 set_char_box(wd#/2, wd#/2, 0, ht#);
447 draw_vee (wd, ht, thick);
451 fet_beginchar("Downbow", "downbow", "downbow")
452 save stemthick, beamheight;
456 wd# = 1.5 staff_space#;
457 stemthick = 1.2 linethickness;
458 set_char_box(wd#/2, wd#/2, 0, 4/3 staff_space#);
462 draw_rounded_block((-b,h-beamheight),(w,h),blot_diameter);
463 draw_rounded_block((-b,-d),(-b+stemthick,h-stemthick),stemthick);
464 addto currentpicture also currentpicture xscaled -1;
468 % Inspired by a computer-set version of Auf dem Strom by Baerenreiter.
472 save thin, thick, ball_diam, darkness;
473 save wd, ht, thick_nibangle, ball_nib_thick;
477 wd# = 35/16 staff_space#;
478 ht# = 18/17 staff_space#;
479 darkness = 0.3 linethickness + 0.09 staff_space;
481 set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);
486 ball_nib_thick = 2.7 darkness;
487 ball_diam = ball_nib_thick + (h - ball_nib_thick) / 10;
498 penpos1(1.1 thick, thick_nibangle);
499 penpos2(thick, thick_nibangle);
501 penpos4(ball_nib_thick, -90);
504 swoosh := z1l{curl 0} .. z2l .. z3l{up} .. {left}z4l
505 -- z4r .. z3r{down} .. z2r{left} ;
506 fill swoosh .. (swoosh scaled -1) .. cycle;
509 y5r = y4l - ball_diam /2;
512 penpos5(1.6 ball_diam/2, 10);
513 penpos6(ball_diam/2, 150);
515 ploop := z4l{left} .. z5l .. z6l -- cycle;
517 fill ploop scaled -1;
522 fet_beginchar("Reverse turn","reverseturn","reverseturn")
524 currentpicture := currentpicture yscaled -1;
528 fet_beginchar("Turn","turn","turn")
530 penlabels(1,2,3,4,5,6,7);
536 % Inspired by a (by now) PD edition of Durand & C'ie edition of
537 % Saint-Saens' Celloconcerto no. 1
539 % FIXME take out hardcoded vars.
540 % FIXME the two loops on the `t' should be smoother (and the left one bigger).
541 % FIXME generic macros for serifs: top of the t and bottom of r
545 fet_beginchar("Trill (`tr')","trill","trill")
547 save start_nib_angle, ascender_extra, ex, hair_thick, fatness,
548 slant_angle, slant, t_fatness, r_fatness, kerning, t_overshoot,
549 uitschieter, bulb_size;
553 ascender_extra# = 1/2 ex#;
554 ascender# = ascender_extra# + ex#;
555 ex# = 1.4 staff_space#;
557 start_nib_angle = 20;
559 define_pixels(ex, ascender_extra, ascender, kerning);
561 t_overshoot = 0.03 ex;
563 t_fatness = 0.78 fatness;
564 t_width = 1.9 t_fatness;
565 r_fatness = 0.78 fatness;
566 uitschieter = 0.48 ex;
567 hair_thick = linethickness;
568 r_flare = .5 hair_thick + 0.25 r_fatness;
569 r_width = 2 r_fatness + 0.25 kerning;
574 local_copy(transform)(currenttransform);
575 currenttransform := currenttransform slanted slant shifted (- staff_space, 0) ;
579 % try to position in such a way that the center is the visual
582 x1l = 0.2 staff_space;
583 x1r - x1l = t_fatness;
584 penpos1(start_nib_wid, start_nib_angle);
587 penpos2(start_nib_wid, start_nib_angle);
589 z3l = (x2l + 0.5 t_width, - t_overshoot);
591 z4l = (x2l + t_width, 0.23 ex);
592 penpos4(whatever, 200);
593 x4l - x4r = hair_thick;
595 x3r = 0.5 [x4r, x2r];
596 % 1.7 [x3l, x3r] = x4r;
597 y3r - y3l = 0.6 t_fatness;
601 path t_p, krul_p, r_p;
603 z5 = (x2l + t_fatness/2, 2/3 ex);
604 % penpos5(hair_thick, );
606 t_p := z1r{dir (angle(z1l-z1r) + 30)} .. z1l{-dir (angle(z1r-z1l) - 45)}
608 .. tension (1 + .5 slant)
611 .. z4l{up} -- z4r{down}
613 .. tension (1.5 + .7 slant)
614 .. z2r{up} .. z1r -- cycle;
619 pickup pencircle scaled hair_thick;
621 lft x6 = x2l - uitschieter;
622 y6 = y5 ; % - 1/20 ex;
624 z7 = z5 + whatever*dir krul_ang;
627 x7 = 5/10 kerning + x5;
629 penpos7(hair_thick, up_angle + 90);
634 penpos9(r_fatness, 0);
637 y10 = -0.3 linethickness;
638 penpos10(r_fatness, 0);
646 r_p := z7l{z7-z5} .. z9l{down} --- simple_serif (z10l, z10r, -30)
648 .. z7r{z5-z7} -- cycle;
651 set_char_box(.85 staff_space# , .85 staff_space#, 0,ascender#);
654 penpos11(hair_thick, -4);
657 z13l = (x9l + r_width, y11 - linethickness );
658 penpos13(r_flare, 180);
660 z15 = z13r - ( bulb_size * r_fatness,0);
661 z14 = 0.5 [z13l, z15] - (0,bulb_size* r_fatness);
662 z16 = 0.5 [z13l, z15] + (0,bulb_size* r_fatness);
665 fill z11r{up} .. tension 0.94 .. z13r{down} -- z15{down}
666 .. tension 1.0 .. z13l{up}
667 .. z11l{down} -- cycle;
669 fill z15{up} .. tension 1.06 .. z13l{down} .. z14 .. cycle;
673 penlabels(range 1 thru 15);
679 save radius, thickness, wall;
681 radius# := .5 staff_space#;
683 define_pixels(radius);
684 set_char_box(radius#, radius#, radius#, 2/3 staff_space#);
686 thickness := 1.5 linethickness;
687 pickup pencircle scaled thickness;
697 draw z1{down} .. z2{down} .. z3{left};
698 addto currentpicture also currentpicture xscaled -1;
703 fet_beginchar("left heel", "upedalheel", "upedalheel")
708 fet_beginchar("right heel", "dpedalheel", "dpedalheel")
716 thickness := 1.5 linethickness;
717 ht# := 1.5 staff_space#;
719 define_pixels(ht,wd);
722 set_char_box(wd#, wd#, 0, ht#);
723 draw_vee (wd, ht, thickness);
726 fet_beginchar("left toe", "upedaltoe", "upedaltoe")
730 fet_beginchar("right toe", "dpedaltoe", "dpedaltoe")
735 fet_beginchar("Flageolet", "flageolet", "flageolet")
736 save height,width,thickness;
737 height#=4/15 staffsize#;
739 thickness#=blot_diameter#;
740 define_pixels(height,width,thickness);
741 set_char_box(width#/2,width#/2,height#/2,height#/2);
743 pickup pencircle scaled thickness;
747 rt x4 - lft x2 =width;
754 draw z1..z2..z3..z4..cycle;
759 %TODO: ARGRGHGH code dup.
763 fet_beginchar("Segno", "segno", "segno")
764 save thin, thick, ball_diam, darkness, pointheight;
765 save wd, ht, thick_nibangle, ball_nib_thick;
769 ht# = 3 staff_space#;
770 wd# = 2 staff_space#;
771 darkness = .08 staff_space + 0.4 linethickness;
773 set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);
778 ball_nib_thick = 2.7 darkness;
779 ball_diam = ball_nib_thick + (w - ball_nib_thick) / 10;
780 pointheight = 2 linethickness;
790 penpos1(thick, 2 thick_nibangle);
791 penpos2(thick, thick_nibangle);
793 penpos4(ball_nib_thick, 180-thick_nibangle);
796 swoosh := z1l{curl 0} .. z2l .. z3l{right} .. {down}z4l
797 -- z4r .. z3r{left} .. z2r{down} ;
798 fill swoosh .. (swoosh scaled -1) .. cycle;
802 x5r = x4l - ball_diam /2;
805 penpos5(1.6 ball_diam/2, 100);
806 penpos6(ball_diam/2, 240);
808 ploop := z4l{down} .. z5l .. z6l -- cycle;
810 fill ploop scaled -1;
817 filldraw z7l--z8l{right}--z8r{down}--z7r{right}--cycle;
818 pickup pencircle scaled 2 thin;
819 draw (-x2r,pointheight);
820 draw (x2r,-pointheight);
823 fet_beginchar("Coda", "coda", "coda")
824 save stickout, thin, thick, codawidth, codaheight;
826 stickout# = 0.35 staff_space#;
827 codawidth# = 2/3 staff_space#;
828 codaheight# = 1 staff_space#;
830 set_char_box(codawidth#+stickout#, codawidth#+stickout#,
831 codaheight#+stickout#, codaheight#+stickout#);
833 define_pixels(codawidth, codaheight);
834 thin = 1.2 linethickness;
835 0.1 (codaheight - 2 thin) = (codawidth - 2 thick);
848 halfcoda := z1l{up} .. z2l{right} .. z3l{down} --
849 z3r{up} .. z2r{left} .. z1r{down} .. cycle;
851 fill (halfcoda scaled -1);
853 draw_gridline((0,-h),(0,h),thin);
854 draw_gridline((-w,0),(w,0),thin);
858 fet_beginchar("Varied Coda", "varcoda", "varcoda")
859 save thin, thick, codawidth, codaheight;
860 thin# = 1.2 linethickness#;
861 thick# = 1.0 linethickness# + 0.25 staff_space#;
862 codawidth# = 2/3 staff_space#;
863 codaheight# = 1 staff_space#;
864 define_pixels(thin, thick, codawidth, codaheight);
866 set_char_box(codawidth#+thick#, codawidth#+thick#,
867 codaheight#+thick#, codaheight#+thick#);
873 draw_rounded_block(z1, z2, blot_diameter);
879 draw_rounded_block(z3, z4, blot_diameter);
882 addto currentpicture also currentpicture xscaled -1;
883 addto currentpicture also currentpicture yscaled -1;
885 draw_gridline((0,-h),(0,h),thin);
886 draw_gridline((-w,0),(w,0),thin);
890 save alpha, thick, thin, ht;
892 thin# = 1.2 linethickness#;
893 thick# = 3 linethickness#;
894 ht# = .6staff_space#;
895 define_pixels(thin, thick,ht);
896 set_char_box(0, .5staff_space#, ht#, ht#);
898 penpos1(thick, alpha);
899 penpos2(thick, alpha+90);
900 penpos3(thin, 180-alpha);
901 penpos4(thin, 90-alpha);
908 fill z1l{dir (alpha+90)} .. z2r{dir alpha} .. z1r{dir (alpha-90)} ..
909 z3l{dir (270-alpha)} .. z4l{dir (alpha+180)} ..
910 z3r{dir (90-alpha)} .. cycle;
913 fet_beginchar("Right Comma","rcomma","rcomma");
917 fet_beginchar("Left Comma","lcomma","lcomma");
923 save thick, thin, ht, wd, alpha;
925 thin# = 1.2 linethickness#;
926 thick# = 3 linethickness#;
927 ht# = .6 staff_space#;
928 wd# = .25 staff_space#;
929 define_pixels(thin, thick, ht, alpha);
930 set_char_box(wd#, wd#, ht#, ht#);
933 draw_brush(z1, thin, z2, thick);
936 fet_beginchar("Right Varied Comma","rvarcomma","rvarcomma");
940 fet_beginchar("Left Varied Comma","lvarcomma","lvarcomma");
945 thick#:=1/24designsize;
946 define_blacker_pixels(thick);
948 rthin:= 0.075 *staff_space + 0.5 linethickness;
949 rthick:=2thick+rthin;
954 save ne,nw,se,sw; pair ne,nw,se,sw;
957 se=dir alpha; nw=dir (alpha+180);
958 ne=dir (alpha+90); sw=dir (alpha-90);
959 penpos1(rthin,alpha+90);
960 penpos2(5/4rthick,alpha);
961 penpos4(5/4rthick,alpha);
962 penpos5(rthin,alpha+90);
963 penpos3(3/4rthick,alpha);
965 z1=(width/2, height) - overshoot*se;
966 z2=2[z4,(width/2,height/2)];
971 z5=2[z1,(width/2,height/2)];
973 z7=z4l+1/2rthin*sw+1/2rthin*se;
974 z8=2[z6,(width/2,height/2)];
975 z9=2[z7,(width/2,height/2)];
977 fill z1l{se}..{se}z6..z3l..z7{se}..{se}z5l..z5r{nw}..{nw}z8..z3r..z9{nw}..{nw}z1r.. cycle;
978 penlabels(1,2,3,4,5,6,7,8,9);
981 fet_beginchar("Arpeggio","arpeggio","arpeggio");
982 %draw_staff (-2, 2, 0.0);
983 save height, overshoot, width;
984 height# = staff_space#;
986 overshoot# = 0.25 staff_space#;
987 define_pixels (height,overshoot,width);
988 set_char_box(0, width#, 0, height#);
992 % Extendable Trill symbol.
994 % Rename me to Trill, rename Trill to Tr?
995 fet_beginchar("Trill_element","trill_element","trillelement");
996 save height, overshoot;
997 height# = staff_space#;
999 overshoot# = 0.25 staff_space#;
1000 define_pixels (height,overshoot,width);
1001 set_char_box(0, height#, 0, width#);
1003 currentpicture := currentpicture shifted -(width/2, height/2);
1004 currentpicture := currentpicture rotated 90;
1005 currentpicture := currentpicture shifted (height/2, width/2);
1011 % Arpeggio arrow by Chris Jackson <chris@fluffhouse.org.uk>
1014 def draw_arpeggio_arrow =
1015 save thinness, height, width, overshoot, se, sw, ne, nw, alpha;
1016 pair ne, nw, se, sw;
1017 height# = staff_space#;
1018 width# = 0.8height#;
1019 overshoot# = 0.25 staff_space#;
1020 define_pixels (height,overshoot,width);
1021 set_char_box(0, width#, 0, height#);
1023 nw = dir (alpha+180);
1024 sw = dir (alpha-90); se = dir alpha;
1026 penpos1(rthin, alpha+90);
1027 penpos2(5/4 rthick, alpha);
1028 penpos3(5/4 rthick, 0);
1030 z1 = (width/2, height) - overshoot*se; % numbering is consistent with the arpeggio symbol
1031 z2 = 2[z4,(width/2,height/2)];
1032 z3 = (0.5 width, 0.5 height);
1033 z4 = (0.25 staff_space, rthin);
1034 z6 = z2l + 1/2rthin*sw;
1035 z9 = (width/2, height) + overshoot*se;
1036 fill z1l {se}..{se} z6 .. z3l .. z3r.. z9{nw} ..{nw} z1r.. cycle;
1038 bot z10 = ( 0.5w, 0 );
1039 lft z11 = (-0.3w, 0.8h);
1040 rt z12 = ( 1.3w, 0.8h);
1041 pickup pencircle scaled 0.5 rthin;
1042 filldraw z3 -- z12 {dir -130} .. {dir -110} z10 {dir 110} .. {dir 130} z11 -- cycle;
1045 fet_beginchar("Arpeggio arrow down", "arpeggio.arrow.M1", "arpeggioarrowdown");
1046 draw_arpeggio_arrow;
1050 fet_beginchar("Arpeggio arrow up", "arpeggio.arrow.1", "arpeggioarrowup");
1051 draw_arpeggio_arrow;
1052 currentpicture := currentpicture scaled -1 shifted (0.8 staff_space, staff_space);
1063 % I actually have no clue how they should look, so we use a slightly curvy
1064 % and tapered shape.
1066 fet_beginchar("Caesura", "caesura", "caesura");
1067 save slant, space_between, clearance;
1069 save botthick, topthick;
1074 botthick = 1.5 linethickness;
1075 topthick = 2.5 linethickness;
1076 pickup pencircle scaled botthick;
1080 space_between# = 0.6 staff_space#;
1081 clearance# = 0.2 staff_space#;
1082 height# = 1.2 staff_space#;
1084 set_char_box(0, 2.0 staff_space#, staff_space# - clearance#, height#);
1085 define_pixels (space_between, clearance, height);
1091 x2 = (y2 - y1) / slant;
1095 alpha = angle (z2 - z1);
1096 penpos1 (botthick, alpha - krom);
1097 penpos3 (botthick, alpha - krom + 90);
1099 penpos2 (topthick, alpha + krom );
1100 penpos4 (topthick, alpha + krom + 90);
1102 penlabels (1,2,3,4);
1104 p := z3r{(z1r - z1l)} .. z4r{z2r-z2l} .. z2r{z4l-z4r} .. z4l{z2l-z2r} .. z3l{z1l-z1r} .. z1l{z3r-z3l} .. cycle;
1106 fill p shifted (space_between , 0);
1111 fet_endgroup("scripts");