]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/feta-eindelijk.mf
release: 1.3.24
[lilypond.git] / mf / feta-eindelijk.mf
index d6d7cfcf5448b752cb7d9d99b477cb7c350a9a9b..c7e83735513019d5839ab2e486337a52ac251ae3 100644 (file)
@@ -1,8 +1,10 @@
-% eindelijk.mf
-% LilyPond's own rest(s)
-
-% todo breve/longa rests
-
+% feta-eindelijk.mf -- implement rest symbols -*-Fundamental-*-
+%
+% part of LilyPond's pretty-but-neat music font
+%
+% source file of the Feta (not the Font-En-Tja) music font
+% 
+% (c) 1997, 1998 Jan Nieuwenhuizen <janneke@gnu.org>
 
 fet_begingroup("rests");
 
@@ -11,7 +13,7 @@ begingroup
 thick#:=1/16designsize;
 define_blacker_pixels(thick);
 
-rthin:=1/8*interline;
+rthin:=1/8*staff_space;
 % rthick:=2rthin;
 rthick:=2thick+rthin;
 
@@ -23,37 +25,27 @@ enddef;
 %
 save stem, ball_crook_stem, ball_crook_balldiam, flare;
 
+% stem#:=1/8*staff_space#;
+stem# = 1/5staff_space#;
+% flare# = 2/3staff_space#;
+flare# = 2/3staff_space# - 1/8stafflinethickness#;
+
 define_pixels(stem,flare);
-% stem#:=1/8*interline#;
-stem# = 1/5interline#;
+
 ball_crook_stem = stem;
 ball_crook_balldiam =flare;
-flare# = 2/3interline#;
+
 
 save block_rest_y, block_rest_x;
 
-block_rest_y# = 5/8 interline#;
-block_rest_x# = 3/2 interline#;
+block_rest_y# = 5/8 staff_space#;
+block_rest_x# = 3/2 staff_space#;
 
 define_pixels(block_rest_y, block_rest_x);
 
