lilypond-user
[Top][All Lists]
Advanced

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

Re: _ underscore lyric hyphen


From: Rustik
Subject: Re: _ underscore lyric hyphen
Date: Thu, 15 Nov 2012 10:03:14 -0800 (PST)

Rustik wrote
> 
> Thomas Morley wrote
>> Hi,
>> I've rewritten the code, using more LilyPond-Syntax.
> Wow! It works! Thank you very much for your good job!

I have some problems with this code. Look:
 
\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)
                 '() ))
;; Underscore-markup:
           (underscore #{
              \markup \override #'(font-name . "Arial") "_"
                  #})

           (text-left-mrkp  #{ \markup #text-left  #})
           (text-right-mrkp #{ \markup #text-right  #})
           (new-text (grob-interpret-markup bound-left #{
              \markup \concat { #text-left-mrkp #underscore }
                  #}))
           (add (* -1 (interval-length
                        (ly:stencil-extent
                           (grob-interpret-markup bound-left underscore)
                              X))))
           (fake-hyphen
             (ly:stencil-translate-axis
               (grob-interpret-markup bound-right
                 #{ \markup \concat { #underscore #text-right-mrkp } #})
                   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 \break
        c d c2 d4 c d c
}
\new Lyrics \lyricsto "mel" \lyr
>>

\new Lyrics \lyr

\layout {
  \context {
    \Lyrics
    \strangeLyricHyphens
    \override LyricText #'font-name = #"Times New Roman"
  }
} 
There is hyphen before first syllable at system («_lei»), but there is no
hyphen after this syllable.
Syllable «lei» in word «eleison» is no first and no final. In means what in
case of this syllable is first at system, it must have hyphen before and
after oneself.



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/underscore-lyric-hyphen-tp135045p136398.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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