lilypond-devel
[Top][All Lists]
Advanced

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

Re: add stencil-whiteout-outline function (issue 236480043 by address@hi


From: paulwmorris
Subject: Re: add stencil-whiteout-outline function (issue 236480043 by address@hidden)
Date: Wed, 27 May 2015 00:01:00 +0000

Thanks for the reviews.

On 2015/05/24 22:56:44, Keith wrote:
I think whiteout-stencil should simply call this function, with the
defaults
suggested, so that the existing
\set Xx.whiteout=##t and \markup\whiteout use this new method.

We could provide access to the old whiteout method with
\set Xx.block-whiteout and \markup\block-whiteout
for the former extent-based whiteout.

Sounds good to me.  In that case... would it make sense to name this new
function "stencil-whiteout" so that it replaces the current function,
and then the current function could be renamed "stencil-box-whiteout" or
similar?  Then we would have:

\set Xx.box-whiteout \markup \box-whiteout

I like "box" rather than "block" since "block" can more easily be
misread as a verb and "box" is shorter.




https://codereview.appspot.com/236480043/diff/1/scm/stencil.scm
File scm/stencil.scm (right):

https://codereview.appspot.com/236480043/diff/1/scm/stencil.scm#newcode700
scm/stencil.scm:700: (angle-increments 12) (radial-increments 3))
On 2015/05/24 22:56:43, Keith wrote:
I am so far happy testing (angle-increments 16) (radial-increments 1)
with 16
copies instead of 36.

I tried this out, and found it to work well, even on glyphs with thin
lines like treble clef and time signatures.

https://codereview.appspot.com/236480043/diff/1/scm/stencil.scm#newcode749
scm/stencil.scm:749: (ly:stencil-extent stil Y))))))
On 2015/05/24 22:56:43, Keith wrote:
The whiteout-stencil still affects the position of objects outside the
staff,
because LilyPond uses the outlines stencils (not extents) for several
spacing
tasks.

There are other situations (\page-ref and \with-dimensions) where we
need one
stencil for spacing, and another for final printing, so we delay the
formation
of the final-printing stencil.   That method seems appropriate here as
well:

          (let ((whiteout-expr
                 (ly:stencil-expr
                  (stencil-with-color
                   (radial-plot offset stil empty-stencil)
                   color))))
           (ly:stencil-add
             (ly:make-stencil
               `(delay-stencil-evaluation ,(delay whiteout-expr)))
             stil)))))

Thanks.  I was not aware of this, but glad there's an easy fix.

https://codereview.appspot.com/236480043/diff/1/scm/stencil.scm#newcode749
scm/stencil.scm:749: (ly:stencil-extent stil Y))))))
On 2015/05/25 22:24:01, Keith wrote:
When I tried making stencil-whitéout' call the new improved function,
I had
trouble with
   \override Staff.Clef.whiteout = ##t
   \override Staff.Clef.color = #red
the whiteout was also red because the code in grob.cc applies the
color before
handing the stencil to stencil-whiteout-outline, and in composed
stencils with
color applied at different levels, the innermost 'color applies.

I added code to remove any 'color at top-level so I can continue using
this.
Ideally we would want code to remove any 'color from the stencil
before using it
as whiteout, but it might be more appropriate to apply 'whiteout
before 'color
in grob.cc.

I am not that comfortable working in the C++ side of things, so if we go
that route (and that sounds like the better approach) I won't be much
help.

https://codereview.appspot.com/236480043/

reply via email to

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