lilypond-user
[Top][All Lists]
Advanced

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

Re: Change text font size globally


From: Kieren MacMillan
Subject: Re: Change text font size globally
Date: Mon, 2 Sep 2024 08:37:00 -0400

Hi all!

I’m curious… For years I’ve been using the following snippet for absolute font 
sizing:

%%%
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))
       )))

\layout {
  \context {
    \Score
    \allowGrobCallback font-interface.font-size
  }
}
%%%

I believe I $pon$sored it a decade or so ago (cf. 
https://lists.gnu.org/archive/html/lilypond-user/2016-02/msg00023.html).

Questions:

1. What’s the difference between “my” function and this new one?

2. Do we need all of these different absolute-fontsize functions? Can’t we have 
one that Does All The Right Things™?

3. Does it make sense to get at least one of these into the main codebase, 
instead of having them all floating around in the ether[net]?

Thanks,
Kieren.
______________________________________________

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




reply via email to

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