Draw a box with rounded corners around @var{arg}. Looks at @code{thickness},
@code{box-padding} and @code{font-size} properties to determine line
thickness and padding around the markup; the @code{corner-radius} property
-makes possible to define another shape for the corners (default is 1)."
+makes possible to define another shape for the corners (default is 1).
+
+@lilypond[quote,verbatim,fragment,relative=2]
+c^\markup{ \rounded-box Overtura }
+c,8. c16 c4 r
+@end lilypond"
(let* ((th (*
(ly:output-def-lookup layout 'line-thickness)
(chain-assoc-get 'thickness props 1)))
(let* ((xext (interval-widen (ly:stencil-extent stencil 0) padding))
(yext (interval-widen (ly:stencil-extent stencil 1) padding))
+ (min-ext (min (-(cdr xext) (car xext)) (-(cdr yext) (car yext))))
+ (ideal-blot (min blot (/ min-ext 2)))
+ (ideal-thickness (min thickness (/ min-ext 2)))
(outer (ly:round-filled-box
- (interval-widen xext thickness) (interval-widen yext thickness) blot))
+ (interval-widen xext ideal-thickness)
+ (interval-widen yext ideal-thickness)
+ ideal-blot))
(inner (ly:make-stencil (list 'color (x11-color 'white) (ly:stencil-expr (ly:round-filled-box
- (cons (+ (car xext) thickness) (- (cdr xext) thickness))
- (cons (+ (car yext) thickness) (- (cdr yext) thickness)) (* blot 0.8)))))))
+ (cons (+ (car xext) ideal-thickness) (- (cdr xext) ideal-thickness))
+ (cons (+ (car yext) ideal-thickness) (- (cdr yext) ideal-thickness))
+ (- ideal-blot (* ideal-thickness 2))))))))
(set! stencil (ly:stencil-add outer inner))
stencil))