Werner LEMBERG <w...@gnu.org> writes:

> Folks,
>
>
> is it possible to access markup properties like `baseline-skip` via
> \tweak?

Have you tried?

If it is a grob property...

> In the example below, I want to set the markup property `bar` as a
> tweak to influence `\foo`.

Check out the following example where I just add a few lines in front of
what you wrote:

#(define (define-grob-property symbol type? description)
  (if (not (equal? (object-property symbol 'backend-doc) #f))
      (ly:error (G_ "symbol ~S redefined") symbol))

  (set-object-property! symbol 'backend-type? type?)
  (set-object-property! symbol 'backend-doc description)
  symbol)

#(define-grob-property 'bar number? "Werner's specialty")

#(define-markup-command (foo-markup layout props) ()
   #:properties ((bar 10))
   (interpret-markup
    layout props
    #{
      \markup \fontsize #bar \natural
    #}))

foo =
#(define-music-function () ()
   #{
     \tweak parent-alignment-X #CENTER
     \tweak self-alignment-X #CENTER
     -\markup \foo-markup
   #})

{
  f'2-\foo
  f'2-\tweak bar #5 \foo     % This tweak (expectedly) fails.
}

-- 
David Kastrup

Reply via email to