]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-markup-commands.scm
Fix 1805: Ignore AmbitusAccidental in slur/phrasing slur engraving
[lilypond.git] / scm / define-markup-commands.scm
index d60191decf0465e3615dc09ed66ad9ba1fc7fb94..18728e57d9809de9b1865209cfb5e7677103b59d 100644 (file)
@@ -1900,6 +1900,29 @@ returns an empty markup.
     (interpret-markup layout props (list anonymous-with-signature arg))))
 
 (define-markup-command (footnote layout props mkup note)
+  (markup? markup?)
+  #:category other
+  "Have footnote @var{note} act as an annotation to the markup @var{mkup}.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\auto-footnote a b
+  \\override #'(padding . 0.2)
+  \\auto-footnote c d
+}
+@end lilypond
+The footnote will not be annotated automatically."
+  (ly:stencil-combine-at-edge
+    (interpret-markup layout props mkup)
+    X
+    RIGHT
+    (ly:make-stencil
+      `(footnote (gensym "footnote") #f ,(interpret-markup layout props note))
+      '(0 . 0)
+      '(0 . 0))
+    0.0))
+
+(define-markup-command (auto-footnote layout props mkup note)
   (markup? markup?)
   #:category other
   #:properties ((raise 0.5)
@@ -1908,11 +1931,12 @@ returns an empty markup.
 
 @lilypond[verbatim,quote]
 \\markup {
-  \\footnote a b
+  \\auto-footnote a b
   \\override #'(padding . 0.2)
-  \\footnote c d
+  \\auto-footnote c d
 }
-@end lilypond"
+@end lilypond
+The footnote will be annotated automatically."
   (let* ((markup-stencil (interpret-markup layout props mkup))
          (auto-numbering (ly:output-def-lookup layout
                                                'footnote-auto-numbering))
@@ -1970,7 +1994,7 @@ returns an empty markup.
   (ly:stencil-add
     main-stencil
     (ly:make-stencil
-      `(footnote ,footnote-hash ,(interpret-markup layout props note))
+      `(footnote ,footnote-hash #t ,(interpret-markup layout props note))
       '(0 . 0)
       '(0 . 0)))))
 
@@ -2100,18 +2124,16 @@ Adjusts @code{baseline-skip} and @code{word-space} accordingly.
 }
 @end lilypond"
   (let* ((ref-size (ly:output-def-lookup layout 'text-font-size 12))
-         (text-props (list (ly:output-def-lookup layout 'text-font-defaults)))
-         (ref-word-space (chain-assoc-get 'word-space text-props 0.6))
-         (ref-baseline (chain-assoc-get 'baseline-skip text-props 3))
-         (magnification (/ size ref-size)))
-     (interpret-markup
-       layout
-       (cons
-         `((baseline-skip . ,(* magnification ref-baseline))
-           (word-space . ,(* magnification ref-word-space))
-           (font-size . ,(magnification->font-size magnification)))
-         props)
-       arg)))
+        (text-props (list (ly:output-def-lookup layout 'text-font-defaults)))
+        (ref-word-space (chain-assoc-get 'word-space text-props 0.6))
+        (ref-baseline (chain-assoc-get 'baseline-skip text-props 3))
+        (magnification (/ size ref-size)))
+    (interpret-markup layout
+                     (cons `((baseline-skip . ,(* magnification ref-baseline))
+                             (word-space . ,(* magnification ref-word-space))
+                             (font-size . ,(magnification->font-size magnification)))
+                           props)
+                     arg)))
 
 (define-markup-command (fontsize layout props increment arg)
   (number? markup?)
@@ -2130,14 +2152,11 @@ accordingly.
   smaller
 }
 @end lilypond"
-  (interpret-markup
-    layout
-    (cons
-      `((baseline-skip . ,(* baseline-skip (magstep increment)))
-        (word-space . ,(* word-space (magstep increment)))
-        (font-size . ,(+ font-size increment)))
-      props)
-    arg))
+  (let ((entries (list
+                  (cons 'baseline-skip (* baseline-skip (magstep increment)))
+                  (cons 'word-space (* word-space (magstep increment)))
+                  (cons 'font-size (+ font-size increment)))))
+    (interpret-markup layout (cons entries props) arg)))
 
 (define-markup-command (magnify layout props sz arg)
   (number? markup?)
@@ -3642,28 +3661,6 @@ Patterns are aligned to the @var{dir} markup.
                               #:pattern (1+ count) X space pattern
                               right))))
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Replacements
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(define-markup-command (replace layout props replacements arg)
-  (list? markup?)
-  #:category font
-  "
-Used to automatically replace a string by another in the markup @var{arg}.
-Each pair of the alist @var{replacements} specifies what should be replaced.
-The @code{key} is the string to be replaced by the @code{value} string.
-
-@lilypond[verbatim, quote]
-\\markup \\replace #'((\"thx\" . \"Thanks!\")) thx
-@end lilypond"
-  (interpret-markup
-    layout
-    (internal-add-text-replacements
-      props
-      replacements)
-    (markup arg)))
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Markup list commands
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;