}
/* Calls the scheme procedure stencil-whiteout-box in scm/stencils.scm */
- if (!transparent && to_boolean (get_property ("whiteout-box")))
+ if (!transparent && (scm_is_number (get_property("whiteout-box"))
+ || to_boolean (get_property ("whiteout-box"))))
{
+ Real thickness = robust_scm2double (get_property("whiteout-box"), 0.0)
+ * layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
retval = *unsmob<Stencil>
- (Lily::stencil_whiteout_box (retval.smobbed_copy ()));
+ (Lily::stencil_whiteout_box (retval.smobbed_copy (),
+ scm_from_double (thickness)));
}
if (transparent)
multiple of the staff-line thickness. For compatibility with former
behavior (now available with @code{whiteout-box}) the value @code{#t} is
treated as @code{3.0}. Usually @code{#f} by default.")
- (whiteout-box ,boolean? "If true, the grob is printed over a
-rounded rectangular white background to white-out underlying material,
-if the grob is visible. Usually @code{#f} by default.")
+ (whiteout-box ,boolean-or-number? "If a number or true, the grob
+is printed over a rectangular white background to white-out underlying
+material, if the grob is visible. A number indicates how far the
+outline extends beyond the bounding box of the grob as a multiple of
+the staff-line thickness. Usually @code{#f} by default.")
(width ,ly:dimension? "The width of a grob measured in staff
space.")
(word-space ,ly:dimension? "Space to insert between words in
(define-markup-command (whiteout-box layout props arg)
(markup?)
#:category other
+ #:properties ((thickness 0))
"
-@cindex adding a rounded rectangular white background to text
+@cindex adding a rectangular white background to text
-Provide a rounded rectangular white background for @var{arg}.
+Provide a rectangular white background for @var{arg}.
@lilypond[verbatim,quote]
\\markup {
\\combine
\\filled-box #'(-1 . 10) #'(-3 . 4) #1
- \\whiteout-box whiteout-box
+ \\override #'(thickness . 1.5) \\whiteout-box whiteout-box
}
@end lilypond"
- (stencil-whiteout-box (interpret-markup layout props arg)))
+ (stencil-whiteout-box
+ (interpret-markup layout props arg)
+ (* thickness
+ (ly:output-def-lookup layout 'line-thickness))))
(define-markup-command (pad-markup layout props amount arg)
(number? markup?)
`(delay-stencil-evaluation ,(delay whiteout-expr)))
stil)))))
-(define-public (stencil-whiteout-box stencil)
+(define*-public (stencil-whiteout-box stencil
+ #:optional (thickness 0) (blot 0) (color white))
+ "@var{thickness} is how far in staff-spaces the white outline
+extends past the extents of @var{stencil}."
(let*
- ((x-ext (ly:stencil-extent stencil X))
- (y-ext (ly:stencil-extent stencil Y)))
+ ((x-ext (interval-widen (ly:stencil-extent stencil X) thickness))
+ (y-ext (interval-widen (ly:stencil-extent stencil Y) thickness)))
- (ly:stencil-add
- (stencil-with-color (ly:round-filled-box x-ext y-ext 0.0)
- white)
- stencil)))
+ (ly:stencil-add
+ (stencil-with-color (ly:round-filled-box x-ext y-ext blot) color)
+ stencil)))
(define-public (arrow-stencil-maker start? end?)
"Return a function drawing a line from current point to @code{destination},