lilypond-user
[Top][All Lists]
Advanced

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

Re: _ underscore lyric hyphen


From: Thomas Morley
Subject: Re: _ underscore lyric hyphen
Date: Fri, 19 Oct 2012 22:26:37 +0200

2012/10/19 Rustik <address@hidden>:
> Hello everybody!
> Excuse me for my bad english.
> I am beginner lilypond user. Please help me. I need to use underscore lyric
> hyphen "_".
> It must be aligned to left syllable and avtomatically be before syllable at
> new system.

I've never seen this before, but it _is_ possible.

Try this workaround:

\version "2.16.0"

\paper {
        ragged-right = ##f
}

strangeLyricHyphens =
\override LyricHyphen #'after-line-breaking =
        #(lambda (grob)
          (let* ((l-bd (ly:grob-property grob 'left-bound-info))
                 (bound-left (ly:spanner-bound grob LEFT))
                 (bound-right (ly:spanner-bound grob RIGHT))
                 (text-left (ly:grob-property bound-left 'text))
                 (text-right (ly:grob-property bound-right 'text))
                 (orig (ly:grob-original grob))
                 (siblings (if (ly:grob? orig)
                       (ly:spanner-broken-into orig)
                       '() ))
                 (new-text (grob-interpret-markup bound-left (markup
#:concat ((markup->string text-left) "_"))))
                 (add (* -1 (interval-length (ly:stencil-extent
(grob-interpret-markup bound-left (markup "_")) X))))
                 (fake-hyphen (ly:stencil-translate-axis
                    (grob-interpret-markup bound-right (markup #:concat
("_" (markup->string text-right))))
                      add X)))
          (ly:grob-set-property! grob 'transparent #t)
          (if (not (null? text-left))
            (ly:grob-set-property! bound-left 'stencil new-text)
            text-left)
          (if (and (>= (length siblings) 2)
            (eq? (car (last-pair siblings)) grob))
            (ly:grob-set-property! bound-right 'stencil fake-hyphen))))


lyr = \lyricmode {
        Cy --  ri --  e     e -- lei -- son,     Cy --
        rie     e --  lei -- son.
}
<<
\new Voice = "mel" \relative c' {
        c d c d c d c2 \break
        d4 c d c
}
\new Lyrics \lyricsto "mel" \lyr
>>

\new Lyrics \lyr

\layout {
  \context {
    \Lyrics
    \strangeLyricHyphens
  }
}


Also, see:
http://code.google.com/p/lilypond/issues/detail?id=1722

HTH,
  Harm



reply via email to

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