From c13dfb126fc992a6c4f6746c5923036f77d94a57 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 21 Aug 2006 11:33:05 +0000 Subject: [PATCH] (print): support left/right-padding for extenders. --- ChangeLog | 3 +++ Documentation/topdocs/NEWS.tely | 3 ++- lily/lyric-extender.cc | 16 +++++++++++----- scm/define-grob-properties.scm | 6 ++---- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 163a89e654..fd926f022b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-08-21 Han-Wen Nienhuys + * lily/lyric-extender.cc (print): support left/right-padding for + extenders. + * scm/documentation-generate.scm (string-append): revert lilypond/ path, doc why. diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index a1ddecbe0a..3c98cbdd09 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -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 diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc index 5f74e45723..f507ddddaf 100644 --- a/lily/lyric-extender.cc +++ b/lily/lyric-extender.cc @@ -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 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 " + ); diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index e58e251323..ccc8642ff9 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -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 -- 2.39.2