Dear all,
I think the attached patch fixes the issues regarding the hyphens
overprinting syllables at the start of a new line. However, I don't
pretend to be an expert on either C++ or Lilypond's internals, so I
can't be sure. Do let me know if I've made a stupid assumption (in
particular, I'm slightly worried about the cut'n'paste job I did to be
able to test whether a particular thing is in the first column.
Patch is against 1.3.88.
Cheers,
Christophe
PS: if this goes in, the documentation probably needs to be updated
regarding the hyphen minimum-length, saying that it's not a hard but a
soft minimum, but that it should be viewed mostly as the multiplier
for the geometric mean thingy.
--
Jesus College, Cambridge, CB5 8BL +44 1223 524 842
(FORMAT T "(~@{~w ~}~3:*'~@{~w~^ ~})" 'FORMAT T "(~@{~w ~}~3:*'~@{~w~^ ~})")
--- lilypond-1.3.88/lily/hyphen-spanner.cc Tue Aug 8 12:44:42 2000
+++ lilypond-1.3.88.new/lily/hyphen-spanner.cc Thu Sep 21 19:41:22 2000
@@ -15,6 +15,7 @@
#include "molecule.hh"
#include "paper-def.hh"
#include "hyphen-spanner.hh"
+#include "paper-column.hh"
#include "spanner.hh"
#include "item.hh"
@@ -60,7 +61,28 @@
*/
if(l < w)
l = sqrt(l*w);
-
+ else
+ {
+ /* OK, we have a problem. Usually this means that we're on the
+ first column, and we have a long lyric which extends to near
+ the offset for stuff */
+ /* This test for being on the first column has been shamelessly
+ ripped from spanner.cc */
+ Paper_column *sc = dynamic_cast<Paper_column*>
+(sp->get_bound(LEFT)->column_l());
+ if (sc != NULL &&
+ sc->break_status_dir () == RIGHT)
+ {
+ /* We are on the first column, so it's probably harmless to
+ get the minimum length back by extending leftwards into
+ the space under the clef/key sig/time sig */
+ bounds[LEFT] = bounds[RIGHT] - l;
+ }
+ else
+ {
+ /* We can't get the length desired. Maybe we should warn. */
+ l = w;
+ }
+ }
Box b (Interval (-l/2,l/2), Interval (h,h+th));
Molecule mol (sp->lookup_l ()->filledbox (b));
mol.translate_axis (bounds.center ()
@@ -80,3 +102,4 @@
{
elt_l_ = s;
}
+