]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/feta-schrift.mf
release: 0.1.37
[lilypond.git] / mf / feta-schrift.mf
index bd156643ff46a2bc6c4f378641f45dcb18a0ece0..f97a635d11de5d445081f83e4b120fe14037baff 100644 (file)
@@ -1,9 +1,13 @@
-%
-% scripts
-%
+% 
+% feta-schrift.mf --  implement scripts
+% 
+% source file of the Feta (Font-En-Tja) music font
+% 
+% (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+% 
 
 
-fet_begingroup("foobars")
+fet_begingroup("scripts")
 
 
 def draw_fermata =
@@ -13,7 +17,7 @@ def draw_fermata =
        % suggest ca 80 degrees iso half-circle
        alpha := 10;
 
-       radius# = 1.5 interline#;
+       radius# = 1.25 interline#;
        crook_thinness# = 1.5stafflinethickness#;
        crook_fatness# = 4 stafflinethickness#;
 
@@ -49,9 +53,7 @@ fet_endchar;
 
 fet_beginchar("fermata down", "dfermata", "dfermata")
        draw_fermata;
-       currentpicture:=currentpicture yscaled -1 ;
-       set_char_box(w#, w#, h#, 0);
-       
+       y_mirror_char;
 fet_endchar;
 
 
@@ -59,21 +61,22 @@ fet_endchar;
 % FIXME: rounded endings
 %
 % `\accent' is TeX reserved.
-fet_beginchar("> accent", "accent", "sforzatoaccent")
+fet_beginchar("> accent", "sforzato", "sforzatoaccent")
        set_char_box(.9 interline#, .9 interline#, .5 interline#, .5 interline#);
        save thickness, diminish;
 
        thickness = 2 stafflinethickness;
+       pickup pencircle scaled thickness;
 
        % prevent blobs at crossing lines
        diminish = .75;
 
-       y1 + thickness/2 = h;
-       x1 = -b;
-       x2 = w;
+       top y1 = h;
+       lft x1 = -b;
+       rt x2 = w;
        y2 = .25 thickness* diminish;
 
-       z4 = (w,0);
+       rt z4 = (w,0);
        x3 =0;
        z3 = whatever [z1, z4];
 
@@ -81,15 +84,19 @@ fet_beginchar("> accent", "accent", "sforzatoaccent")
        penpos1(thickness, 90);
        penpos3(thickness, 90);
 
-       penstroke z1e .. z3e .. z2e;
-       penstroke (z1e .. z3e .. z2e) yscaled -1;
+       draw z1 .. z3;
+       draw (z1 .. z3) yscaled -1;
+       draw z4;
+       penstroke z3e .. z2e;
+       penstroke (z3e .. z2e) yscaled -1;
 
        penlabels(1,2,3);
+       labels(4);
 fet_endchar;
 
 fet_beginchar("staccato dot", "staccato", "staccato")
        save radius;
-       radius# = 1.25 stafflinethickness#;
+       radius# = 1.5 stafflinethickness#;
        define_pixels(radius);
        pickup pencircle scaled 2 radius;
        draw (0,0);
@@ -102,7 +109,7 @@ def draw_staccatissimo =
        radius# = 2 stafflinethickness#;
        define_pixels(radius, height);
 
-       draw_brush((0,0), blot_diameter, (0, height),2 radius);
+       draw_brush((0,0), stafflinethickness, (0, height),2 radius);
        set_char_box(radius#,radius#, blot_diameter#/2, height# + radius#);
 enddef;
 
@@ -134,25 +141,24 @@ fet_endchar;
 
 
 def draw_marcato = 
-       save fatness, thinness;
+       save fat_factor, thinness;
        set_char_box(interline#/2, interline#/2, 0, 1.1 interline#);
 
-       fatness = 3 stafflinethickness;
-       thinness = .8 stafflinethickness;
-       x2 - x1  + blot_diameter = fatness;
-       x2 + thinness/2 = w;
-       
-       y1 = y2;
-       y1 = thinness/2;
-       z2 - z3 = whatever * (charwd, -charht);
-       z1 - z4 = whatever * (charwd, -charht);
-       z3 - z4 = whatever * (charwd, charht);
-       y3 + thinness/2 = h;
-       draw_rounded_path(z1 -- z2 -- z3 -- z4 -- cycle, thinness);
+       fat_factor = .3;
+       thinness =  stafflinethickness;
 
        pickup pencircle scaled thinness;
-       z3 - z5 = whatever* (z3 - z4);
+       rt x2 = w;
+       lft x5 = -b;
        bot y5 = 0;
+       top y3 = h;
+       y1 = y2 = y5;
+
+       x3 =0;
+       z1 - z4 = whatever * (charwd, -charht);
+       z4 = fat_factor [z3, z5];
+
+       filldraw z1 -- z2 -- z3 -- z4 -- cycle;
        draw z3 .. z5;
 enddef;
 
@@ -165,30 +171,32 @@ fet_endchar;
 %
 % The down marcato char (not very much used). 
 % Contrary to what some MF/TeX `gurus' believe
-% it is *point*-symmetric with the "up" version; (at least [Chlapik] 
-% agrees with us)
-%
+% it is *point*-symmetric with the "up" version
 fet_beginchar("marcato down", "dmarcato", "dmarcato")
        draw_marcato;
        xy_mirror_char;
 fet_endchar;
  
+%
+% used in french horn music todo
+%
+% TODO: too light at 20pt
 fet_beginchar("open (unstopped)", "open", "ouvert")
        save thin, height, width, thick;
        height# = 5/4 width#;
-       height# = 7/8 interline#;
+       height# = interline#;
        thin = 1.2 stafflinethickness;
        thick =  1.4 thin;
-       set_char_box(width#/2, width#/2, 0, height#);
+       set_char_box(width#/2, width#/2, height#/2, height#/2);
        
        penpos1(thick, 0);
        penpos2(thin, 90);
-       z1r = (w,h/2);
+       z1r = (w, 0);
        z2r = (0, h);
        penlabels(1,2);
        penstroke z1e{up} .. {left}z2e;
        addto currentpicture also currentpicture xscaled -1;
-       addto currentpicture also currentpicture reflectedabout((w,h/2), (0,h/2));
+       addto currentpicture also currentpicture yscaled -1;
 fet_endchar;
 
 
@@ -216,7 +224,7 @@ fet_beginchar("Upbow", "upbow", "upbow")
 
        thick = 1.4 stafflinethickness;
        wd# = 1.3 interline#;
-       ht# = 3/2 wd#; 
+       ht# = 1.6 wd#; 
 
        
        set_char_box(wd#/2, wd#/2, 0, ht#);
@@ -237,10 +245,10 @@ fet_beginchar("Downbow", "downbow", "downbow")
        save wd;
        define_pixels(wd)
 
-       wd# = 7/4 interline#;
+       wd# = 1.5 interline#;
        stemthick = 1.2 stafflinethickness;
 
-       set_char_box(wd#/2, wd#/2, 0, interline#);
+       set_char_box(wd#/2, wd#/2, 0, 4/3 interline#);
 
        beamheight = 4/10 h;
 
@@ -256,8 +264,8 @@ fet_beginchar("Downbow", "downbow", "downbow")
        x4 = x3;
        save p;
        path p;
-       p := z1 -- z2 -- z3 -- z4 --cycle;
-       draw_rounded_path(p, blot_diameter);
+       filldraw z1 -- z2 -- z3 -- z4 --cycle;
+
        pickup pencircle scaled stemthick;
 
        bot y5 =0;
@@ -269,9 +277,8 @@ fet_beginchar("Downbow", "downbow", "downbow")
 fet_endchar;
 
 %
-% Inspired by a computer-set version of auf dem Strom by Baerenreiter. 
+% Inspired by a computer-set version of Auf dem Strom by Baerenreiter. 
 %
-
 fet_beginchar("Turn","turn","turn")
        save thin, thick, ball_diam, darkness;
        save wd, ht, thick_nibangle, ball_nib_thick;
@@ -280,7 +287,7 @@ fet_beginchar("Turn","turn","turn")
 
        wd# = 35/16 interline#;
        ht# = 18/17 interline#;
-       darkness = 1.25 stafflinethickness;
+       darkness = 1.20 stafflinethickness;
 
        set_char_box(wd#/2, wd#/2, ht#/2, ht#/2);
 
@@ -327,66 +334,69 @@ fet_beginchar("Turn","turn","turn")
 fet_endchar;
 
 
-
-def draw_bulb(expr zl, zr, center_factor, radius_factor)=
-       begingroup;
-       clearxy;
-       save rad, ang;
-
-       ang = angle(zr-zl);
-       z0 = center_factor [zr, zl];
-       rad = center_factor * length(zr-zl);
-       
-       z1 = z0 + radius_factor* rad * dir(ang - 100);
-       z2 = z0 + rad * dir(ang - 270);
-       labels(0,1,2);
-       fill zr{dir (ang - 90)} .. z1 .. z2 -- cycle;
 
-       endgroup
-enddef;
+%
+% Inspired by a (by now) PD edition of Durand & C'ie edition of 
+% Saint-Saens' Celloconcerto no. 1 
+%
+% FIXME take out hardcoded vars.
+% FIXME the two loops on the `t' should be smoother (and the left one bigger).
+% FIXME generic macros for serifs: top of the t and bottom of r
+%
+% 
 
-fet_beginchar("Trill (`tr')","utrill","utrill")
+fet_beginchar("Trill (`tr')","trill","trill")
        
-       save start_angle,  ascender_extra, ex, hair_thick, fatness,
-         slant_angle, slant, t_fatness, r_fatness, kerning;
+       save start_nib_angle,  ascender_extra, ex, hair_thick, fatness,
+         slant_angle, slant, t_fatness, r_fatness, kerning, t_overshoot, 
+         uitschieter, bulb_size;
+       ;
        pair slant_vec;
 
-       define_pixels(ex, ascender_extra, ascender);
        ascender_extra# = 1/2 ex#;
        ascender# = ascender_extra# + ex#;
-       ex# = interline#;
+       ex# = 1.5 interline#;
+       kerning# = .75 ex#;
+       start_nib_angle = 20;
+       bulb_size = 0.47;
+       define_pixels(ex, ascender_extra, ascender, kerning);
 
+       t_overshoot = 0.03 ex;
        fatness = 12/40 ex;
        t_fatness = 8/10 fatness;
-       r_fatness = 8/10 fatness;
+       r_fatness = .75 fatness;
+       uitschieter = 21/40 ex;
+       hair_thick =  blot_diameter;
 
-       hair_thick = 2/3 blot_diameter;
+       slant = .2;
 
+       local_copy(transform)(currenttransform);
+       currenttransform := currenttransform slanted slant;
 
        y1 = ascender;
        x1l = 0;
        x1r = t_fatness;
-       penpos1(start_nib_wid, 25);
+       penpos1(start_nib_wid, start_nib_angle);
        
        z2 = (x1, 7/18 ex);
-       penpos2(start_nib_wid, 25);
+       penpos2(start_nib_wid, start_nib_angle);
 
-       z3l = (11/10 t_fatness, 0);
+       z3l = (11/10 t_fatness, - t_overshoot);
 
-       z4l = (13/6 t_fatness, 3/8 ex);
+       z4l = (13/6 t_fatness, 5/16 ex);
        penpos4(hair_thick, 180);
 
        1.9 [z3l, z3r] = z4r;
        z3 = .5 [z3l, z3r];
-
-
        
        save t_p, krul_p;
        path t_p, krul_p, r_p;
 
 
-       t_p := z1l -- z2l{down} .. z3l{right} .. z4l{up} -- z4r{down} 
+       t_p := z1l -- z2l{down} .. tension (1 + .5 slant)
+               .. z3l{right} 
+               
+               .. z4l{up} -- z4r{down} 
                .. z3r{left} .. z2r{up} .. z1r -- cycle;
        fill t_p ;
 
@@ -396,28 +406,33 @@ fet_beginchar("Trill (`tr')","utrill","utrill")
 
        z5 = (t_fatness/2, 2/3 ex);
        
-       lft x6 = -18/40 ex;
+       lft x6 = - uitschieter;
        y6 =  y5 - 1/20 ex;
 
-       z7 = (2 t_fatness, ex);
-
-       krul_p := z4{up} .. tension 1.1 .. z5  .. {down}z6
-               .. tension 1.1 .. z5 --- z7;
-       draw krul_p;
-
-       penpos7(hair_thick, angle (z7-z5) + 90);
+       z7 = z5 + whatever*dir krul_ang;
+       up_angle = krul_ang;
+       % angle (z7-z5)
+       x7 = 5/10 kerning + x5;
+       
+       penpos7(hair_thick, up_angle + 90);
 
-       z8l = (2 t_fatness + 2 hair_thick, ex);
-       penpos8(2 hair_thick, 35);
+       
+       x8l = .7 [x9r, x7r];
+       y8l = y7l;
+       penpos8(2 hair_thick, (up_angle +90)/2);
 
        y9 = 3/4 ex;
-       x9l = 2.8 t_fatness;
+       x9 = x1 + kerning;
        penpos9(r_fatness, 0);
 
        x10 = x9;
        y10 = 0;
        penpos10(r_fatness, 0);
 
+       krul_p := z4{up} .. tension 1.1  .. z5 
+               .. tension 1 and .75 .. {down}z6
+               .. tension .85 and 1.1 .. z5 --- z7;
+       draw krul_p;
        r_p := z7l{z7-z5} .. z8l{right} .. z9l{down} --- z10l -- z10r
                --- z9r{up} 
                ..  z8r{left} ..  z7r{z5-z7} -- cycle;
@@ -428,12 +443,63 @@ fet_beginchar("Trill (`tr')","utrill","utrill")
        penpos11(1/4 r_fatness, -20);
        z11r = z9r;
        
-       z13 = (x9 + 2 r_fatness, y11 + 1/16 ex);
+       z13 = (x9 + 2 r_fatness, y11 );
        penpos13(r_fatness, 180);
        fill z11r{dir 70} .. z13r{down} -- z13l{up} .. z11l{dir 250} -- cycle;
        penlabels(range 1 thru 15);
 
-       draw_bulb(z13r, z13l, 0.5, 1.5);
+
+       draw_bulb(-1, z13r, z13l, bulb_size * r_fatness, 1.5);
+fet_endchar;
+
+fet_beginchar("organ-heel", "pedalheel", "pedalheel")
+       save radius, thickness, wall;
+
+       radius# := .5 interline#;
+
+       define_pixels(radius);
+       set_char_box(radius#, radius#, radius#, 2/3 interline#);
+
+       thickness := 1.5 stafflinethickness;    
+       pickup pencircle scaled thickness;
+       rt x1 = b;
+       top y1 = h;
+       
+       x2 =x1;
+       y2 = 0;
+
+       x3 = 0;
+       bot y3 = -d;
+
+       draw z1{down} .. z2{down} .. z3{left};
+       addto currentpicture also currentpicture xscaled -1;
+       labels(1,2,3);
 fet_endchar;
 
-fet_endgroup("foobars");
+fet_beginchar("organ-toe", "pedaltoe", "pedaltoe")
+       save ht,wd;
+
+       thickness := 1.5 stafflinethickness;
+       ht# := 1.5 interline#;
+       wd# := 1/3 ht#;
+       define_pixels(ht,wd);
+
+
+       set_char_box(wd#, wd#, 0, ht#);
+       
+       pickup pencircle scaled thickness;
+       lft x1 = -b;
+       bot y1 = 0;
+       x2 =0;
+       top y2 = h;
+       z3 = z1 xscaled -1;
+
+
+       draw z1 -- z2 -- z3;
+       labels(1,2,3);
+fet_endchar;
+
+
+
+
+fet_endgroup("scripts");