]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/feta-toevallig.mf
2003 -> 2004
[lilypond.git] / mf / feta-toevallig.mf
index 117d6330c56b016c9b63edfc8d47ef2c6bde819e..8c40d83485fe877dc5fff74a7a1e2c8807c52692 100644 (file)
@@ -3,7 +3,7 @@
 % 
 % source file of the Feta (Font-En-Tja) music font
 % 
-% (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+% (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 % 
 
 
@@ -26,31 +26,26 @@ fet_begingroup("accidentals");
 % a square pen).  [Wanske] does not mention this, so we'll just ignore 
 % this fact
 %
-fet_beginchar("Sharp" , "1", "sharp");
-       set_char_box(0, 1.1 staff_space#, 1.5 staff_space#, 
-               1.5 staff_space#);
 
+def draw_meta_sharp (expr width) =
        save interbeam, interstem, beamheight, beamwidth, 
                stemwidth, beamslope;
+       save spanwidth, spanheight;
+       
+       save center;
+       pair center;
 
        interbeam := 1.05 staff_space;
-       interstem := 7/16 ;
-       beamheight := 4 stafflinethickness;
-       beamwidth := w;
-       stemwidth := 1.5 stafflinethickness;
+       beamheight := 0.3 staff_space + stafflinethickness;
+       beamwidth := width;
+       stemwidth := 1.0 stafflinethickness + .05 staff_space;
        roundness := 2 blot_diameter;
 
-       pair center;
        center := (.5 w, 0);
        
        roundness + 2 spanwidth = beamwidth;
        roundness + 2 spanheight = beamheight;
 
-       2 horizontal_protrusion  + interstem * beamwidth + stemwidth
-               = beamwidth;
-       
-% wanske: whole beamheight; or ca 18 degrees
-%      z2 - z1 = (beamwidth - roundness, beamheight/2);
        z2 - z1 = (beamwidth - roundness, beamheight);
        z1 + z2 = 2*center;
        beamslope = (y2-y1)/(x2-x1);
@@ -58,7 +53,6 @@ fet_beginchar("Sharp" , "1", "sharp");
        pair hspan, vspan;
        hspan = (spanwidth, beamslope * spanwidth);
        vspan = (0, spanheight);
-
        
        path beam;
        beam := (hspan + vspan -- -hspan 
@@ -71,25 +65,63 @@ fet_beginchar("Sharp" , "1", "sharp");
        pickup pencircle scaled stemwidth;
        x3 = x4 = xpart center;
 
-       numeric xs;
-       xs := interstem* beamwidth / 2;
 
-       (bot y3) + -xs * beamslope = -1.5 staff_space + ypart center;
-       top y4  + xs * beamslope = 1.5 staff_space + ypart center;
+       enddef;
+
+fet_beginchar("Sharp" , "2", "sharp");
+       set_char_box(0, 1.1 staff_space#, 1.5 staff_space#, 
+               1.5 staff_space#);
+       draw_meta_sharp (w);
+
+       save stemx;
+       stemx := 7 / 32 * w;
+
+       (bot y3) + - stemx * beamslope = -1.5 staff_space + ypart center;
+       top y4  + stemx * beamslope = 1.5 staff_space + ypart center;
 
-       draw_gridline (z3-(xs,xs* beamslope),z4-(xs,xs*beamslope),stemwidth);
-       addto currentpicture also currentpicture rotated 180 shifted (w,0);
        labels(1,2,3,4);
 
+       draw_gridline (z3-(stemx,stemx* beamslope),z4-(stemx, stemx*beamslope), stemwidth);
+       addto currentpicture also currentpicture rotated 180 shifted (w,0);
 
-% to check that it doesn't overshoot staffline.
-%
-%      pickup pencircle scaled stafflinethickness;
-%      draw (0, 1.5 staff_space ) ..  (1 staff_space, 1.5 staff_space);
+       fet_endchar;
+
+fet_beginchar("1/2 Sharp" , "1", "semisharp");
+       set_char_box(0, 0.7 staff_space#, 1.5 staff_space#, 
+               1.5 staff_space#);
+
+       draw_meta_sharp (w);
+       stemx := 7 / 32 * w;
+
+       (bot y3) + - stemx * beamslope = -1.5 staff_space + ypart center;
+       top y4  + stemx * beamslope = 1.5 staff_space + ypart center;
+
+       labels(1,2,3,4);
+
+       draw_gridline (z3, z4, stemwidth);
+       addto currentpicture also currentpicture rotated 180 shifted (w,0);
 
        fet_endchar;
 
 
+fet_beginchar("3/4 Sharp" , "3", "threequartersharp");
+       set_char_box(0, 1.6 staff_space#, 1.5 staff_space#, 
+               1.5 staff_space#);
+
+       draw_meta_sharp (w);
+       stemx := 9 / 32 * w;
+
+       (bot y3) + - stemx * beamslope = -1.5 staff_space + ypart center;
+       top y4  + stemx * beamslope = 1.5 staff_space + ypart center;
+
+       labels(1,2,3,4);
+
+       draw_gridline (z3-(stemx,stemx* beamslope),z4-(stemx, stemx*beamslope), stemwidth);
+       draw_gridline (z3, z4, stemwidth);
+       addto currentpicture also currentpicture rotated 180 shifted (w,0);
+
+       fet_endchar;
+
 %
 % The stems of the natural are brushed (at least, in Barenreiter SCS )
 %
@@ -101,18 +133,18 @@ fet_beginchar( "Natural", "0", "natural")
        stemwidth;
        save top_stem_thick;
 
-       beamheight# = 4.0 stafflinethickness#;
+       beamheight# = 0.35 staff_space# + .5 stafflinethickness#;
        height# = 1.5 staff_space#;
        set_char_box(0, 2/3 staff_space#, height#, height#);
 
        define_pixels(height);
        define_blacker_pixels(beamheight);
 
-       % perhaps we should have a lowres fix?
-       top_stem_thick = 1.9 stafflinethickness;
+       top_stem_thick = round (1 stafflinethickness + .09staff_space ) + 0.4;
+       stemwidth = 0.08 staff_space + .5 stafflinethickness;
+       
 
        interstem + stemwidth =  w;
-       stemwidth = 1.3 stafflinethickness;
 
        z2 -z1 = (interstem, slope * interstem);
        xpart .5 [z2,z1] = xcenter ;
@@ -189,17 +221,15 @@ def draw_meta_flat(expr xcenter, w, crook_fatness) =
        else:
                smaller_hole = 0.0 stafflinethickness;
        fi
-       crook_thinness = 1.3 stafflinethickness;
-       top_crook_thinness = 1.65 stafflinethickness;
+       crook_thinness = .7 stafflinethickness + .06 staff_space;
+       top_crook_thinness = 1 stafflinethickness + .065 staff_space ;
+
+       % this is a somewhat heuristic.  We should  probably make it
+       % straight for low resolution (300 dpi and less).
+       top_stem_thick = round (0.1 staff_space + 1.2 stafflinethickness) + 0.74;
 
-       % actually, this used to be 2.2 stafflinethickness,
-       % that looks very awful in 600dpi.
-       % TODO: a better (resolution indepedendent) fix  
-       
-       top_stem_thick# = 2.3 stafflinethickness#;
-       define_blacker_pixels (top_stem_thick);
        bottom_overshoot = stafflinethickness;
-       bottom_stem_thick = 1.2 stafflinethickness;
+       bottom_stem_thick = 0.06 staff_space +  0.6 stafflinethickness;
 
        z1 = (0, 2 staff_space) + center - (0, stafflinethickness/2
                + clearing);
@@ -224,12 +254,12 @@ def draw_meta_flat(expr xcenter, w, crook_fatness) =
 
        y4l - y4r =  top_crook_thinness ;
 
-       y5r = .20 staff_space + ypart center;
+       y5r = .15 staff_space + ypart center;
        x5l = w + xpart center;
        y4 = ypart center + staff_space/2;
        x4r = .45 [x5r, x3r];
 
-       penpos5(crook_fatness, -185);
+       penpos5(crook_fatness, -175);
 
        save bot_crook_dir ;
        pair bot_crook_dir ;
@@ -245,10 +275,9 @@ def draw_meta_flat(expr xcenter, w, crook_fatness) =
 
        y10 = -1/10 staff_space;
 %      draw_staff (-2, 2, 0.5);
-       draw_staff (-2, 2, 0.0);
+%      draw_staff (-2, 2, 0.0);
 
        unfill z3r{z3r-z10} .. z4r{right} .. z5r{down}
-
                ..  z7{- bot_crook_dir}
                & z7 % .. tension 1.3
                .. z10{z3r-z10}
@@ -268,13 +297,19 @@ enddef;
 %
 % unfortunately, 600dpi is not enough to show the brush of the stem.
 %
-fet_beginchar("Flat", "-1", "flat")
+fet_beginchar("Flat", "-2", "flat")
        set_char_box(1.2 stafflinethickness#, .8 staff_space#, 0.6 staff_space#, 1.9 staff_space#);
        draw_meta_flat(0, w, 0.31 staff_space);
        fet_endchar;
 
+fet_beginchar("Semi flat", "-1", "semiflat")
+       set_char_box(1.2 stafflinethickness#, .8 staff_space#, 0.6 staff_space#, 1.9 staff_space#);
+       draw_meta_flat(0, w, 0.31 staff_space);
+       currentpicture := currentpicture xscaled -1 shifted (w - b, 0);  
+       fet_endchar;
 
-fet_beginchar("Double Flat", "-2", "flatflat")
+
+fet_beginchar("Double Flat", "-4", "flatflat")
        save left_wid, overlap, right_wid;
        left_wid = .7;
        right_wid = .8;
@@ -285,12 +320,32 @@ fet_beginchar("Double Flat", "-2", "flatflat")
                right_wid *staff_space, 0.33 staff_space);
        fet_endchar;
 
-fet_beginchar("Double Sharp", "2", "sharpsharp")
+fet_beginchar("3/4 Flat", "-3", "threeqflat")
+       save left_wid, overlap, right_wid;
+       left_wid = .7;
+       right_wid = .8;
+       overlap = .05;
+       set_char_box(1.2 stafflinethickness#, (left_wid + right_wid -overlap) *staff_space#, .6 staff_space#, 1.9 staff_space#);
+       draw_meta_flat(0, left_wid*  staff_space, 1/3 staff_space);
+       draw_meta_flat(round ((left_wid - overlap) *staff_space),
+               right_wid *staff_space, 0.33 staff_space);
+
+       %% maybe we should clip part of the stems?
+       %% or make the 1st flat smaller?
+       %% or reverse it? 
+       pickup pencircle scaled 2 stafflinethickness;
+       z12 = ( - .25 w - b, .55 staff_space);
+       z13 = (  .75 w , 1.45 staff_space);
+       draw z12 -- z13;
+       fet_endchar;
+
+
+fet_beginchar("Double Sharp", "4", "sharpsharp")
        set_char_box(0, staff_space#, .5 staff_space#, .5 staff_space#);
        save klaverblad, klaversteel;
 
        klaversteel = 1/15 staff_space;
-       klaverblad = .35 staff_space;
+       klaverblad = .40 staff_space - .5 stafflinethickness;
 
        z1 = (klaversteel, 0);
        z2 = (w/2 - klaverblad / 10, h - klaverblad);
@@ -299,7 +354,7 @@ fet_beginchar("Double Sharp", "2", "sharpsharp")
        z5 = z1 reflectedabout((0,0), (1,1));
 
        labels(1,2,3,4,5);
-       pickup pencircle scaled 1/20 staff_space;
+       pickup pencircle scaled blot_diameter;
        filldraw  
                z1{dir 45} .. {right}z2 -- z3 -- 
                z4{down} .. {dir 225}z5 .. cycle;
@@ -327,7 +382,7 @@ def draw_paren =
        z3 = (leftindent,-d);
 
        penpos1(stafflinethickness, 35);
-       penpos2(2 stafflinethickness, 0);
+       penpos2(.1 staff_space + stafflinethickness, 0);
        penpos3(stafflinethickness, -35);
 
        penlabels(1,2,3);