]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/lyric-extender.cc (brew_molecule): don't add
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 21 Jul 2002 20:24:57 +0000 (20:24 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 21 Jul 2002 20:24:57 +0000 (20:24 +0000)
right-trim-amount if extender is broken.

* scripts/ly2dvi.py (global_latex_preamble): bugfix (thanks Werner).

ChangeLog
lily/lyric-extender.cc
scripts/ly2dvi.py

index 85e443528f943edc24980549fc968b3b2c7842f6..cc86db65d5c55fbe3277df7093210b73eebff572 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-07-21  Han-Wen  <hanwen@cs.uu.nl>
+
+       * lily/lyric-extender.cc (brew_molecule): don't add
+       right-trim-amount if extender is broken.
+
+       * scripts/ly2dvi.py (global_latex_preamble): bugfix (thanks Werner).
+
 2002-07-21  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * Documentation/index.texi: Add pointers to new regression and
index 9cb03b14ec5fe9867e71d0365c714ed5bdaeb056..104cc9e76ccb86d152ae941c9afdcfbd3ee5a5b1 100644 (file)
@@ -21,17 +21,27 @@ SCM
 Lyric_extender::brew_molecule (SCM smob) 
 {
   Spanner *sp = unsmob_spanner (smob);
-
-  // ugh: refp
-  Real leftext = sp->get_bound (LEFT)->extent (sp->get_bound (LEFT),
-                                              X_AXIS).length ();
+  Item* l = sp->get_bound (LEFT);
+  Item*r = sp->get_bound (RIGHT);
+  
+  Real leftext = l->extent (l, X_AXIS).length ();
 
   Real sl = sp->paper_l ()->get_var ("linethickness");  
   Real righttrim = 0.5; // default to half a space gap on the right
-  SCM righttrim_scm = sp->get_grob_property ("right-trim-amount");
-  if (gh_number_p (righttrim_scm)) {
-    righttrim = gh_scm2double (righttrim_scm);
-  }
+
+
+  /*
+    If we're broken, we shouldn't extend past the end of the line.
+   */
+  if (r->break_status_dir () == CENTER)
+    {
+      SCM righttrim_scm = sp->get_grob_property ("right-trim-amount");
+      if (gh_number_p (righttrim_scm))
+       {
+         righttrim = gh_scm2double (righttrim_scm);
+       }
+    }
+  
   // The extender can exist in the word space of the left lyric ...
   SCM space =  sp->get_bound (LEFT)->get_grob_property ("word-space");
   if (gh_number_p (space))
index b023a3de0068034cfd8f8149c8325bfd4d1f7ac1..a810bb7a52ddbc15e0123a0538cd86fec02fb625 100644 (file)
@@ -599,7 +599,7 @@ def global_latex_preamble (extra):
        s = s + '\\documentclass[%s]{article}\n' % options
 
        if extra['language']:
-               s = s + r'\usepackage[%s]{babel}\n' % extra['language'][-1]
+               s = s + r'\usepackage[%s]{babel}' % extra['language'][-1] + '\n'
 
 
        s = s + '\\usepackage{%s}\n' \