Am 11.08.2016 um 09:54 schrieb Urs Liska:
manually editing Y-offset doesn't
seem like a good idea, as I don't have the impression there's an easy
relation that could be set up between font-size and Y-offset.
There is such a relation: The time signature in the Score context is
aligned to the top of the Score, in this case it’s the top of the treble
clef. So one has to offset by 1.75 (approximate height of treble clef
above the Staff) and two staff spaces scaled by font-size (because a
time signature digit is two staff spaces tall). See first example below.
This might break when there are other things that go above the treble clef.
Alternatively you can print the time signature in the topmost staff (if
you never remove it by \RemoveEmptyStaves) and set it’s Y-extent to
empty. See second example below.
Concerning your second wish in the comments: You can put \consists and
\remove into the \layout { \context { … } } blocks so you don’t have to
use \with.
%%%%%%%%%%%%%%%%%%%%% FIRST EXAMPLE
\version "2.19.46"
\layout {
tsfs = 15.3 % time signature font size
\context {
\Score
\consists Time_signature_engraver
\override TimeSignature.font-size = \tsfs
\override TimeSignature.X-extent = #'(0 . 0)
\override TimeSignature.space-alist.first-note = #'(fixed-space . 0)
\override TimeSignature.color = #'(0.8 0.8 0.9)
\override TimeSignature.layer = -1
\override TimeSignature.Y-offset =
#(-
(* -2 (magstep tsfs)) ; two staff spaces = one digit height
1.75) % height of treble clef above topmost staff line
}
\context {
\Staff
\remove Time_signature_engraver
}
}
\score {
\new StaffGroup <<
\new GrandStaff <<
\new Staff \relative c' {
\time 7/4
c1 c2.
\time 5/4
c2. c2
}
\new Staff \relative c {
\clef bass
c1 c2.
c2. c2
}
>>
\new Staff \relative c'' {
c1 c2. c2. c2
}
>>
}
%%%%%%%%%%%%%%%%%%%%% SECOND EXAMPLE
\version "2.19.46"
tsfs = 15.3 % time signature font size
\layout {
\context {
\Staff
\remove Time_signature_engraver
}
}
\score {
\new StaffGroup <<
\new GrandStaff <<
\new Staff \with {
\consists Time_signature_engraver
\override TimeSignature.font-size = \tsfs
\override TimeSignature.X-extent = #'(0 . 0)
\override TimeSignature.space-alist.first-note = #'(fixed-space
. 0)
\override TimeSignature.color = #'(0.8 0.8 0.9)
\override TimeSignature.layer = -1
\override TimeSignature.Y-offset =
#(-
2 ; 2 staff spaces because it’s normally center-aligned
(* 2 (magstep tsfs))) % two staff spaces = one digit height
\override TimeSignature.Y-extent = #'(+inf.0 . -inf.0)
}\relative c' {
\time 7/4
c1 c2.
\time 5/4
c2. c2
}
\new Staff \relative c {
\clef bass
c1 c2.
c2. c2
}
>>
\new Staff \relative c'' {
c1 c2. c2. c2
}
>>
}
%%%%%%%%%%%%%%%%%%%%% END
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user