lilypond-user
[Top][All Lists]

## Re: Using path expressions to override stencils

 From: Paul Morris Subject: Re: Using path expressions to override stencils Date: Tue, 16 Feb 2016 23:16:48 -0500

```Hi Paul,

If you are using 2.19 you might want to use "make-path-stencil” instead.  (It
is not in 2.18 and so not in the LSR yet. Although maybe we should add it
commented out?)  It calculates the extents of the stencil for you so you don’t
have to specify them.  See below.

Cheers,
-Paul

\version "2.19.36"

customClefStencilOne =
#(ly:make-stencil
`(path 0.2
`(rmoveto 0 0
rcurveto 0 0.75 1 0.75 1 0
rcurveto 0 -0.75 -1 -0.75 -1 0
rcurveto -1 0 -1 1.5 -0.5 1.5
rmoveto 0.5 -1.5
rcurveto -1 0 -1 -1.5 -0.5 -1.5
rmoveto 0.5 1.5
rmoveto 1 0
rcurveto 2.5 0 2.5 4 4 4
rmoveto -4 -4
rcurveto 2.5 0 2.5 -4 4 -4))
(cons -0.5 1)
(cons -3 5))

customClefStencilTwo =
#(make-path-stencil
'(rmoveto 0 0
rcurveto 0 0.75 1 0.75 1 0
rcurveto 0 -0.75 -1 -0.75 -1 0
rcurveto -1 0 -1 1.5 -0.5 1.5
rmoveto 0.5 -1.5
rcurveto -1 0 -1 -1.5 -0.5 -1.5
rmoveto 0.5 1.5
rmoveto 1 0
rcurveto 2.5 0 2.5 4 4 4
rmoveto -4 -4
rcurveto 2.5 0 2.5 -4 4 -4)
0.2 ;; line thickness
1 ;; x-axis scaling factor
1 ;; y-axis scaling factor
#f ;; filled path or not?
)

\markup \stencil #customClefStencilOne
\markup " "
\markup " "
\markup \stencil #customClefStencilTwo

```