bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue 1722 in lilypond: Lyrics hyphen's visibility after line break


From: lilypond
Subject: Re: Issue 1722 in lilypond: Lyrics hyphen's visibility after line break should be controllable
Date: Wed, 01 Feb 2012 22:44:54 +0000


Comment #2 on issue 1722 by address@hidden: Lyrics hyphen's visibility after line break should be controllable
http://code.google.com/p/lilypond/issues/detail?id=1722

Hi 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

Attachments:
        broken-lyric-hyphen-01.png  19.6 KB




reply via email to

[Prev in Thread] Current Thread [Next in Thread]