Hello,

Is there any way to change the font size of the "normal text" portion of mixed 
dynamic markings, independently from the font size of the dynamic portion? For 
example, in

   p dolce

I'd like to increase the size of 'dolce' without increasing the size of the 
'p'. I am using various functions to knit together dynamics and text, and I 
have various stylesheets (which use different fonts), so I'd rather not have to 
hard-code the scaling into each function and duplicate every function in each 
stylesheet.

Below is an example of one of the functions I use, and the current effect of 
increasing DynamicText.font-size (which is to increase the entire dynamic).

Thanks,
Kieren.

%%%%  SNIPPET BEGINS
\version "2.19"

dynText = #(define-event-function (parser location dyn expr)
             (markup? markup?)
             (let* (
                     (mark #{ \markup { \dynamic $dyn \hspace #0.2 \normal-text 
\italic $expr } #})
                     (offset (lambda (grob)
                               (let* (
                                       (layout (ly:grob-layout grob))
                                       (props (ly:grob-alist-chain grob
                                                (ly:output-def-lookup layout
                                                  'text-font-defaults)))
                                       (target-X-extent
                                        (ly:stencil-extent

                                         (ly:text-interface::interpret-markup 
layout props dyn)
                                         X))
                                       (width (abs
                                               (- (cdr target-X-extent) (car 
target-X-extent))))
                                       )
                                 (display target-X-extent)
                                 (- 1 (/ width 2))
                                 )
                               )
                       )
                     )
               #{
                 \tweak DynamicText.X-offset #offset
                 #(make-dynamic-script mark)
               #}
               )
             )

{ c''1\dynText "p" "dolce" }

{ \override DynamicText.font-size = #2 c''1\dynText "p" "dolce" }
%%%%  SNIPPET ENDS
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to