]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-markup-commands.scm
Issue 4656: Let concat-markup fold \char calls into surrounding strings
[lilypond.git] / scm / define-markup-commands.scm
index 57e2e8893a26334a2d5af498ba518668b158ed03..6aae0be7801c3a93c28ea9d6c9cf0bf1b9c054ba 100644 (file)
@@ -722,44 +722,36 @@ Rotate object with @var{ang} degrees around its center.
 (define-markup-command (whiteout layout props arg)
   (markup?)
   #:category other
-  #:properties ((thickness 3))
+  #:properties ((style 'box)
+                (thickness '()))
   "
 @cindex adding a white background to text
 
-Provide a white background for @var{arg}.
+Provide a white background for @var{arg}.  The shape of the white
+background is determined by @code{style}.  The default
+is @code{box} which produces a white rectangle.  @code{outline}
+approximates the outline of the markup.
 
 @lilypond[verbatim,quote]
 \\markup {
   \\combine
-    \\filled-box #'(-1 . 10) #'(-3 . 4) #1
-    \\override #'(thickness . 1.5) \\whiteout whiteout
+    \\filled-box #'(-1 . 15) #'(-3 . 4) #1
+    \\override #'(thickness . 1.5)
+    \\whiteout whiteout-box
 }
-@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
-  #:properties ((thickness 0))
-  "
-@cindex adding a rectangular white background to text
-
-Provide a rectangular white background for @var{arg}.
-
-@lilypond[verbatim,quote]
 \\markup {
   \\combine
-    \\filled-box #'(-1 . 10) #'(-3 . 4) #1
-    \\override #'(thickness . 1.5) \\whiteout-box whiteout-box
+    \\filled-box #'(-1 . 18) #'(-3 . 4) #1
+    \\override #'(style . outline)
+    \\override #'(thickness . 3)
+    \\whiteout whiteout-outline
 }
 @end lilypond"
-  (stencil-whiteout-box
+  (stencil-whiteout
     (interpret-markup layout props arg)
-      (* thickness
-        (ly:output-def-lookup layout 'line-thickness))))
+    style
+    thickness
+    (ly:output-def-lookup layout 'line-thickness)))
 
 (define-markup-command (pad-markup layout props amount arg)
   (number? markup?)
@@ -1413,11 +1405,13 @@ equivalent to @code{\"fi\"}.
 @end lilypond"
   (define (concat-string-args arg-list)
     (fold-right (lambda (arg result-list)
-                  (let ((result (if (pair? result-list)
-                                    (car result-list)
-                                    '())))
-                    (if (and (pair? arg) (eqv? (car arg) simple-markup))
-                        (set! arg (cadr arg)))
+                  (let ((result (and (pair? result-list)
+                                     (car result-list))))
+                    (cond ((not (pair? arg)))
+                          ((eq? (car arg) simple-markup)
+                           (set! arg (cadr arg)))
+                          ((eq? (car arg) char-markup)
+                           (set! arg (ly:wide-char->utf-8 (cadr arg)))))
                     (if (and (string? result) (string? arg))
                         (cons (string-append arg result) (cdr result-list))
                         (cons arg result-list))))