[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Absolute font-size for TextScript
From: |
Kieren MacMillan |
Subject: |
Re: Absolute font-size for TextScript |
Date: |
Tue, 2 Jun 2020 17:18:56 -0400 |
Hi Paolo,
> how exactly do I have to call \absFontSize
%%%%
\version "2.19.83"
allowGrobCallback =
#(define-scheme-function (parser location syms) (symbol-list?)
(let ((interface (car syms))
(sym (cadr syms)))
#{
\with {
\consists #(lambda (context)
`((acknowledgers .
((,interface . ,(lambda (engraver grob
source-engraver)
(let ((prop (ly:grob-property grob
sym)))
(if (procedure? prop)
(ly:grob-set-property! grob sym (prop grob)))
))))
))
)
}
#}))
absFontSize =
#(define-scheme-function (parser location pt)(number?)
(lambda (grob)
(let* ((layout (ly:grob-layout grob))
(ref-size (ly:output-def-lookup (ly:grob-layout grob)
'text-font-size 12)))
(magnification->font-size (/ pt ref-size))
)))
% LilyBin
\score {
{ c'1^"foobar" d'2-> \once \override Script.font-size = \absFontSize #72 2->
}
\layout {
\context {
\Score
\allowGrobCallback font-interface.font-size
\override TextScript.font-size = \absFontSize #22
}
}
}
%%%%
Hope that helps!
Kieren.
________________________________
Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: info@kierenmacmillan.info