On 31 August 2010 13:42, Robert Clausecker <[email protected]> wrote: > I want to write a small snippet for demonstration purposes, which > contains lyrics. The problem is, that the first measure of the cited > fragment is the second syllable of a word (Pro - phe - ten, the "Pro" is > missing). In order to increase the readability of this snippet, I wanted > to use a stanza to add this, eg: > > \set stanza = \markup {\medium Pro ‐} > > This works as expected, but unfortunately the dash "-" doesn't looks > like the dash which usually indicates a word-continuation (Entered > uding "--"). Does anybody know, how to get exactly this hyphen?
If you're using 2.13 you can span a hyphen between the stanza and the
first lyric syllable via a scheme engraver:
\version "2.13.31"
#(define (stanza-lyric-hyphen-engraver ctx)
(let ((hyphen '()))
`((initialize . ,(lambda (trans)
;; if 'stanza is set, make a hyphen before anything
;; else has happened
(and (markup? (ly:context-property ctx 'stanza))
(set! hyphen (ly:engraver-make-grob trans
'LyricHyphen
'())))))
(acknowledgers
(lyric-syllable-interface
. ,(lambda (trans grob source)
;; if a hyphen has been created, set the first
;; syllable acknowledged as its right bound
(and (ly:spanner? hyphen)
(ly:spanner-set-bound! hyphen RIGHT grob))))
(stanza-number-interface
. ,(lambda (trans grob source)
;; if a hyphen has been created, set the stanza
;; as its left bound
(and (ly:spanner? hyphen)
(ly:spanner-set-bound! hyphen LEFT grob)))))
(stop-translation-timestep
. ,(lambda (trans)
;; clear hyphen at end of first timestep
(and hyphen
(set! hyphen '())))))))
<<
\new Voice = melody \relative c' {
c2 c
}
\new Lyrics \with {
stanza = #"Pro"
% make stanza look like a lyric syllable
\override StanzaNumber #'font-size = #1
\override StanzaNumber #'font-series = #'bold-narrow
% tweak stanza position to match lyric spacing
\override StanzaNumber #'X-offset = #-5.8
\consists #stanza-lyric-hyphen-engraver
}
\lyricsto melody {
phe -- ten
}
>>
Cheers,
Neil
<<attachment: propheten.png>>
_______________________________________________ lilypond-user mailing list [email protected] http://lists.gnu.org/mailman/listinfo/lilypond-user
