;;;; This file is part of LilyPond, the GNU music typesetter.
;;;;
-;;;; Copyright (C) 2000--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Copyright (C) 2000--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
;;;; Jan Nieuwenhuizen <janneke@gnu.org>
;;;;
;;;; LilyPond is free software: you can redistribute it and/or modify
(x-ext (ly:stencil-extent arg-stencil X))
(y-ext (ly:stencil-extent arg-stencil Y)))
(ly:stencil-add
- (ly:make-stencil
- `(delay-stencil-evaluation
- ,(delay (let* ((table (ly:output-def-lookup layout 'label-page-table))
- (page-number (if (list? table)
- (assoc-get label table)
- #f)))
- (list 'page-link page-number
- `(quote ,x-ext) `(quote ,y-ext)))))
- x-ext
- y-ext)
- arg-stencil)))
-
+ (ly:make-stencil
+ `(delay-stencil-evaluation
+ ,(delay (let* ((table (ly:output-def-lookup layout 'label-page-table))
+ (table-page-number
+ (if (list? table)
+ (assoc-get label table)
+ #f))
+ (first-page-number
+ (ly:output-def-lookup layout 'first-page-number))
+ (current-page-number
+ (if table-page-number
+ (1+ (- table-page-number first-page-number))
+ #f)))
+ (list 'page-link current-page-number
+ `(quote ,x-ext) `(quote ,y-ext)))))
+ x-ext
+ y-ext)
+ arg-stencil)))
(define-markup-command (beam layout props width slope thickness)
(number? number? number?)
(define-markup-command (whiteout layout props arg)
(markup?)
#:category other
+ #:properties ((thickness 3))
"
@cindex adding a white background to text
\\markup {
\\combine
\\filled-box #'(-1 . 10) #'(-3 . 4) #1
- \\whiteout whiteout
+ \\override #'(thickness . 1.5) \\whiteout whiteout
+}
+@end lilypond"
+ (stencil-whiteout
+ (interpret-markup layout props arg)
+ (* thickness
+ (ly:output-def-lookup layout 'line-thickness))))
+
+(define-markup-command (whiteout-box layout props arg)
+ (markup?)
+ #:category other
+ "
+@cindex adding a rounded rectangular white background to text
+
+Provide a rounded rectangular white background for @var{arg}.
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\combine
+ \\filled-box #'(-1 . 10) #'(-3 . 4) #1
+ \\whiteout-box whiteout-box
}
@end lilypond"
- (stencil-whiteout (interpret-markup layout props arg)))
+ (stencil-whiteout-box (interpret-markup layout props arg)))
(define-markup-command (pad-markup layout props amount arg)
(number? markup?)