]> git.donarmstrong.com Git - lilypond.git/commitdiff
(print): support left/right-padding for
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 21 Aug 2006 11:33:04 +0000 (11:33 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 21 Aug 2006 11:33:04 +0000 (11:33 +0000)
extenders.

ChangeLog
Documentation/topdocs/NEWS.tely
lily/lyric-extender.cc
scm/define-grob-properties.scm

index 163a89e654285db02adcba0e0003caa61de6e190..fd926f022bbebb86d68ef762e550ece866666a4e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-08-21  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
+       * lily/lyric-extender.cc (print): support left/right-padding for
+       extenders.
+
        * scm/documentation-generate.scm (string-append): revert lilypond/
        path, doc why.
 
index a1ddecbe0aae97cac6f113b7d8fe67b3c35f6066..3c98cbdd099acb262fc4ee47e827516227da065c 100644 (file)
@@ -66,8 +66,9 @@ which scares away people.
 
 @end ignore
 
-@item
+@item Lyric extenders now have tunable padding.
 
+This feature was sponsored by David Griffel
 
 @item
 Instrument changes are better supported: names in the margin can be
index 5f74e457235031ea77bda9839be04d84d7d484bf..f507ddddaf0c96d7f12bbaeb8b3a27edc3de85bf 100644 (file)
@@ -60,16 +60,17 @@ Lyric_extender::print (SCM smob)
     right_point = max (right_point, heads.back ()->extent (common, X_AXIS)[RIGHT]);
 
   Real h = sl * robust_scm2double (me->get_property ("thickness"), 0);
-  Real pad = 2 * h;
+  Drul_array<Real> paddings (robust_scm2double (me->get_property ("left-padding"), h),
+                            robust_scm2double (me->get_property ("right-padding"), h));
 
   if (right_text)
-    right_point = min (right_point, (robust_relative_extent (right_text, common, X_AXIS)[LEFT] - pad));
+    right_point = min (right_point, (robust_relative_extent (right_text, common, X_AXIS)[LEFT] - paddings[RIGHT]));
 
   /* run to end of line. */
   if (me->get_bound (RIGHT)->break_status_dir ())
-    right_point = max (right_point, (robust_relative_extent (me->get_bound (RIGHT), common, X_AXIS)[LEFT] - pad));
+    right_point = max (right_point, (robust_relative_extent (me->get_bound (RIGHT), common, X_AXIS)[LEFT] - paddings[RIGHT]));
 
-  left_point += pad;
+  left_point += paddings[LEFT];
   Real w = right_point - left_point;
 
   if (w < 1.5 * h)
@@ -86,4 +87,9 @@ Lyric_extender::print (SCM smob)
 ADD_INTERFACE (Lyric_extender, "lyric-extender-interface",
               "The extender is a simple line at the baseline of the lyric "
               "that helps show the length of a melissima (tied/slurred note).",
-              "next thickness heads");
+              "heads"
+              "left-padding "
+              "next "
+              "right-padding "
+              "thickness "
+              );
index e58e2513232a0d2efba2aab195c771ab53d391e5..ccc8642ff926a5e340417ee8b36a06d8387b338e 100644 (file)
@@ -260,8 +260,7 @@ objects in higher layers.")
 sum of 2 numbers.  The first is the factor for line thickness, and the
 second for staff space. Both contributions are added.")
      (left-padding ,ly:dimension? "The amount of space that is put
-left to a group of accidentals.")
-     
+left to an object (eg. a group of accidentals).")
      (length ,ly:dimension? "User override for the stem length of
 unbeamed stems.")
      (length-fraction ,number? "Multiplier for lengths. Used for
@@ -351,8 +350,7 @@ quicker the slur attains it @code{height-limit}.")
      (remove-empty ,boolean? "If set, remove group if it contains no
 @code{interesting-items}")
      (remove-first ,boolean? "Remove the first staff of a orchestral score?")
-     (right-padding ,ly:dimension? "Space to insert between note and
-accidentals.")
+     (right-padding ,ly:dimension? "Space to insert on the right side  of an object (eg. between note and its accidentals.)")
      (rotation ,list? "Number of degrees to rotate this object, and what point
 to rotate around. #'(45 0 0) means rotate 45 degrees around the center of this object.")
      (same-direction-correction ,number? "Optical correction amount