]> git.donarmstrong.com Git - lilypond.git/commitdiff
klef
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 20 Apr 2002 10:21:20 +0000 (10:21 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 20 Apr 2002 10:21:20 +0000 (10:21 +0000)
mf/feta-generic.mf
mf/feta-klef.mf

index a670f7194275857ca79e018c5e406d170960ceb5..0db34b4ddaf4ae2bbed6449b03f235c49f99d43c 100644 (file)
@@ -39,12 +39,12 @@ if test = 0:
        input feta-solfa;
        
 else:
-       input feta-bolletjes;   
-       input feta-banier;
+%      input feta-bolletjes;   
+%      input feta-banier;
 %      input feta-eindelijk;
-%      input feta-klef;
+       input feta-klef;
 %      input feta-toevallig;
-       input feta-schrift;
+%      input feta-schrift;
 %      input feta-haak;
 %      input feta-timesig;
 %      input feta-pendaal;
index 219b3932244615c8bb23645794998cbb5e4a79e0..eeb9bc097fed8b58467e116d35de60e174e9b74a 100644 (file)
@@ -105,8 +105,9 @@ fet_endchar;
 %
 
 def new_bulb (expr outer_tangent_point, 
-    big_radius, bulb_radius, flare, direction) =
-  begingroup;
+    big_radius, bulb_radius, flare, direction, turning_dir) =
+
+begingroup;
     save p, oldpen;
     path p;
     pen oldpen;
