lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

include lines in breve X-extent (issue 1814) (issue 4986042)


From: janek . lilypond
Subject: include lines in breve X-extent (issue 1814) (issue 4986042)
Date: Tue, 06 Sep 2011 12:18:18 +0000

Reviewers: Bertrand Bordage, Ian Hulin (gmail),

Message:
New patch set uploaded, two of Bertrand's concerns addressed (i'm not
sure what the third one means).

this replaces 4931043.


http://codereview.appspot.com/4986042/diff/1/mf/feta-noteheads.mf
File mf/feta-noteheads.mf (right):

http://codereview.appspot.com/4986042/diff/1/mf/feta-noteheads.mf#newcode217
mf/feta-noteheads.mf:217: z4 + (i * (gap + stemthick), 0),
On 2011/08/25 15:03:04, Bertrand Bordage wrote:
Hmmm... Don't you think (i * (gap + stemthick), 0)
has to be written one time instead of four ?

I'm not sure what you mean.  Are you saying that i should assign (i *
(gap +
stemthick), 0) to a variable in the for loop?  I.e. sth like

        for i := 0 step 1 until linecount - 1:
                foobar := (i * (gap + stemthick), 0);
                draw_gridline (z1 - foobar,
                               z2 - foobar,
                               stemthick);
                draw_gridline (z3 + foobar,
                               z4 + foobar,
                               stemthick);
        endfor;
?

Description:
char box of breve glyphs is widened to include
the lines, not only notehead.  This will allow
Lily to calculate collisions with breves
correctly.  It shouldn't change how breves
are aligned in note columns.

Please review this at http://codereview.appspot.com/4986042/

Affected files:
  M mf/feta-noteheads.mf


Index: mf/feta-noteheads.mf
diff --git a/mf/feta-noteheads.mf b/mf/feta-noteheads.mf
index a58e4bc89a7a6c607a3da1dea2478ecce9b8ba0f..ee5c9457673f5ff2baf3351ec6875c87c40802c9 100644
--- a/mf/feta-noteheads.mf
+++ b/mf/feta-noteheads.mf
@@ -158,12 +158,16 @@ fi;


 def draw_brevis (expr linecount, line_thickness_multiplier) =
-       save stemthick, fudge;
+       save stemthick, fudge, gap;

        stemthick# = line_thickness_multiplier * 2 * stafflinethickness#;
        define_whole_blacker_pixels (stemthick);

        % Breves of smaller design sizes should have their lines
+       % farther apart.
+       gap# := (0.95 - 0.008 * design_size) * stemthick#;
+
+       % Breves of smaller design sizes should have their lines
        % farther apart (the overlap should be smaller).
        fudge = hround (blot_diameter
                        * min (max (-0.15,
@@ -175,6 +179,12 @@ def draw_brevis (expr linecount, line_thickness_multiplier) =
        draw_outside_ellipse (1.80, 0, 0.707, 0);
        undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#);

+       set_char_box (stemthick# * linecount + gap# * (linecount - 1),
+                     width# + stemthick# * linecount + gap# * (linecount - 1),
+                     noteheight# / 2,
+                     noteheight# / 2);
+
+       define_pixels (gap);
        pickup pencircle scaled stemthick;

        % Breves of smaller design sizes should have their lines longer.
@@ -194,20 +204,17 @@ def draw_brevis (expr linecount, line_thickness_multiplier) =
        rt x1 - fudge = 0;
        x1 = x2;

-       fudge + lft x3 = w;
+       fudge + lft x3 = width;
        x4 = x3;
        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 - (i * line_distance, 0),
-                              z2 - (i * line_distance, 0),
+               draw_gridline (z1 - (i * (gap + stemthick), 0),
+                              z2 - (i * (gap + stemthick), 0),
                               stemthick);
-               draw_gridline (z3 + (i * line_distance, 0),
-                              z4 + (i * line_distance, 0),
+               draw_gridline (z3 + (i * (gap + stemthick), 0),
+                              z4 + (i * (gap + stemthick), 0),
                               stemthick);
        endfor;
 enddef;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]