X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Flyric-hyphen.cc;h=b80fcaa7d0a7b6699c5016bfffc3629ecd5b9414;hb=2e8af646c57285dc4946205ddab0257bc4ef6270;hp=d38460be74541729fbd271f2f37525684ad65d9a;hpb=2c8c61b3a5cddbb155786a1ca027528701c91ac9;p=lilypond.git diff --git a/lily/lyric-hyphen.cc b/lily/lyric-hyphen.cc index d38460be74..b80fcaa7d0 100644 --- a/lily/lyric-hyphen.cc +++ b/lily/lyric-hyphen.cc @@ -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 - (c) 2003--2006 Han-Wen Nienhuys + 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 . */ #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 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 ()))) @@ -130,11 +150,10 @@ Lyric_hyphen::set_spacing_rods (SCM smob) } ADD_INTERFACE (Lyric_hyphen, + "A centered hyphen is simply a line between lyrics used to" + " divide syllables.", - "A centered hyphen is a simple line between " - "lyrics used to divide syllables", - - /* props */ + /* properties */ "dash-period " "height " "length " @@ -143,4 +162,3 @@ ADD_INTERFACE (Lyric_hyphen, "padding " "thickness " ); -