]> git.donarmstrong.com Git - lilypond.git/commitdiff
font: change breve vertical lines
authorJanek Warchol <lemniskata.bernoullego@gmail.com>
Sat, 6 Aug 2011 15:27:27 +0000 (17:27 +0200)
committerMike Solomon <mike@apollinemike.com>
Sat, 6 Aug 2011 15:27:27 +0000 (17:27 +0200)
Put breve vertical lines farther apart
and make them longer to increase readability.

mf/feta-noteheads.mf

index c72522072195d2b9751158e12cd0014a333294c2..3d0ffa9dd667fa1556ce7102e8e8f31494c2ba1b 100644 (file)
@@ -157,24 +157,36 @@ if test > 0:
 fi;
 
 
-%
-% dimensions aren't entirely right.
-%
-def draw_brevis (expr linecount) =
+def draw_brevis (expr linecount, line_thickness_multiplier) =
        save stemthick, fudge;
 
-       stemthick# = 2 stafflinethickness#;
+       stemthick# = line_thickness_multiplier * 2 * stafflinethickness#;
        define_whole_blacker_pixels (stemthick);
 
-       fudge = hround (blot_diameter / 2);
+       % Breves of smaller design sizes should have their lines
+       % farther apart (the overlap should be smaller).
+       fudge = hround (blot_diameter *
+               min (max (-0.15, (0.8 - (20 / (design_size + 4)) + .1 linecount)), 0.3));
 
        draw_outside_ellipse (1.80, 0, 0.707, 0);
        undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#);
 
        pickup pencircle scaled stemthick;
 
-       bot y1 = -d;
-       top y2 = h;
+       % Breves of smaller design sizes should have their lines longer.
+       line_length := min (max (0.7, (64/60 - (design_size / 60))), 0.85);
+
+       % Line lengths between 0.72 and 0.77 are not nice
+       % because they are neither separate nor connected
+       % when there is an interval of fourth.
+       if line_length < 0.75:
+               quanted_line_length := min (0.72, line_length);
+       else:
+               quanted_line_length := max (0.77, line_length);
+       fi;
+
+       bot y1 = -quanted_line_length * staff_space;
+       top y2 = quanted_line_length * staff_space;
        rt x1 - fudge = 0;
        x1 = x2;
 
@@ -183,17 +195,22 @@ def draw_brevis (expr linecount) =
        y4 = y2;
        y3 = y1;
 
+       % Breves of smaller design sizes should have their lines
+       % farther apart.
+       line_distance := (1.95 - 0.008 * design_size) * stemthick;
        for i := 0 step 1 until linecount - 1:
-               draw_gridline (z1 - (1.5 * i * stemthick, 0),
-                              z2 - (1.5 * i * stemthick, 0), stemthick);
-               draw_gridline (z3 + (1.5 * i * stemthick, 0),
-                              z4 + (1.5 * i * stemthick, 0), stemthick);
+               draw_gridline (z1 - (i * line_distance, 0),
+                              z2 - (i * line_distance, 0),
+                              stemthick);
+               draw_gridline (z3 + (i * line_distance, 0),
+                              z4 + (i * line_distance, 0),
+                              stemthick);
        endfor;
 enddef;
 
 
 fet_beginchar ("Brevis notehead", "sM1");
-       draw_brevis (1);
+       draw_brevis (1, 1);
 
        draw_staff (-2, 2, 0);
 fet_endchar;
@@ -201,7 +218,7 @@ fet_endchar;
 
 if test > 0:
        fet_beginchar ("Brevis notehead", "sM1");
-               draw_brevis(1);
+               draw_brevis(1, 1);
 
                draw_staff (-2, 2, 0.5);
        fet_endchar;
@@ -209,7 +226,7 @@ fi;
 
 
 fet_beginchar ("Double-lined brevis notehead", "sM1double");
-       draw_brevis (2);
+       draw_brevis (2, 0.8);
 
        draw_staff (-2, 2, 0);
 fet_endchar;
@@ -217,7 +234,7 @@ fet_endchar;
 
 if test > 0:
        fet_beginchar ("Double-lined brevis notehead", "sM1double");
-               draw_brevis (2);
+               draw_brevis (2, 0.8);
 
                draw_staff (-2, 2, 0.5);
        fet_endchar;