Hi David:

Thank you for the align grob.

The chinese character is double byte.  Please refer to lyric d & f : 
correspondent Chinese character to d is ok but the Chinese character at f is 
off a bit.  Is it possible to make f the same as d?  The difference at d the 
'," is single byte while at f the "o" is double byte.

Thank you for your help.
Ming.



>Message: 4
>Date: Thu, 2 May 2013 13:25:12 -0500
>From: David Nalesnik <[email protected]>
>To: Jun Wang <[email protected]>
>Cc: "[email protected]" <[email protected]>
>Subject: Re: Lyrics and Punctuations Alignment Issue?
>Message-ID:
>    <CANn-nXmZ_xwYHC9SC7Eesz3i1KnmrirQm5Pb_pX4aqdGKdD=0...@mail.gmail.com>
>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
>[email protected]
>https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
>End of lilypond-user Digest, Vol 126, Issue 13
>**********************************************
>
>
>

<<attachment: 2013-05-02_185416.png>>

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to