Message: 4
Date: Thu, 2 May 2013 13:25:12 -0500
From: David Nalesnik <
address@hidden>
To: Jun Wang <
address@hidden>
Cc: "
address@hidden" <
address@hidden>
Subject: Re: Lyrics and Punctuations Alignment Issue?
Message-ID:
<CANn-nXmZ_xwYHC9SC7Eesz3i1KnmrirQm5Pb_pX4aqdGKdD=
address@hidden>
Content-Type: text/plain; charset="utf-8"
Oops,
Attached wrong version.
\version
"2.16"
#(define (align grob)
(let* ((stil (ly:grob-property grob 'stencil))
(stil-X (ly:stencil-extent stil X))
(text (ly:grob-property grob 'text))
(punct-R (char-set #\, #\" #\; #\! #\. #\space))
(punct-L (char-set #\"))
; determine X-extent of text stencil without punctuation at end
(text-L (string-trim-right text punct-R))
(text-L-stil (grob-interpret-markup grob text-L))
(text-L-stil-X (ly:stencil-extent text-L-stil X))
(displacement (/ (- (cdr text-L-stil-X) (cdr stil-X)) 2))
; determine X-extent of text stencil without punctuation at start
(text-R (string-trim text punct-L))
(text-R-stil (grob-interpret-markup grob text-R))
(text-R-stil-X (ly:stencil-extent text-R-stil X))
(displacement (+ displacement
(/ (- (cdr stil-X) (cdr text-R-stil-X)) 2))))
(- (ly:self-alignment-interface::aligned-on-x-parent grob)
displacement)))
\paper {
ragged-right = ##f
}
\relative c' {
\time 3/4 e4 e4. e8
d4 e d c2.
}
\addlyrics {
\override LyricText #'X-offset = #align
"\"\"\"I!!!!!!!!!!!!" am,,,,,,,,,, so
lone -- "ly!!!!!,\"" said "she !!!!!!!!!!!!!!!\""
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <
http://lists.gnu.org/archive/html/lilypond-user/attachments/20130502/ab4ad73c/attachment.html>
------------------------------
_______________________________________________
lilypond-user mailing list
address@hiddenhttps://lists.gnu.org/mailman/listinfo/lilypond-userEnd of lilypond-user Digest, Vol 126, Issue 13
**********************************************