]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-markup-commands.scm
* Documentation/user/changing-defaults.itely (Page layout): add
[lilypond.git] / scm / define-markup-commands.scm
index ebfcd540e506c6f294a974cd4091a58c26638a8b..07627ba770dca00ca70f204bde12908c01bab11e 100644 (file)
@@ -332,11 +332,17 @@ of the @code{#'direction} layout property."
     (stack-lines -1 0.0 (chain-assoc-get 'baseline-skip props) cmols)))
 
 (def-markup-command (vcenter layout props arg) (markup?)
-  "Align @code{arg} to its center. "
+  "Align @code{arg} to its center. "
   (let* ((mol (interpret-markup layout props arg)))
     (ly:stencil-align-to! mol Y CENTER)
     mol))
 
+(def-markup-command (hcenter layout props arg) (markup?)
+  "Align @code{arg} to its X center. "
+  (let* ((mol (interpret-markup layout props arg)))
+    (ly:stencil-align-to! mol X CENTER)
+    mol))
+
 (def-markup-command (right-align layout props arg) (markup?)
   "Align @var{arg} on its right edge. "
   (let* ((m (interpret-markup layout props arg)))
@@ -562,6 +568,26 @@ that.
    (* -0.5 (chain-assoc-get 'baseline-skip props))
    Y))
 
+(def-markup-command (beam layout props width slope thickness) (number? number? number?)
+  "Create a beam with the specified parameters."
+
+  (let*
+      ((y (* slope width))
+       (yext (cons (min 0 y) (max 0 y)))
+       (half (/ thickness 2)))
+       
+    (ly:make-stencil
+     (list 'beam width
+          slope
+          thickness
+          (ly:output-def-lookup layout 'blotdiameter))
+     (cons 0 width)
+     (cons (+ (- half) (car yext))
+          (+ half (cdr yext))))
+
+    ))
+
+
 (def-markup-command (normal-size-sub layout props arg) (markup?)
   "Set @var{arg} in subscript, in a normal font size."
   (ly:stencil-translate-axis