lilypond-user
[Top][All Lists]
Advanced

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

Re: barline at end of staff


From: Wilbert Berendsen
Subject: Re: barline at end of staff
Date: Sat, 23 Mar 2013 15:26:13 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2

Op 16-03-13 17:35, Arno Rog schreef:
L.S.

I'm trying to figure out a way to place the last bar line exactly at the end of
the staff in the score of the Dutch anthem at 
http://lsr.dsi.unimi.it/LSR/Snippet?
id=648

Now it's done manually: \override Staff.BarLine #'extra-offset = #'(23 . 0)
\bar "|."
Can this be automatically (and correctly)?

Arno Rog


I used to use alignGrob for this. (See the LSR). But later I wrote this based on that:

endbar = {
  \overrideProperty #"Staff.BarLine" #'after-line-breaking
  #(lambda (grob)
     (let* ((sys (ly:grob-system grob))
            (staff (ly:grob-object grob 'staff-symbol))
            (half-thickness (/ (ly:staff-symbol-line-thickness staff) 2))
            (cur-x (cdr (ly:grob-extent grob sys X)))
            (new-x (cdr (ly:grob-extent staff sys X)))
            (xoff (+ half-thickness (- new-x cur-x))))
         (ly:grob-set-property! grob 'extra-offset (cons xoff 0))))
}

--
Wilbert Berendsen
http://www.wilbertberendsen.nl/




reply via email to

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