|
From: | Alexander Kobel |
Subject: | Re: Automatic lyric extenders |
Date: | Wed, 14 Dec 2016 11:11:50 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 |
On 2016-12-14 07:12, Knut Petersen wrote:
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: [...] A hackish solution, but it works ;-)
I guess a more proper way would be to introduce an additional event type, say 'LyricContinuation, have _ translated to that, and get rid of this case distinction. But it doesn't seem to me that this is worth the effort; the current solution works, and I can't remember anyone complaining that their cherished hidden " " lyrics broke the alignment.
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.
True.
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?
Can do it, but I really don't mind if you wrap everything together into one single patch. Just let's wait for some input whether this should be active per default or not (see my lily-devel mail).
Cheers, Alexander
[Prev in Thread] | Current Thread | [Next in Thread] |