lilypond-user
[Top][All Lists]
Advanced

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

Re: Peculiar behavior of barlines


From: Thomas Morley
Subject: Re: Peculiar behavior of barlines
Date: Sun, 22 Mar 2020 16:27:46 +0100

Am Sa., 21. März 2020 um 14:26 Uhr schrieb Sami Amiris <address@hidden>:
>
> Thank you for the suggestion once again.
>
> I thank you for having spent some time on it. The whole idea is to create a
> mirror image of the compound barline on the beginning of the example, which
> means that they must align to the right, not to the left. Now it is a copy
> of the system at the beginning, and you can also get there  inserting a
> space in the barline definition of the \bar"||-!", without needing the
> actual movement.
>
> I have tried moving the lower and middle portion of the barline so as to
> force the program to build the compound barline correctly, but so far it
> simply makes the dotted portion disappear. I believe the problem is that
> with the solid barline, the program seems to count distances from the left
> side of the construct rather than the right when alligning it with other
> barlines in the same part of the system. I am not sure as I haven't seen the
> source code (and most probably wouldn't see it if it hit me in the face with
> a 10-foot pole tbh, I need to brush up my programming skills a few thousand
> parsecs to match), but this is a "phenomenological" interpretation of the
> facts, if you like. It "seems" to count distances from the left. However, I
> could VERY EASILY be wrong, and by all means I hope I am.
>
> Thanks again!
>
> S.A.

Instead of manually applying X-offset-overrides you may try:

#(define end-of-line-right-aligned-sencil
  (lambda (grob)
    (let* ((break-dir (ly:item-break-dir grob))
           (basic-props (ly:grob-basic-properties grob))
           (stil-proc (assoc-get 'stencil (reverse basic-props)))
           (stil
             (if (procedure? stil-proc)
                 (stil-proc grob)
                 point-stencil)))

      (if (negative? break-dir)
          (ly:stencil-aligned-to stil X RIGHT)
          stil))))


\layout {
  \context {
    \Score
    \override SpanBar.stencil = #end-of-line-right-aligned-sencil
  }
  \context {
    \Staff
    \override BarLine.stencil = #end-of-line-right-aligned-sencil
  }
}

Should do the trick in most cases.

Cheers,
  Harm



reply via email to

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