// 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))))
Knut
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel