\version "2.16.1" % wrap all named properties in an abs-fontsize markup (if they are markups) #(define (abstext grob) ; a new property for absolute font-size ; lilypond complains about the unkown property, but you can ignore that for now (let ((abs-font-size (ly:grob-property grob 'abs-font-size #f))) ; if abs-font-size is set to a positive number ... (if (and (number? abs-font-size)(> abs-font-size 0)) ; ... wrap all markups found in the properties named by props (let ((props '(text long-text))) (define (wrap-text text) ; if text is a markup wrap it, otherwise do nothing (if (markup? text) (let ((wtext (markup #:abs-fontsize abs-font-size text))) ; we might do here more things(?) wtext) text)) (for-each ; for all declared properties ... (lambda (p) ; re/unset 'abs-font-size, so that markups are not wrapped twice ; ... we are listening to font-interface and text-interface (ly:grob-set-property! grob 'abs-font-size #f) ; set property to wrapped value (if it is a markup) (ly:grob-set-property! grob p (wrap-text (ly:grob-property grob p #f))) ) props) )))) % create an engraver with acknowledgers for text-interface and font-interface % TODO: do we need both? fontCheck = #(make-engraver (acknowledgers ((text-interface engraver grob source-engraver) ; run abstext on any grob implementing text-interface (abstext grob)) ((font-interface engraver grob source-engraver) ; run abstext on any grob implementing font-interface (abstext grob)) )) \layout { \context { \Score % "activate" acknowledgers \consists #fontCheck % some "global" overrides \override TextScript #'abs-font-size = #16 \override LyricText #'abs-font-size = #8 \override InstrumentName #'abs-font-size = #24 \override BarNumber #'abs-font-size = #18 } } % example Music \paper { % just to make the huge instrument name fit left-margin = 2\cm } \new Staff \with { instrumentName = "Melodie" shortInstrumentName = "Mel" } \new Voice { \repeat unfold 19 \relative c'' { bes4^"Hello" a c b } \break \once \override Score.BarNumber #'abs-font-size = #30 \once \override TextScript #'abs-font-size = #30 \repeat unfold 6 \relative c'' { bes4^"World" a c b } } \addlyrics { \repeat unfold 25 { B A C H } }