Hi all,
digging out a very old thread:
<http://lists.gnu.org/archive/html/lilypond-user/2009-08/msg00136.html>
It was about conditionally killing lyric extenders if they are in the
source, but the engraving turns out too tight for them to be necessary.
Several months ago, I wrote the following function for exactly this. I
forgot about it and today hoped that Google helps me find it; turned out
that I had to grep locally instead since I never posted it to the
public. Ashamed of that, but here comes the code:
#(define (conditional-kill-lyric-extender-callback . args)
(lambda (grob)
(let* ((minimum-length
(if (null? args)
(ly:grob-property grob 'minimum-length 0)
(car args)))
(X-extent (ly:stencil-extent (ly:grob-property grob 'stencil
empty-stencil) X))
(length (- (cdr X-extent) (car X-extent))))
(if (> minimum-length length)
(ly:grob-suicide! grob)))))
\layout {
\context {
\Lyrics
\override LyricExtender #'minimum-length = #0
\override LyricExtender #'after-line-breaking =
#(conditional-kill-lyric-extender-callback 1)
%% change "1" (in staff-spaces) to whatever you feel is a suitable
minimum length for extenders
}
}
Best,
Alexander
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user