]> git.donarmstrong.com Git - lilypond.git/commitdiff
Implement new markup-command overlay
authorThomas Morley <thomasmorley65@gmail.com>
Sun, 30 Aug 2015 11:10:52 +0000 (13:10 +0200)
committerThomas Morley <thomasmorley65@gmail.com>
Sat, 12 Sep 2015 15:07:13 +0000 (17:07 +0200)
issue 4580

Allows for \markup \overlay { a list }

scm/define-markup-commands.scm

index 505ca246c7bf6e6489f47b9f4351e6ce9c2f58e3..8d15ac9e29e23d26308cf1dbd135e5e20aa21941 100644 (file)
@@ -1740,11 +1740,7 @@ the line width, where @var{X} is the number of staff spaces.
 Print two markups on top of each other.
 
 Note: @code{\\combine} cannot take a list of markups enclosed in
-curly braces as an argument; the follow example will not compile:
-
-@example
-\\combine @{ a list @}
-@end example
+curly braces as an argument; for this purpose use @code{\\overlay} instead.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -1759,6 +1755,27 @@ curly braces as an argument; the follow example will not compile:
          (s2 (interpret-markup layout props arg2)))
     (ly:stencil-add s1 s2)))
 
+(define-markup-command (overlay layout props args)
+  (markup-list?)
+  #:category align
+  "
+@cindex merging text
+
+Takes a list of markups combining them.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\fontsize #5
+  \\override #'(thickness . 2)
+  \\overlay {
+    \\draw-line #'(0 . 4)
+    \\arrow-head #Y #DOWN ##f
+    \\translate #'(0 . 4)\\arrow-head #Y #UP ##f
+  }
+}
+@end lilypond"
+  (apply ly:stencil-add (interpret-markup-list layout props args)))
+
 ;;
 ;; TODO: should extract baseline-skip from each argument somehow..
 ;;