lilypond-devel
[Top][All Lists]
Advanced

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

Re: include lines in breve X-extent (issue 1814) (issue 4931043)


From: lemniskata . bernoullego
Subject: Re: include lines in breve X-extent (issue 1814) (issue 4931043)
Date: Tue, 06 Sep 2011 17:15:52 +0000

Reviewers: janek, Bertrand Bordage, MikeSol, J_lowe, Ian Hulin (gmail), graham_percival-music.ca,

Message:
On 2011/09/06 16:26:40, Bertrand Bordage wrote:
On 2011/09/06 08:54:40, janek wrote:
> 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;
> ?

Yes, that would be cleaner and easier to understand.

Done (http://codereview.appspot.com/4986042/)

Description:
include lines in breve X-extent (issue 1814)

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/4931043/

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..1c208b651d9a248bb48b10deb05c3ff63d4c11d5 100644
--- a/mf/feta-noteheads.mf
+++ b/mf/feta-noteheads.mf
@@ -164,6 +164,11 @@ def draw_brevis (expr linecount, line_thickness_multiplier) =
        define_whole_blacker_pixels (stemthick);

        % Breves of smaller design sizes should have their lines
+       % farther apart.
+       gap# := (0.95 - 0.008 * design_size) * stemthick#;
+       define_pixels (gap);
+
+       % 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 +180,11 @@ 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);
+
        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]