lilypond-user
[Top][All Lists]
Advanced

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

Re: Markup in absolute font size?


From: Nicolas Sceaux
Subject: Re: Markup in absolute font size?
Date: Sat, 28 Jun 2008 19:41:18 +0200


Le 28 juin 08 à 18:11, Nicolas Sceaux a écrit :

Le 28 juin 08 à 17:18, Reinhold Kainhofer a écrit :

Is there any way to specify the fontsize for a markup in absolute size? In particular, the markup (title page for A4, defined in an in external include file) should always use the same font size, irrespective of the global staff
size.
This way, I can define one nice title page and use that for all scores,
although e.g. a full score will use a much smaller staff size than an
instrumental score.

The \fontsize only changes the relative size, but does not allow one to set an
absolute size.

It seems that the following command does what you want, but I
have not much tested it:

#(define-markup-command (abs-fontsize layout props size arg)
 (number? markup?)
 (let* ((ref-size (ly:output-def-lookup layout 'text-font-size 12))
        (magnification (/ size ref-size))
        (font-size (magnification->font-size magnification)))
(interpret-markup layout (cons `((baseline-skip . ,(* magnification (chain-assoc-get 'baseline-skip props 2))) (word-space . ,(* magnification (chain-assoc-get 'word-space props 1)))
                                   (font-size . ,font-size))
                            props)
   arg)))

%%#(set-global-staff-size 12)
#(set-global-staff-size 20)
\markup \abs-fontsize #12 { Toto titi tutu blah blah }

oops, baseline-skip and word-space should also be fixed absolutely, and
not based on the ones from props.





reply via email to

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