\version "2.18.0" 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 % some "global" overrides \override TextScript.font-size = \absFontSize #16 \override LyricText.font-size = \absFontSize #7 \override InstrumentName.font-size = \absFontSize #24 \override BarNumber.font-size = \absFontSize #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.font-size = \absFontSize 40 \once \override TextScript.font-size = \absFontSize 30 \once \override Score.LyricText.font-size = \absFontSize 40 \once \override Score.LyricText.stencil = #(lambda (grob) (let* ((lyr (ly:grob-property grob 'text)) (stil (lyric-text::print grob)) (stil-ref (grob-interpret-markup grob (markup #:with-color red #:abs-fontsize 40 lyr)))) ; store lyric-text stencil and lyric markup (ly:parser-define! parser 'lyrstil stil) (ly:parser-define! parser 'lyrmup lyr) (ly:stencil-add stil stil-ref))) \repeat unfold 6 \relative c'' { bes4^"World" a c b } } \addlyrics { \repeat unfold 25 { B A C H } } % create a markup from stored lyric stencil and markup #(define-markup-command (debug layout props)() (ly:stencil-add lyrstil (interpret-markup layout props (markup #:with-color red #:abs-fontsize 40 lyrmup)))) \markup { \debug }