[Top][All Lists]

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

Re: How to deal with Time Signatures horizontal alignment?

From: Neil Puttock
Subject: Re: How to deal with Time Signatures horizontal alignment?
Date: Thu, 30 Aug 2007 18:16:15 +0100

Hi Valentin,

On 8/29/07, Valentin Villenave <address@hidden> wrote:

OK, so just to sum up the situation: I now have TimeSignatures aligned
with barlines, which is fine for the topmost TimeSig, but not for the
"internals" ones between each StaffGroup (since, when occuring at the
beginning of a system, they collide with the left barline).

It sort of works, so I guess this thread is now closed.

Hopefully it's got a second wind. ;)

Whilst searching for a solution to a rehearsal mark problem, I stumbled upon this interesting function in output-lib.scm, which might help:

(define-public (shift-right-at-line-begin g)
  "Shift an item to the right, but only at the start of the line."
  (if (and (ly:item? g)
       (equal? (ly:item-break-dir g) RIGHT))
      (ly:grob-translate-axis! g 3.5 X)))

It shifts rehearsal marks to the right at the beginning of a system.

You can use this for overriding the after-line-breaking property of TimeSignature. Obviously, if you'd prefer a different offset, you can copy this function and rename it.

\context {
   \type "Engraver_group"
   \consists "Time_signature_engraver"
   \consists "Axis_group_engraver"
   \name "TimeSig"
   \override TimeSignature #'font-size = #3
   \override TimeSignature #'break-align-symbol = ##f
   \override TimeSignature #'X-offset
   = #ly:self-alignment-interface::x-aligned-on-self
   \override TimeSignature #'self-alignment-X = #0
   \override TimeSignature #'after-line-breaking = #shift-right-at-line-begin

reply via email to

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