-def block_rest=
-       pickup pencircle scaled blot_diameter;
-
-       bot y1 = 0;
-       top y2 = block_rest_y;
-       y3 = y2;
-       y4 = y1;
-
-       rt x1 = block_rest_x;
-       x2 = x1;
-       lft x3 = 0;
-       x4 = x3;
-       save p;
-       path p;
-       p:=z1 -- z2 -- z3 -- z4 -- cycle;
-       draw_rounded_path(p, blot_diameter);
-enddef;
+def block_rest =
+       draw_block ((0,0), (block_rest_x, block_rest_y));
+       enddef;
 
 fet_beginchar( "whole rest", "0", "wholerest");
        set_char_box(0, block_rest_x#,
@@ -72,33 +64,77 @@ fet_endchar;
 % should use ledgerline thickness?
 %
 fet_beginchar( "whole rest (outside staff)", "0o", "outsidewholerest");
-       set_char_box(block_rest_y#, block_rest_x# + block_rest_y#, 
+       set_char_box(0, block_rest_x#,
                block_rest_y#, ledgerlinethickness#/2);
        block_rest;
        currentpicture := currentpicture shifted (0, - block_rest_y);
        pickup pencircle scaled ledgerlinethickness;
 
        y5 = y6 = 0;
-       lft x5 = - b
-       rt x6 = w;
+       lft x5 = - b - block_rest_y;
+       rt x6 = w + block_rest_y;
        draw z5 .. z6;
 fet_endchar;
 
 fet_beginchar("half rest (outside staff)", "1o", "outsidehalfrest");
-       set_char_box(block_rest_y#, block_rest_x#+ block_rest_y#, 
+       set_char_box(0, block_rest_x#,
                ledgerlinethickness#/2, block_rest_y#);
        block_rest;
        pickup pencircle scaled ledgerlinethickness;
        y5 = y6 = 0;
-       lft x5 = - b; 
-       rt x6 = w;
+       lft x5 = - b - block_rest_y ;  
+       rt x6 = w + block_rest_y;
        draw z5 .. z6;
 fet_endchar;
 
+
+save breve_rest_y, breve_rest_x;
+
+breve_rest_y# =  staff_space#;
+breve_rest_x# = 3/5 staff_space#;
+multi_rest_x# = 4 staff_space#;
+multi_beam_height# = 1/3 staff_space#;
+
+define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_beam_height);
+
+fet_beginchar("breve rest", "-1", "breverest");
+       set_char_box(0, breve_rest_x#, 0, breve_rest_y#);
+       draw_block ((0,0), (breve_rest_x, breve_rest_y));
+fet_endchar;
+
+fet_beginchar("longa rest", "-2", "longarest");
+       set_char_box(0, breve_rest_x#, breve_rest_y#, breve_rest_y#);
+       draw_block ((0,-breve_rest_y), (breve_rest_x, breve_rest_y));
+fet_endchar;
+
+tracingvariables := 1;
+
+fet_beginchar("multi rest", "-4", "multirest");
+       set_char_box(multi_rest_x#, multi_rest_x#,
+                    breve_rest_y#, breve_rest_y#);
+       draw_block ((- b, - multi_beam_height),
+                  (w, multi_beam_height));
+       draw_block ((- b,-breve_rest_y),
+                  (rthin - b, breve_rest_y));
+       draw_block ((w - rthin,-breve_rest_y),
+                  (w, breve_rest_y));
+fet_endchar;
+
 fet_beginchar("Quarter rest","2","quartrest");
-       save alpha;
+%      draw_staff (-2, 2, 0.0);        
+       save alpha, yshift, height;
        alpha:=-50;
+       yshift# = -1.25 staff_space#;
+       height# = 2.8125 staff_space#;
+       define_pixels (yshift, height);
+
+       
+       set_char_box(0, 27/25staff_space#,
+         -yshift#,
+         yshift# + height#);
+       
        save ne,nw,se,sw; pair ne,nw,se,sw;
+       
        se=dir alpha; nw=dir (alpha+180);
        ne=dir (alpha+90); sw=dir (alpha-90);
        penpos1(rthin,alpha+90);
@@ -117,18 +153,26 @@ fet_beginchar("Quarter rest","2","quartrest");
 %      z13=z2r+1/2rthin*ne;
        z13=z2r+1/2rthin*ne+1/2rthin*nw;
 
-       y1l=7/2interline; x1l=1/3interline;
-       z2r=z1+interline*se;
+       y1r = h;
+       x1l=1/3staff_space;
+       z2r=z1+staff_space*se;
        z3=1/2[z2,z4];
-       x4=3/8interline; y4=2interline;
-       z5=z4l+1.3interline*se;
-       x6l=x4l; y6l=y4r;
-       x7=2/5interline; y7=3/4interline;
+       x4=3/8staff_space;
+       y4= 0;
+       z5=z4l+1.3staff_space*se;
+       x6l=x4l;
+       y6l=y4r;
+       x7=2/5staff_space;
+       y7= -d;
+       
        fill z1l{se}..{se}z10..z3l..z11{se}..{se}z5l..z5r{nw}..{nw}z12..z3r..z13{nw}..{nw}z1r.. cycle;
        fill z5r{nw}..tension1.4..z6l..tension1.4..{se}z7l..z7r{nw}..tension1.4..z6r..tension1.4..{se}z5l..cycle;
        penlabels(1,2,3,4,5,6,7);
        penlabels(10,11,12,13);
-       set_char_box(0, 27/25interline#, -3/4 interline#, 18/5interline#);
+       
+%        3/4 staff_space# + yshift#,
+%        18/5staff_space# + yshift#)
+
        fet_endchar;
 
 def rest_crook(expr a, w) =
@@ -136,117 +180,223 @@ def rest_crook(expr a, w) =
 enddef;
 
 fet_beginchar("8th rest","3","eighthrest");
-       set_char_box(0, 4/3interline#,-interline#, 8/3interline#+2stafflinethickness#);
-       save x,y, ht;
-       ht = h + d;
-       x1=w-stem/6; y1=ht-flare/4;
+%      draw_staff (-2, 2, 0.0);
+       save yshift, ballcorrection;
+       ballcorrection = 0.005 staff_space;
+
+       yshift# := -1.0 staff_space#;
+       define_pixels(yshift);
+
+
+       set_char_box(0, 4/3staff_space#, -yshift#, yshift# +
+                       5/3staff_space#+7/4stafflinethickness#);
+
+       %
+       % The curve is like a valley causing less space between
+       % the curve and the lower staff line. Correct for this.
+       % 
+       save x,y;
+
+       x1=w-stem/6;
+
+       y1 = yshift + 1.5 staff_space + flare/4 + ballcorrection; 
        rest_crook (z1,w-stem/6);
        z2-z1=whatever*dir70;
-       y2=stem/2;
+       y2= yshift + stem/2;
        brush(z1,2/3stem,z2,stem);
-       % ugh
-       currentpicture:=currentpicture shifted (0,interline);
-       fet_endchar;
 
-def tand(expr alpha) = 
-       (sind alpha/cosd alpha);
-       enddef;
+       fet_endchar;
 
 fet_beginchar("16th rest","4","sixteenthrest");
-       save alpha,cw,h,w;
+%      draw_staff (-2, 2, 0.0);
+       save yshift, ballcorrection;
+       ballcorrection = 0.005 staff_space;
+
+       yshift# := - 2 staff_space#;
+       define_pixels(yshift);
+
+       save alpha,cw,h,w, height;
        alpha=74;
-       cw#=7/6interline#;
-       h#=5/3interline#+interline#+2stafflinethickness#;
-       w#=cw#+(h#-3/2interline#)/tand(alpha);
-       set_char_box(0,w#,0,h#);
+       cw#=7/6staff_space#;
+       height# =  5/3staff_space#+staff_space#+7/4stafflinethickness#;
+       set_char_box(0, cw#+(height#-3/2staff_space#)/tand(alpha),
+               -yshift#, height# + yshift#);
+
        define_pixels(cw);
        save x,y;
-       x1=w-stem/6; y1=h-flare/4;
+       x1=w-stem/6;
+       y1 = yshift + 2.5 staff_space + flare/4 + ballcorrection;
+
        z2-z1=whatever*dir alpha;
-       y2=stem/2;
+       y2= yshift + stem/2;
        brush(z1,2/3stem,z2,stem);
        rest_crook (z1,cw);
        z3-z1=whatever*dir alpha;
-       y3=y1-interline;
+       y3=y1-staff_space;
        rest_crook (z3,cw);
        penlabels(1,2);
        fet_endchar;
 
 fet_beginchar("32th rest","5","thirtysecondrest");
-       save alpha,cw,h,w;
+%      draw_staff (-2, 2, 0.0);
+       save yshift, ballcorrection;
+       ballcorrection = 0.005 staff_space;
+
+       yshift# := -2 staff_space#;
+       define_pixels(yshift);
+
+       save alpha,cw,h;
        alpha=76;
-       cw#=7/6interline#;
-       h#=5/3interline#+2interline#+2stafflinethickness#;
-       w#=cw#+(h#-3/2interline#)/tand(alpha);
-       set_char_box(0,w#,0,h#);
+       cw#=7/6staff_space#;
+       h#=5/3staff_space#+2staff_space#+7/4stafflinethickness#;
+
+       set_char_box(0, cw#+(h#-3/2staff_space#)/tand(alpha),
+               -yshift#,yshift# +h#);
        define_pixels(cw);
        save x,y;
-       x1=w-stem/6; y1=h-flare/4;
+       x1=w-stem/6;
+       y1 = yshift + 3.5 staff_space + flare/4 + ballcorrection;
+
        z2-z1=whatever*dir alpha;
-       y2=stem/2;
+       y2=stem/2 + yshift;
        brush(z1,2/3stem,z2,stem);
        rest_crook (z1,cw);
        z3-z1=whatever*dir alpha;
-       y3=y1-interline;
+       y3=y1-staff_space;
        rest_crook (z3,cw);
        z4-z1=whatever*dir alpha;
-       y4=y1-2interline;
+       y4=y1-2staff_space;
        rest_crook (z4,cw);
        fet_endchar;
 
 fet_beginchar("64th rest","6","sixtyfourthrest");
+%      draw_staff (-2, 2, 0.0);
+       save yshift, ballcorrection;
+       ballcorrection = 0.005 staff_space;
+
+       yshift# := -3 staff_space#;
+       define_pixels(yshift);
+
        save alpha,cw,h,w;
        alpha=78;
-       cw#=7/6interline#;
-       h#=5/3interline#+3interline#+2stafflinethickness#;
-       w#=cw#+(h#-3/2interline#)/tand(alpha);
-       set_char_box(0,w#,0,h#);
+       cw#=7/6staff_space#;
+       h#=5/3staff_space#+3staff_space#+7/4stafflinethickness#;
+       w#=cw#+(h#-3/2staff_space#)/tand(alpha);
+       set_char_box(0,w#,-yshift# ,yshift# + h#);
+
        define_pixels(cw);
        save x,y;
-       x1=w-stem/6; y1=h-flare/4;
+       x1=w-stem/6;
+
+       y1 = yshift + 4.5 staff_space + flare/4 + ballcorrection;
+
        z2-z1=whatever*dir alpha;
-       y2=stem/2;
+       y2=stem/2 + yshift;
        brush (z1,2/3stem,z2,stem);
        rest_crook (z1,cw);
        z3-z1=whatever*dir alpha;
-       y3=y1-interline;
+       y3=y1-staff_space;
        rest_crook (z3,cw);
        z4-z1=whatever*dir alpha;
-       y4=y1-2interline;
+       y4=y1-2staff_space;
        rest_crook (z4,cw);
        z5-z1=whatever*dir alpha;
-       y5=y1-3interline;
+       y5=y1-3staff_space;
        rest_crook (z5,cw);
+
        fet_endchar;
 
 fet_beginchar("128th rest","7","hundredtwentyeighthrest"); 
+%      draw_staff (-2, 2, 0.0);
+       save yshift, ballcorrection;
+       ballcorrection = 0.005 staff_space;
+
+       yshift# := -3 staff_space#;
+       define_pixels(yshift);
        save alpha,cw,h,w;
        alpha=78;
-       cw#=7/6interline#;
-       h#=5/3interline#+4interline#+2stafflinethickness#;
-       w#=cw#+(h#-3/2interline#)/tand(alpha);
-       set_char_box(0,w#,0,h#);
+       cw#=7/6staff_space#;
+       h#=5/3staff_space#+4staff_space#+7/4stafflinethickness#;
+       w#=cw#+(h#-3/2staff_space#)/tand(alpha);
+       set_char_box(0,w#, -yshift#,yshift#  + h#);
        define_pixels(cw);
        save x,y;
-       x1=w-stem/6; y1=h-flare/4;
+       x1=w-stem/6;
+       y1 = yshift + 5.5 staff_space + flare/4 + ballcorrection;
+
        z2-z1=whatever*dir alpha;
-       y2=stem/2;
+       y2=stem/2 + yshift;
        brush (z1,2/3stem,z2,stem);
        rest_crook (z1,cw);
        z3-z1=whatever*dir alpha;
-       y3=y1-interline;
+       y3=y1-staff_space;
        rest_crook (z3,cw);
        z4-z1=whatever*dir alpha;
-       y4=y1-2interline;
+       y4=y1-2staff_space;
        rest_crook (z4,cw);
        z5-z1=whatever*dir alpha;
-       y5=y1-3interline;
+       y5=y1-3staff_space;
        rest_crook (z5,cw);
        z6-z1=whatever*dir alpha;
-       y6=y1-4interline;
+       y6=y1-4staff_space;
        rest_crook (z6,cw);
+       
        fet_endchar;
 
 endgroup;
-fet_endgroup("rests");
 
+% Rest symbols for mensural notation:
+
+mensrestsize# = .8staff_space#;
+
+fet_beginchar("Mensural 4th rest","2mensural","minimarest")
+       set_char_box(0,mensrestsize#,0,mensrestsize#);
+        pickup pencircle scaled 2 stafflinethickness;
+       lft x1 = 0;
+       bot y1 = 0;
+       lft x2 = 0;
+       top y2 = h;
+       rt x3 = w;
+       bot y3 = h/2;
+       draw z1 .. z2;
+       draw z2 .. z3;
+fet_endchar
+
+fet_beginchar("Mensural 8th rest","3mensural","fusarest")
+       set_char_box(0,mensrestsize#,0,mensrestsize#);
+        pickup pencircle scaled 2 stafflinethickness;
+       rt x1 = w;
+       bot y1 = 0;
+       rt x2 = w;
+       top y2 = h;
+       lft x3 = 0;
+       bot y3 = h/2;
+       draw z1 .. z2;
+       draw z2 .. z3;
+fet_endchar
+
+fet_beginchar("Mensural 16th rest","4mensural","semifusarest")
+       set_char_box(0,mensrestsize#,0,staff_space#);
+        pickup pencircle scaled 2 stafflinethickness;
+       rt x1 = w;
+       bot y1 = 0;
+       rt x2 = w;
+       top y2 = h;
+
+       draw z1 .. z2;
+
+        pickup pencircle scaled 2 stafflinethickness;
+       rt x3 = w;
+       top y3 = h;
+       lft x4 = 0;
+       bot y4 = h/2;
+       rt x5 = w;
+       top y5 = 5/8h;
+       lft x6 = 0;
+       bot y6 = h/8;
+
+       draw z3 .. z4;
+       draw z5 .. z6;
+fet_endchar
+
+fet_endgroup("rests")