lilypond-user
[Top][All Lists]
Advanced

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

Re: Creating a stencil from a markup


From: David Nalesnik
Subject: Re: Creating a stencil from a markup
Date: Wed, 14 Dec 2016 14:57:52 -0600

Hi Simon,

On Wed, Dec 14, 2016 at 2:20 PM, Simon Albrecht <address@hidden> wrote:
> Hello everybody,
>
> I’d like to add a caesura sign on top of a barline by modifying the
> barline’s stencil. Here’s my attempt:
>
> %%%%%%%%%%%%%%%%%%
> \version "2.19.49"
>
> {
>   1
>   \once\override BarLine.stencil =
>   #(ly:stencil-combine-at-edge
>      ly:bar-line::print
>      1 ; y-axis
>      1 ; on top
>      (interpret-markup layout props (make-musicglyph-markup
> "scripts.caesura.curved"))
>      2) %padding
>   1
> }
> %%%%%%%%%%%%%%%%%%
>
> However, layout is an unbound variable here (and so is props, I assume). How
> to do it correctly?
>

Try:

{
  1
  \once\override Staff.BarLine.stencil =
  #(lambda (grob)
     (let ((layout (ly:grob-layout grob)))
       (ly:stencil-combine-at-edge
        (ly:bar-line::print grob)
        1 ; y-axis
        1 ; on top
        (interpret-markup
         layout
         (ly:grob-alist-chain grob (ly:output-def-lookup layout
'text-font-defaults))
         (make-musicglyph-markup "scripts.caesura.curved"))
        2))) %padding
  1
}

Best,
David



reply via email to

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