]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lyric-hyphen.cc
Midi2ly: have --key option reach all staves. Fixes #1587.
[lilypond.git] / lily / lyric-hyphen.cc
index 3b2dab06f1dcada003de6137969d252a7c20889b..b80fcaa7d0a7b6699c5016bfffc3629ecd5b9414 100644 (file)
@@ -1,9 +1,20 @@
 /*
-  hyphen-spanner.cc -- implement Lyric_hyphen
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 2003--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
-  (c) 2003--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "lyric-hyphen.hh"
@@ -24,10 +35,19 @@ MAKE_SCHEME_CALLBACK (Lyric_hyphen, print, 1);
 SCM
 Lyric_hyphen::print (SCM smob)
 {
+
   Spanner *me = unsmob_spanner (smob);
   Drul_array<Item *> bounds (me->get_bound (LEFT),
                             me->get_bound (RIGHT));
 
+  /* No hyphen should be printed under a grace note at the start
+     of a line if the grace's main note starts a new syllable.  */
+
+  if (Paper_column::when_mom (bounds[LEFT]->get_column ()).grace_part () != Rational (0)
+      && Paper_column::when_mom (bounds[LEFT]->get_column ()).main_part ()
+      == Paper_column::when_mom (bounds[RIGHT]->get_column ()).main_part ())
+    return SCM_EOL;
+
   if (bounds[LEFT]->break_status_dir ()
       && (Paper_column::when_mom (bounds[LEFT])
          == Paper_column::when_mom (bounds[RIGHT]->get_column ())))
@@ -142,4 +162,3 @@ ADD_INTERFACE (Lyric_hyphen,
               "padding "
               "thickness "
               );
-