lilypond-devel
[Top][All Lists]
Advanced

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

Braces redesigned (issue4581060)


From: bordage . bertrand
Subject: Braces redesigned (issue4581060)
Date: Mon, 13 Jun 2011 20:25:50 +0000

Reviewers: ,

Message:
A small patch that redefines the braces:

* Increases the width of the smallest.
* Reduces the width of the largest.
* Increments more consistently between two braces (there were too many
tiny braces).
* Increases the thickness of the ends of braces.
* Sharpens a little the angles to compensate the changes of width.
* Applies two nitpicks (lines 97 and 119).

Before:
http://lists.gnu.org/archive/html/lilypond-devel/2011-06/pngsoCwkARxka.png

After:
http://lists.gnu.org/archive/html/lilypond-devel/2011-06/pngYghPLbB7zD.png

Regards,
Bertrand

Description:
Braces redesigned

Small and large braces are more consistent.

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

Affected files:
  M mf/feta-braces.mf


Index: mf/feta-braces.mf
diff --git a/mf/feta-braces.mf b/mf/feta-braces.mf
index 6a095226a3b379f2df1c8cfee152071c668db558..5fb5ff1c7df8ec1a833c82ead924981a745d8a57 100644
--- a/mf/feta-braces.mf
+++ b/mf/feta-braces.mf
@@ -90,11 +90,11 @@ def draw_brace (expr height_sharp, width_sharp, slt_sharp, brace_number) =
                y0 = y1;
                x0 = x1 - 2/6 thin;

-               pendir = unitvector (x3 - x1, y3l / 6 - y1);
+               pendir = unitvector (x3 - x1, y3l / 8 - y1);
                penangle = angle pendir - 90;
                penpos3 (thin, penangle);
                penpos2 (thick, angle (z3 - z1) - 90);
-               penpos1 (2/3 thin, penangle);
+               penpos1 (-2 * (x0 - x1), penangle);

                penlabels (1, 2, 3);
                labels (0);
@@ -116,11 +116,21 @@ def draw_brace (expr height_sharp, width_sharp, slt_sharp, brace_number) =
 enddef;


-save stafflinethickness;
+save linethickness;
 save increment;
+save last_brace_number;
+save min_width;
+save max_width;
+save min_thin;
+save max_thin;

 linethickness := 0.5 pt#;
 increment := 0.5 pt#;
+last_brace_number := braces_per_font * 9 - 1;
+min_width := 2 pt#;
+max_width := 20 pt#;
+min_thin := 0.2 pt#;
+max_thin := 1.25 pt#;
 y := 10 pt#;

 for i := 0 step 1 until font_count:
@@ -139,13 +149,10 @@ for i := 0 step 1 until font_count:
                        errmessage "please report to <address@hidden>";
                fi;

-               % x should be about one staff space, taking brace to have
-               % default height of 3 staffs, this yields height / 3 / 4 = 12
-               % but 15 looks better
-               x := y / 15;
+               x := (y / last_brace_number) [min_width, max_width];

                increment := x / 10;
-               linethickness :=  min (0.5 pt#, y / 150);
+               linethickness := (y / last_brace_number) [min_thin, max_thin];
                if i = font_count:
                        draw_brace (y, x, linethickness, number);
                fi;





reply via email to

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