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, 1 Nov 2012 08:20:00 -0700 (PDT)

Thomas Morley wrote
> 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

 
It works! Thank you!
 
And now i have a new question. Can i make all as well as you tell me, but
lyric text must be maked by "font A", for example, Times, and
"strangeLyricHyphen" must be maked by "font B", for example Arial?
Is it possible?



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



reply via email to

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