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: k-ohara5a5a
Subject: Re: add stencil-whiteout-outline function (issue 236480043 by address@hidden)
Date: Sun, 24 May 2015 22:56:43 +0000

We certainly want this in LilyPond, and for it to be easy to use.

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.

Those users who want whiteout with different parameters could use the
function explicitly
  \override Staff.TimeSignature.stencil =
   #(lambda (grob)
     (stencil-whiteout-outline
       (ly:time-signature::print grob)
       0.7 cyan 45 1))


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))
The angle-increments seem more effective than radial-increments for
creating a filled-in shadow.  Glyphs are built mostly from lines, and a
smooth circular sweep of the lines is quite effective.  We would need
radial-increments to fill in the donut around things like stacatto dots,
but only if the offset is more than the dot-diameter -- more than
0.5staff-space plus the dot diameter before we notice a staff-line peek
through the hole.
I am so far happy testing (angle-increments 16) (radial-increments 1)
with 16 copies instead of 36.

https://codereview.appspot.com/236480043/diff/1/scm/stencil.scm#newcode749
scm/stencil.scm:749: (ly:stencil-extent stil Y))))))
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)))))

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



reply via email to

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