Re: scaling "normal text" font size inside dynamic
On Thu, Aug 3, 2017 at 6:45 AM, Kieren MacMillan-2 [via Lilypond] < ml+s1069038n204841...@n5.nabble.com> wrote: > > Just put \larger before \normal-text and it will respond to the > 'font-size property, but be at a larger point size than the rest of it. > > But the scaling factor is different depending on the font (x-height, etc.) > — so don't I have to do that *inside* each function, and therefore > duplicate each function in every stylesheet with a different font? I was > hoping there was a more elegant solution… > This is the unfortunate reality about fonts. I once tried to find a way by first making a non-printed markup of only the "x" character, getting its Y-extent, then scaling based on that, but I was never successful. Maybe someone else will have a better idea for you, aside from adding another input parameter for to pass in to the 'fontsize markup macro. Best, Abraham -- View this message in context: http://lilypond.1069038.n5.nabble.com/scaling-normal-text-font-size-inside-dynamic-tp204834p204843.html Sent from the User mailing list archive at Nabble.com.___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: scaling "normal text" font size inside dynamic
Hi Abraham, > Just put \larger before \normal-text and it will respond to the 'font-size > property, but be at a larger point size than the rest of it. But the scaling factor is different depending on the font (x-height, etc.) — so don't I have to do that *inside* each function, and therefore duplicate each function in every stylesheet with a different font? I was hoping there was a more elegant solution… Thanks, Kieren. 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
Re: scaling "normal text" font size inside dynamic
Hi, Kieren! On Wed, Aug 2, 2017 at 7:39 PM, Kieren MacMillan [via Lilypond] < ml+s1069038n204834...@n5.nabble.com> wrote: > 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. > Just put \larger before \normal-text and it will respond to the 'font-size property, but be at a larger point size than the rest of it. HTH, Abraham -- View this message in context: http://lilypond.1069038.n5.nabble.com/scaling-normal-text-font-size-inside-dynamic-tp204834p204836.html Sent from the User mailing list archive at Nabble.com.___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
scaling "normal text" font size inside dynamic
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