Am 13.12.2016 um 22:43 schrieb Alexander Kobel:
On 2016-12-12 13:48, Knut Petersen wrote:
Hi everybody!
Please test and comment, patch and examples attached.
Hi Knut,
works beautifully, as far as your code is concerned. But I found a bug in my
function (add-lyric-extenders): Unintuitively, adding an extender after _ makes
extenders disappear: compare { Foo __ _ } against { Foo __ _ __ }.
Very interesting. Have a look at the scheme code produced from your example, you'll see the reason:
every _ is translated to an " " and an extender event is added by your scheme code. But
then in lyric-engraver.cc there is a special handling for the " " case:
Lyric_engraver::process_music ()
{
if (event_)
{
SCM text = event_->get_property ("text");
if (ly_is_equal (text, scm_from_ascii_string (" ")))
{
if (last_text_)
last_text_->set_property ("self-alignment-X",
get_property ("lyricMelismaAlignment"));
}
else
text_ = make_item ("LyricText", event_->self_scm ());
}
A hackish solution, but it works ;-)
The fixed function is in your regtest, along with a testcase for it.
Yes, your extended \add-lyric-extenders is correct.
I think \has-hypen? and \add-extender! should be merged with
add-lyric-extenders. Then the code should be put into a file in the scm
directory. E.g. scm/music-functions.scm. It's your code, will you prepare a
patch?
cu,
Knut
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user