[Top][All Lists]

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

Re: Vertical spacing of numeric time signature

From: Malte Meyn
Subject: Re: Vertical spacing of numeric time signature
Date: Thu, 9 May 2019 19:02:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Am 09.05.19 um 16:53 schrieb address@hidden:
Is there any simple way to modify the vertical spacing between numerator
and denominator in a numeric time signature?

Not really simple. But it can be done by redefining the stencil:

\version "2.21.0"

#(define (fraction-with-gap gap)
   (lambda (grob)
     (let* ((frac (ly:grob-property grob 'fraction))
            (num (car frac))
            (den (cdr frac))
            (fontsize (magnification->font-size (/ (- 4 gap) 4)))
            (baseline-skip (+ 2 (/ gap 2)))
            (m (markup
                #:fontsize fontsize
                #:override `(baseline-skip . ,baseline-skip)
                 #:center-column (#:number (number->string num)
                                   #:number (number->string den)))))
       (grob-interpret-markup grob m))))

% The number 0.5 can be changed. It’s the size of the gap in staff-spaces.
  \override Staff.TimeSignature.stencil = #(fraction-with-gap 0.5)
  \time 3/4
  \time 5/4

reply via email to

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