[Top][All Lists]

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

Re: Draw a line on the X reference point of a grob

From: Paolo Prete
Subject: Re: Draw a line on the X reference point of a grob
Date: Sun, 19 Jan 2020 22:50:42 +0100

In 2.18, the NoteHead is considered the X parent of the DynamicText. 
However, in 2.19, the NoteColumn is the parent.  NoteColumn does not
have an existing stencil to overlay, so the \stencil markup command
fails.  Here's a version that supplies a dummy stencil:

\version "2.18.2"
    \once \override DynamicText.after-line-breaking = #(lambda (grob)
      (let* ((x-parent (ly:grob-parent grob X))
             (orig-sten (ly:grob-property x-parent 'stencil
                          (ly:make-stencil '()))))
        (ly:grob-set-property! x-parent 'stencil
          (grob-interpret-markup x-parent #{
             \markup \combine \stencil #orig-sten
               \with-dimensions #'(0 . 0) #'(0 . 0) \vcenter
               \with-color #red \draw-line #'(0 . 6) #}))))

THANKS again. It's very useful and should be added to LSR (otherwise it's not clear where exactly is the ref X point of the grob).
Note, in fact, that X-offset must be reset in order to be used (otherwise high risk of random results):

\once \override DynamicText.X-offset = 0  

From where does the default offset come from?

reply via email to

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