lilypond-user
[Top][All Lists]
Advanced

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

Custom TimeSignature doesn't scale correctly


From: Karol Majewski
Subject: Custom TimeSignature doesn't scale correctly
Date: Thu, 16 Jul 2015 20:18:24 +0200

Hi,

I use the following code for changing TimeSignature font. But when it comes to 
changeing staff size via 'magstep', the TimeSignature doesn't scale correctly. 
It seems that baseline-skip remains the same. How can I fix this?


-- Karol


%%%%%% BEGIN %%%%%%%%

\version "2.19.22"

#(define
  (customTimeSignature grob)
  (let*
    ((fraction
        (ly:grob-property grob 'fraction))
      (num
        (car fraction))
      (denom
        (cdr fraction)))
    (grob-interpret-markup grob #{
      \markup {
        \translate #'(0 . 0.03) \override #'(font-name . "Times") \fontsize 
#2.5 \override #'(baseline-skip . 2) \center-column {
          \line {
            #(number->string num)
          }
          \line {
            #(number->string denom)
          }
        }
      }
    #})))

\layout {
  \context {
    \Score
    \override TimeSignature.stencil = #customTimeSignature
  }
}

one = {
  \time 3/4 c'2.
}

two = {
  c'2.
}

<<
  \new Staff \with {
    fontSize = #-3
    \override StaffSymbol.staff-space = #(magstep -3)
  } \one
  \new Staff \two
>>

%%%%%% END %%%%%%%

Attachment: tsig.png
Description: PNG image


reply via email to

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