So... I discovered that the TimeSignature issue is related to the fact that it is not being written as text to the svg file, but as a path.
If I use this code I can create a svg file with different fonts for the time signature, overriding the stencil with a text:
%%%%%% BEGIN CODE 1
\score {
\new Staff {
\once \override Staff.TimeSignature.stencil = #ly:text-interface::print
\once \override Staff.TimeSignature.text = \markup {
\override #'(font-name . "Helvetica")
\override #'(baseline-skip . 0.2)
\fontsize #4
\column { "3"
"4"
}}
\time 2/4
c2
}
}
%%%%%% END CODE 1
It works, but I'm struggling here to change the text of the time signature automatically with a scheme function. Tried the code below, but it does not work (giving me exactly the same error dump of my previous message). Any suggestions?
%%%%%% BEGIN CODE 2
#(define-public (tsigastext grob)
(let* ((frac (ly:grob-property grob 'fraction))
(num (if (pair? frac) (car frac) 4))
(den (if (pair? frac) (cdr frac) 4))
(m (markup
#:override '(font-name . "Helvetica")
#:override '(baseline-skip . 0.5)
#:fontsize 4
#:center-column (#:number (number->string num)
#:override '(style . default)
#:number (number->string den)
))))
(ly:grob-set-property! grob 'stencil ly:text-interface::print)
(grob-interpret-markup grob m)))
\score {
\new Staff {
\override Staff.TimeSignature.stencil = #tsigastext
\time 2/4
c2
%%% \override Staff.TimeSignature.stencil = #(lambda (grob)
%%% (parenthesize-stencil (ly:time-signature::print grob) 0.1 0.4 0.4 0.1 ))
\time 3/4
c2
}
}
%%%%%% END CODE 2
thanks!