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: Mon, 25 May 2015 22:24:01 +0000

The additional copies of the stencils do make the PDF files noticeably
larger.  8% larger when I used 16-copy whiteout around all dynamics and
text marks in a string quartet score.

The compilation time increased by 2%, desipte the repeated computations
of sines and cosines.

With \pointAndClickOn, the file-size increased by 30% when putting the
new white-out on dynamics and text marks.  Each copy of the stencil gets
a grob-cause mark, and these take up a lot of space.

If we use this for the built-in Xx.whiteout=##t we would have to
re-order the operations in grob.cc:get_print_stencil() so that the
'whiteout option is applied before 'color and 'grob-cause are added.


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#newcode749
scm/stencil.scm:749: (ly:stencil-extent stil Y))))))
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.

        (let* ((stil-expr (ly:stencil-expr stil))
               (clean-stil (ly:make-stencil
                             (if (and (pair? stil-expr)
                                      (eq? (car stil-expr) 'color))
                               (caddr stil-expr)
                               stil-expr)))
               (whiteout-stil (stencil-with-color
                                (radial-plot offset clean-stil
empty-stencil)
                                color)))
          (ly:stencil-add
            (ly:make-stencil `(delay-stencil-evaluation
                                ,(delay (ly:stencil-expr
whiteout-stil))))
            stil)))))

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

reply via email to

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