[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using path expressions to override stencils
From: |
Thomas Morley |
Subject: |
Re: Using path expressions to override stencils |
Date: |
Tue, 16 Feb 2016 21:40:48 +0100 |
2016-02-16 19:40 GMT+01:00 Paul Booker <address@hidden>:
> Paul Morris <paul <at> paulwmorris.com> writes:
>
>>
>> > On Feb 16, 2016, at 8:35 AM, Paul Booker <Paul <at> homebass.net> wrote:
>> >
>> > I've only narrowed the problem down to the function
>>
>> Hi Paul, Can you send a full but tiny example that we can run/test with
> LilyPond? See:
>>
>> http://lilypond.org/tiny-examples.html
>>
>> That will make it easier to see what’s going on.
>>
>> -Paul
>> _______________________________________________
>
> Thanks Paul
> Good point. I should also offer the full path of the error message:
>
>
> /home/gub/NewGub/gub/target/mingw/src/lilypond-git.sv.gnu.or
> g--lilypond.git-release-unstable/lily/grob-property.cc,
> Line 243
>
> Expression:scm_is_null (value) || scm_is_eq (value, marker)
>
> The tiny example here is taken from LSR 623, and you can uncomment the line
> in the "music" variable which switches between overrides to invoke the error.
> I've included (commented out) the original scaled staves which demonstrate
> the capacity of the function:
>
> \version "2.19.36"
> customClefStencil =
> #(ly:make-stencil
> `(path 0.1
> `(moveto 0 0
> curveto 0 1 0.7 2.5 1.5 1.5
> lineto 1.5 -3
> closepath)
> 'round
> 'round
> #t)
> (cons 0 1.5)
> (cons -3 2))
> scaleCustomClefStencil =
> #(lambda (grob)
> (let* ((sz (ly:grob-property grob 'font-size 0.0))
> (mult (magstep sz)))
> (set! (ly:grob-property grob 'stencil)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Here you set the stencil-property.
> (ly:stencil-scale
> customClefStencil
> mult mult))))
> music =
> \relative c' {
> \override Staff.Clef.stencil = \customClefStencil
> %\override Staff.Clef.stencil = \scaleCustomClefStencil
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Here you try to do it again.
But \scaleCustomClefStencil returns #<unspecified>!!
This will be visible if you look at the output of:
\override Staff.Clef.stencil =
#(lambda (grob)
(display (scaleCustomClefStencil grob))
point-stencil)
> c1 g1
> }
> \new Staff
> \music
>
> %{
> <<
> \new Staff \with {
> fontSize = #-3
> \override StaffSymbol.staff-space = #(magstep -3)
> \override StaffSymbol.thickness = #(magstep -3)
> }
> \music
> \new Staff
> \music
> \new Staff \with {
> fontSize = #2
> \override StaffSymbol.staff-space = #(magstep 2)
> \override StaffSymbol.thickness = #(magstep 2)
> }
> \music
> >>
> %}
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user
Try instead:
scaleCustomClefStencil =
#(lambda (grob)
(let* ((sz (ly:grob-property grob 'font-size 0.0))
(mult (magstep sz)))
(ly:stencil-scale
customClefStencil
mult mult)))
music =
\relative c' {
\override Staff.Clef.stencil = \scaleCustomClefStencil
c1 g1
}
The LSR-snippet is wrong in this regard.
But 2.18.2 was more lax tolerating such things than new devel-versions.
I'll correct the LSR-snippet.
Cheers,
Harm