]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-markup-commands.scm
Documentation/user/programming-interface.itely: fix @{ @}.
[lilypond.git] / scm / define-markup-commands.scm
index 98d2161c37b4dd9696c0c05f52d32e11bc0e9fb1..17d6be097dfba9e8396c4f35afedd43a6d25f8a9 100644 (file)
@@ -82,10 +82,13 @@ the PDF backend."
         (half (/ thickness 2)))
 
     (ly:make-stencil
-     (list 'beam width
-          slope
-          thickness
-          (ly:output-def-lookup layout 'blotdiameter))
+     `(polygon ',(list 
+                 0 (/ thickness -2)
+                   width (+ (* width slope)  (/ thickness -2))
+                   width (+ (* width slope)  (/ thickness 2))
+                   0 (/ thickness 2))
+              ,(ly:output-def-lookup layout 'blotdiameter)
+              #t)
      (cons 0 width)
      (cons (+ (- half) (car yext))
           (+ half (cdr yext))))))
@@ -463,12 +466,15 @@ determines the space between each markup in @var{args}."
     (stack-lines DOWN 0.0 baseline-skip lines)))
 
 (def-markup-command (justify layout props args) (markup-list?)
-  "Simple wordwrap"
+  "Like wordwrap, but with lines stretched to justify the margins.
+Use @code{\\override #'(linewidth . X)} to set linewidth, where X
+is the number of staff spaces."
 
   (wordwrap-markups layout props args #t))
 
 (def-markup-command (wordwrap layout props args) (markup-list?)
-  "Like wordwrap, but with lines stretched to justify the margins."
+  "Simple wordwrap.  Use @code{\\override #'(linewidth . X)} to set
+linewidth, where X is the number of staff spaces."
 
   (wordwrap-markups layout props args #f))
 
@@ -507,7 +513,24 @@ determines the space between each markup in @var{args}."
 (def-markup-command (justify-string layout props arg) (string?)
   "Justify a string. Paragraphs may be separated with double newlines"
   (wordwrap-string layout props #t arg))
-  
+
+
+(def-markup-command (wordwrap-field layout props symbol) (symbol?)
+   (let* ((m (chain-assoc-get symbol props)))
+     (if (string? m)
+      (interpret-markup layout props
+       (list wordwrap-string-markup m))
+      (ly:make-stencil '()  '(1 . -1) '(1 . -1)))))
+
+(def-markup-command (justify-field layout props symbol) (symbol?)
+   (let* ((m (chain-assoc-get symbol props)))
+     (if (string? m)
+      (interpret-markup layout props
+       (list justify-string-markup m))
+      (ly:make-stencil '()  '(1 . -1) '(1 . -1)))))
+
+
+
 (def-markup-command (combine layout props m1 m2) (markup? markup?)
   "Print two markups on top of each other."
   (let* ((s1 (interpret-markup layout props m1))
@@ -790,11 +813,27 @@ recommend font for this is bold and italic"
                     (ly:stencil-extent stil X)
                     (ly:stencil-extent stil Y))))
 
-
+\f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; glyphs
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+
+(def-markup-command (arrow-head layout props axis direction filled)
+  (integer? ly:dir? boolean?)
+  "produce an arrow head in specified direction and axis. Use the filled head if @var{filled} is  specified."
+  (let*
+      ((name (format "arrowheads.~a.~a~a"
+                    (if filled
+                        "close"
+                        "open")
+                    axis
+                    direction)))
+    (ly:font-get-glyph
+     (ly:paper-get-font layout (cons '((font-encoding . fetaMusic))
+                                    props))
+     name)))
+
 (def-markup-command (musicglyph layout props glyph-name) (string?)
   "This is converted to a musical symbol, e.g. @code{\\musicglyph
 #\"accidentals.0\"} will select the natural sign from the music font.
@@ -849,6 +888,7 @@ letter 'A'."
    (Text_interface::interpret_markup layout props
      (number->markletter-string number->mark-alphabet-vector num)))
 
+\f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; the note command.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -937,6 +977,7 @@ a shortened down stem."
   (let ((parsed (parse-simple-duration duration)))
     (note-by-number-markup layout props (car parsed) (cadr parsed) dir)))
 
+\f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; translating.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1054,7 +1095,7 @@ that.
    (interpret-markup layout props arg)
    (* -0.5 (chain-assoc-get 'baseline-skip props))
    Y))
-
+\f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; brackets.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;