Carl Testa wrote:
Is there a way to define how big a stencil is
In your case, using ly:make-stencil, the parameters xext and yext
are for saying how big, and you have done this OK.
The problem is that these values don't get to affect the layout,
because the overridden rest is still showing its original extents.
These are still being set up by functions ly:rest::width and ly:rest::height.
See http://lilypond.org/doc/v2.12/Documentation/user/lilypond-internals/Rest
To change this, you can set the these extents directly, e.g.
\once \override Staff.Rest #'X-extent = #(cons -3 10)
The attached replaceRest.ly does this in a less unwieldy way.
Temporarily changing the call to \ReplaceRest lets you *see* the size.
Cheers,
RobinreplaceRest = #(define-music-function (parser location stil) (ly:stencil?)
#{
\once \override Staff.Rest #'stencil = $stil
\once \override Staff.Rest #'X-extent = #(ly:stencil-extent $stil X)
\once \override Staff.Rest #'Y-extent = #(ly:stencil-extent $stil Y)
#})
ReplaceRest = #(define-music-function (parser location stil) (ly:stencil?)
((ly:music-function-extract replaceRest)
parser location (box-stencil stil 0 0))
)
openSquigStencil =
#(ly:make-stencil
`(path 0.3
`(rmoveto 0 -1
rcurveto 1 -4 4 4 8 -4
))
(cons 0 8)
(cons -5 -1)
)
\relative c' {
\clef "alto"
\cadenzaOn
c1 g1
c1 r1
c1 \replaceRest #openSquigStencil r1
c1 g1
}
_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user