
lilypond - issue #1722
Lyrics hyphen's visibility after line break should be controllable
Discussed by Federico Bruni in -user, http://lists.gnu.org/archive/html/lilypond-user/2011-06/msg00449.html
%---------------8<---------------------------- Dear LilyPonders,
by default LilyPond hides the hyphen after a line break. Is it possible to make it always visible?
There is a regtest file to check this behavior: lyric-hyphen-break.ly. I'm using it as a test file.
Hyphens are spanners, right? In the doc I found this hint:
"The visibility of spanners which end on the first note following a line break is controlled by the after-line-breaking callback ly:spanner::kill-zero-spanned-time.
For objects such as glissandos and hairpins, the default behaviour is to hide the spanner after a break; disabling the callback will allow the left-broken span to be shown. "
I played with \override LyricHyphen #'after-line-breaking (see file attached), but nothing changed in the output.
Actually, I'm not directly interested in this issue. I'm just trying to help Luca (reviewer of Italian documentation), who asked a couple of times about this and never got a reply: https://lists.gnu.org/archive/html/lilypond-user/2010-02/msg00330.html https://lists.gnu.org/archive/html/lilypond-user/2011-04/msg00470.html
Thanks in advance for your help, Federico %---------------8<----------------------------
Comment #1
Posted on Feb 1, 2012 by Happy PandaThis request was also made on the French Users mailing list. Does someone know a workaround one could use for now?
Comment #2
Posted on Feb 1, 2012 by Grumpy KangarooHi Xavier,
this is a ugly work-around, because I didn't manage to manipulate the LyricHyphen after the line-break, instead I added something to the first syllable of a line. And I'm afraid it can be broken without problems, but currently it's the best I can think of. I tested it with various line-widths using 2.14.2 and 2.15.24. Please test yourself and give me feedback.
\version "2.14.2"
(define (lyric-hyphen-callback-test-1 hyphengrob)
(let* ((thick (ly:grob-property hyphengrob 'thickness))
(lngth (ly:grob-property hyphengrob 'length))
(hgth (ly:grob-property hyphengrob 'height))
(orig (ly:grob-original hyphengrob))
(siblings (if (ly:grob? orig)
(ly:spanner-broken-into orig)
'() ))
(bound (ly:spanner-bound hyphengrob RIGHT))
(text (ly:grob-property bound 'text))
(ln (markup #:translate `(0 . ,hgth) #:override `(thickness . ,thick) #:draw-line `(,lngth . 0)))
(add (* -1 (interval-length (ly:stencil-extent (grob-interpret-markup bound (markup #:concat (ln " "))) X))))
(fake-hyphen (ly:stencil-translate-axis
(grob-interpret-markup bound (markup #:concat (ln " " (markup->string text))))
add X)))
(if (and (>= (length siblings) 2)
(eq? (car (last-pair siblings)) hyphengrob))
(ly:grob-set-property! bound 'stencil fake-hyphen))))
\score { << \new Voice \relative c'' { \time 1/4 \repeat unfold 19 { c16[ c c c] } c16[ c c c] } \addlyrics { \repeat unfold 19 { bla -- bla -- bla -- bla -- } bla -- bla -- bla -- bla }
> \layout { indent = 0 % line-width = 8 \cm \context { \Lyrics \override LyricHyphen #'minimum-distance = #3
\override LyricHyphen #'after-line-breaking = #lyric-hyphen-callback-test-1
} } }
Harm
- broken-lyric-hyphen-01.png 19.58KB
Comment #3
Posted on Apr 2, 2012 by Grumpy OxThank you for your work-around: it works! Will you post it on the LilyPond Snippet Repository? I think that it would be very useful.
Luca
Comment #4
Posted on Jul 19, 2015 by Happy Bird(No comment was entered for this change.)
Status: Accepted
Labels:
Type-Enhancement