[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tweaks don't apply to post-function grob
From: |
Kieren MacMillan |
Subject: |
tweaks don't apply to post-function grob |
Date: |
Mon, 14 Aug 2017 22:22:48 -0400 |
Hi all,
In the snippet below, I want to tweak a dynamic grob created using Shevek's
dynText function (cf.
http://lists.gnu.org/archive/html/lilypond-user/2017-07/msg00043.html). But
unfortunately, tweaks don't seem to affect it.
How can I change the function such that I can still apply tweaks (X-offset,
self-alignment-X, etc.) to the combined dynamic-text grob "at runtime"?
Thanks,
Kieren.
%%% SNIPPET BEGINS
\version "2.19.64"
dynText = #(define-event-function (parser location dyn expr)
(markup? markup?)
(let* (
(mark #{ \markup { \dynamic $dyn \hspace #0.2 \normal-text
\fontsize #0.625 \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-\tweak self-alignment-X #RIGHT \dynText "mp" "test" }
%%% SNIPPET ENDS
________________________________
Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: address@hidden
- tweaks don't apply to post-function grob,
Kieren MacMillan <=
- Re: tweaks don't apply to post-function grob, David Kastrup, 2017/08/15
- Re: tweaks don't apply to post-function grob, Kieren MacMillan, 2017/08/15
- Re: tweaks don't apply to post-function grob, David Kastrup, 2017/08/15
- Re: tweaks don't apply to post-function grob, Kieren MacMillan, 2017/08/15
- Re: tweaks don't apply to post-function grob, David Kastrup, 2017/08/15
- Re: tweaks don't apply to post-function grob, Kieren MacMillan, 2017/08/15
- Re: tweaks don't apply to post-function grob, David Kastrup, 2017/08/15
- Re: tweaks don't apply to post-function grob, Kieren MacMillan, 2017/08/15
- Re: tweaks don't apply to post-function grob, David Kastrup, 2017/08/15
- Re: tweaks don't apply to post-function grob, Kieren MacMillan, 2017/08/15