@@ -114,14 +115,14 @@ def new_bulb (expr outer_tangent_point,
     pair center;
     clearxy;
     
-    center = outer_tangent_point +big_radius* dir(0) + big_radius* dir(-90)
-      - bulb_radius * dir (-90);
+    center = outer_tangent_point +big_radius* dir(0) + big_radius* dir(-turning_dir * 90)
+      - bulb_radius * dir (- turning_dir * 90);
 
-    z1 = center + bulb_radius * dir 180;
-    z2 = center + bulb_radius * dir 270;
+    z1 = center + bulb_radius * dir (turning_dir * 180);
+    z2 = center + bulb_radius * dir (turning_dir * 270);
 
     z9 = center + bulb_radius * dir (0);
-    z10 = center + bulb_radius * dir (90);
+    z10 = center + bulb_radius * dir (turning_dir *90);
     z3 = outer_tangent_point + flare * dir (0);
 
     labels(1,2,3,9,10);
@@ -129,11 +130,12 @@ def new_bulb (expr outer_tangent_point,
     % tension is needed to open up the space between return path and the
     % ball.
     fill
+%      draw
       z9 .. z10 .. tension 1.1  .. z1 .. z2 .. cycle;
     
-    p:=    outer_tangent_point{down}
+    p:=    outer_tangent_point{dir (-turning_dir* 90)}
        .. tension 0.97
-       .. {up}z9 -- z3
+       .. {dir (turning_dir * 90)}z9 -- z3
      ;
     if direction = 1:
       p
@@ -230,7 +232,7 @@ def draw_bass_clef(expr exact_center, reduction) =
        pickup pencircle scaled 1; 
 %      draw
        fill
-           new_bulb (z1, 0.45 reduced_ss, 0.4 reduced_ss, 2.5 stafflinethickness,  1)
+           new_bulb (z1, 0.45 reduced_ss, 0.4 reduced_ss, 2.5 stafflinethickness,  1, 1)
 
 {dir (90)}
                .. z2r{right} .. tension 1.0 .. z3r{down}  .. {curl 0} 
@@ -269,9 +271,11 @@ fet_endchar;
 % 
 % FIXME bulb should curve (see bass clef)
 % FIXME start (inside) should be little thinner
-% FIXME parametrise.
 %
 
+
+
+
 % Beste lezers, kijk,
 %
 % Een bolletje  hebben we bij toeval allemaal wel eens getekend, maar begint u
@@ -284,7 +288,7 @@ fet_endchar;
 %
 
 def draw_gclef (expr exact_center, reduction)=
-       save reduced_ss, downstroke_dir, downstroke_angle, hair, center;
+       save reduced_ss, downstroke_dir, downstroke_angle, center;
        save breapth_factor, inner_thick_end, thinness, thickness, thinnib;
        save inner_start_angle, thinness, thinpen;
        reduced_ss# = staff_space# * reduction;
@@ -294,16 +298,17 @@ def draw_gclef (expr exact_center, reduction)=
        center := (hround_pixels(xpart exact_center), 
                vround_pixels(ypart exact_center));
 
-       hair =  .3 stafflinethickness;
-%      hair = blot_diameter; 
        thinness = 1.3 stafflinethickness;
-       downstroke_dir = (14, -75);
-       breapth_factor = 11/7;
+       downstroke_dir = unitvector (14, -75);
+       downstroke_angle = angle downstroke_dir;
+
+
+       breapth_factor = 21.0 /14;
        inner_thick_end = 45;
        inner_start_angle = downstroke_angle - 43;
-       thickness = .4 reduced_ss - hair;
+       thickness = .4 reduced_ss;
 
-       thinnib = thinness - hair;
+       thinnib = thinness;
        thinpen = thinness;
        set_horizontal_spacing;
        
@@ -312,12 +317,16 @@ def draw_gclef (expr exact_center, reduction)=
                -xpart exact_center + 1.0 * breapth_factor* reduced_ss#, 
                right_space# +
                xpart exact_center + .66 breapth_factor* reduced_ss#,
-               -ypart exact_center + 3 * reduced_ss#,
+               -ypart exact_center + 2.6 * reduced_ss#,
                ypart exact_center + 5 * reduced_ss#);
-       
-       pickup pencircle scaled hair;
-       downstroke_angle = angle downstroke_dir;
 
+
+       save upward_swoosh_angle;
+       upward_swoosh_angle =130 ;
+       penpos7(thickness, upward_swoosh_angle);
+       penpos5(thickness, upward_swoosh_angle);
+
+       
        z1 = center + whatever * dir (inner_start_angle);
        x1 = xpart center -.28 reduced_ss;
        
@@ -327,56 +336,60 @@ def draw_gclef (expr exact_center, reduction)=
        bot y4r = -(reduced_ss + .5 stafflinethickness);
 
        z3 = (z4 - center) rotated inner_thick_end + center;
-       
-       z5r = (- breapth_factor, .37)* reduced_ss + center;
-       penpos5(thickness, 135);
+       x5r = - breapth_factor* reduced_ss + xpart center;
+       y5r = .37 reduced_ss + ypart center;
 
        z6 = center + whatever * downstroke_dir;
        y6 = ypart center + 2 reduced_ss;
 
        z7l - z6 = whatever *(z5- z6) ;
        y7l = 3.5 reduced_ss;
-       z8r = .4 [z9r, z7r] + 1.5 stafflinethickness * dir 52;
 
        x9 = .7 [x10, x7r];
        top y9l = 5 reduced_ss;
 
-       y10 = 3. reduced_ss;
-       y11 = -11/7 reduced_ss;
+       y11 = ypart center  -20/14 reduced_ss;
+       y12 = ypart center  - 34/14 reduced_ss;
+       y13 = y12 + .65 reduced_ss;
+       x11 - x13r  = 1.25 reduced_ss + 0.5 thinnib;
+
+       x12r = xpart (.52 [z13r , z11] + .75 reduced_ss * downstroke_dir) ;
+       
+       z10=  center + whatever * dir (downstroke_angle + .5);
+       y10 = ypart center + 3.35  reduced_ss;
+       y10l  - y10r = 1.2 thickness;
+       z10r - z10l =
+               .9 thinnib* dir (downstroke_angle + 90) + whatever *downstroke_dir;
 
-       y12 = ypart center - 18.5/7 reduced_ss;
-       x12 = x11 - 5 /7 reduced_ss;    
+       z10 = .5 [z10l, z10r];
 
-       z13 = z12 + .6 reduced_ss*(-1,1);
 
-       (z10r - z10l) dotprod (unitvector downstroke_dir rotated 90) = 
-               thinnib;
+       z11 =  center + whatever * downstroke_dir;
 
-       center - z10= whatever * downstroke_dir;
-       center - z11 =  whatever * downstroke_dir;
-       center - z14 = .8 (center - z11);
        penpos1(thinnib, inner_start_angle);
        penpos2(thickness, 90);
        penpos3(thinnib, -90 + inner_thick_end);
        penpos4(thinnib, -90);
 
 
-       penpos7(thickness, 135);
-       penpos8(1.5 thinnib, - 70 + angle downstroke_dir);
-       penpos9(1.4 thickness, -80);  % ugh
-       penpos10(whatever, downstroke_angle + 10);
-       penpos11(thinnib, downstroke_angle + 90);
-       penpos14(thinnib, downstroke_angle + 90);
-       penpos12(thinnib, -90);
+       penpos9(1.4 thickness, -70);  
+
        penpos13(3 thinnib, 180);
 
-       filldraw z2l{right}   .. z3l.. z4l{left} .. z5l{up}  .. z7l{up} 
+       pickup pencircle scaled 1;
+
+       fill
+%      draw 
+               z2l{right}
+               .. z3l
+               .. z4l{left}
+               .. z5l{up}
+               .. z7l{up} 
                %.. z8l 
                .. tension 1.2 
-               .. z9l & z9l ..
-               {downstroke_dir}z10l --- z11l -- z11r --- z10r{- downstroke_dir} 
-               .. tension .8 
-               .. z9r & z9r{dir (downstroke_angle+ 40)} % ugh
+               .. z9l
+               --z9r % {dir (downstroke_angle+ 0)}
+               .. tension 0.8
                %.. z8r
                .. z7r{down} .. z5r{down} .. z4r{right}
                .. z3r .. z2r{left} .. 
@@ -384,16 +397,73 @@ def draw_gclef (expr exact_center, reduction)=
                z1r -- z1l 
                .. tension 0.85 ..cycle;
 
-       filldraw simple_serif(z1r, z1l, 80)  -- cycle;
+       save p, staffline_time, q;
+       path p,q;
+       p := z4{left} .. z5{up} .. z7{up} ;
+
+       q := (-reduced_ss, 2 reduced_ss) ..  (2 reduced_ss,2 reduced_ss);
+
+       draw p;
+%      z14 = point xpart (p intersectiontimes  q) of p;
+
+
+       % we don't do this with a path: variations in thickness
+       % are  very easily made and look very ugh.
+       pickup pencircle scaled thinnib;
+       
+
+       save bot_angle;
+       bot_angle = downstroke_angle- 87;
+
+       penpos12(thinnib, bot_angle + 90);
+
+       p := z9 .. z10{down}
+               .. z6 
+               ..  z11{dir (-93)} 
+               .. z12{dir(bot_angle)}
+       ;
+
+
+       save start_angle;
+       start_angle=angle (direction xpart (p intersectiontimes z11) of p);
+       penpos11 (thinnib, start_angle+ 90);
+
+       save loop_end_dir;
+       pair loop_end_dir;
+       loop_end_dir = direction (xpart (p intersectiontimes q)) of p;
+       draw p;
+
+       penpos6(thinnib, angle (loop_end_dir) + 90);
+       fill
+%      draw
+               z9l
+               .. {down}z10l
+               .. z6l{loop_end_dir} -- z6r{-loop_end_dir}
+               .. z10r{up}
+               .. tension .98
+               .. z9r
+               -- cycle;
+
+       pickup pencircle scaled 1;
+
+       fill simple_serif(z1r, z1l, 80)  -- cycle;
+
+%      draw
+       fill
+               z11r{dir(start_angle)}
+               .. z12r{dir(bot_angle)}
+
+               ..new_bulb (z13r, 0.45 reduced_ss, 0.38 reduced_ss, 2.5 stafflinethickness,  1, -1) {down}
+
+               % z13r{up} -- z13l{down}
+               .. z12l{-dir (bot_angle)}
 
-       filldraw z12r{left} .. z13r{up} -- z13l{down} .. z12l{right} .. cycle;
+               .. z11l{-dir(start_angle)}
+               .. cycle;
 
-       draw_bulb(-1,  z13l, lft z13r, 6/14 reduced_ss, 1.0);
 
-       pickup pencircle scaled (thinpen);
-       draw z10 --- z14 .. z11  .. tension 0.85 ..  z12{left};
 
-       penlabels(range 1 thru 15);
+       penlabels(range 1 thru 16);
 enddef;