Knut Petersen <knut_peter...@t-online.de> writes: >> // A markup property whiteout-markup-wzd is implemented. >> // The following definition is used for that property: >> // \markup { \with-dimensions #'(0 . 0) #'(0 . 0) { >> // \filled-box #'(0.0 . 1.0) #'(-0.5 . 0.5) #0.0 } } >> SCM properties = Font_interface::text_font_alist_chain (me); >> SCM ws_zd_mod = Text_interface::interpret_markup ( >> me->layout ()->self_scm (), >> properties, >> me->get_property ("whiteout-markup-wzd")); >> Stencil wsa = *unsmob<Stencil> (ws_zd_mod); >> > >> // The following three lines should give an equivalent definition: >> Box wb (Interval (0.0, 1.0), Interval (-0.5, 0.5)); >> Stencil wsb (Lookup::round_filled_box (wb, 0)); >> wsb.set_empty(false); > > The difference between Stencil wsa and wsb is that \markup { \withdimensions > #'(0 . 0) #'(0 . 0) ...} > not only sets the dimensions : > > (define-markup-command (with-dimensions layout props x y arg) > (number-pair? number-pair? markup?) > #:category other > " > @cindex setting extent of text objects > > Set the dimensions of @var{arg} to @var{x} and@tie{}@var{y}." > (let* ((expr (ly:stencil-expr (interpret-markup layout props arg)))) > (ly:stencil-add > (make-transparent-box-stencil x y) > (ly:make-stencil > `(delay-stencil-evaluation ,(delay expr)) > x y))))
I think that is half of a red herring: apparently the delayed stencil evaluation is only used in order to sneak the stencil outline past the outline tracing code in lily/stencil-integral.cc. And that apparently causes the dimensions to be totally ignored, so a transparent box is pasted on top. What a steaming heap of something. So your code would likely have worked in LilyPond 2.16. I think it would make sense to create a new type of stencil expression explicitly intended to bypass outlining. Probably by just containing _two_ stencils: one for typesetting, one for outlining. That would make for a much more transparent manner of programming things like that. -- David Kastrup _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel