]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-lib.scm
* scm/lily-library.scm (list-join): use fold-right. Fixes #112
[lilypond.git] / scm / output-lib.scm
index 1558e761180eb61f4920ffcc731f40ddf876e4c5..c67c89df90e2d7309a7baa6885b1cc17a9de8244 100644 (file)
@@ -317,8 +317,6 @@ centered, X==1 is at the right, X == -1 is at the left."
        (ly:grob-relative-coordinate me y-ref Y))))
     ))
 
-       
-       
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; 
@@ -345,10 +343,14 @@ centered, X==1 is at the right, X == -1 is at the left."
        (padding (ly:grob-property spanner 'padding 0.5))
        (common (ly:grob-common-refpoint right-span
                                        (ly:grob-common-refpoint spanner
-                                               left-span X)
+                                                                left-span X)
                                        X))
-       (left-x (+ padding  (interval-end  (ly:grob-robust-relative-extent left-span common X))))
-       (right-x (- (interval-start  (ly:grob-robust-relative-extent right-span common X)) padding))
+       (left-x (+ padding
+                 (interval-end  (ly:grob-robust-relative-extent
+                                 left-span common X))))
+       (right-x (- (interval-start
+                   (ly:grob-robust-relative-extent right-span common X))
+                  padding))
        (self-x (ly:grob-relative-coordinate spanner common X))
        (dx (- right-x left-x))
        (exp (list 'path thickness 
@@ -379,8 +381,10 @@ centered, X==1 is at the right, X == -1 is at the left."
      ((cols (ly:grob-object grob 'columns))
       (get-difference
        (lambda (idx)
-        (ly:moment-sub (ly:grob-property (ly:grob-array-ref cols (1+ idx)) 'when)
-                       (ly:grob-property (ly:grob-array-ref cols idx) 'when))))
+        (ly:moment-sub (ly:grob-property
+                        (ly:grob-array-ref cols (1+ idx)) 'when)
+                       (ly:grob-property
+                        (ly:grob-array-ref cols idx) 'when))))
       
       (moment-min (lambda (x y)
                    (cond
@@ -420,9 +424,10 @@ centered, X==1 is at the right, X == -1 is at the left."
 
 (define-public (string-finger::calc-text grob)
   (let*
-      ((text (ly:event-property (event-cause  grob) 'text)))
-
-    text))
+      ((digit (ly:event-property (event-cause  grob) 'digit))
+       (texts (ly:grob-property grob 'digit-names)))
+    (vector-ref texts  (1- (max (min 5 digit) 1)))
+    ))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; dynamics
@@ -431,3 +436,24 @@ centered, X==1 is at the right, X == -1 is at the left."
       START
       STOP
       ))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; lyrics
+
+(define-public (lyric-text::print grob)
+  "Allow interpretation of tildes as lyric tieing marks."
+  
+  (let*
+      ((text (ly:grob-property grob 'text))
+       (layout (ly:grob-layout grob))
+       (defs (ly:output-def-lookup layout 'text-font-defaults))
+       (props (ly:grob-alist-chain grob defs)))
+
+    (ly:text-interface::interpret-markup layout
+                                        props
+                                        (if (string? text)
+                                            (make-tied-lyric-markup text)
+                                            text))))
+
+(define-public (lyric-text::calc-text grob)
+   (ly:event-property (event-cause grob) 'text))