]> git.donarmstrong.com Git - lilypond.git/commitdiff
(fill-line): handle text-widths =
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 7 Jun 2005 11:29:30 +0000 (11:29 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 7 Jun 2005 11:29:30 +0000 (11:29 +0000)
'() case.

ChangeLog
VERSION
scm/define-markup-commands.scm

index 7843c358411157497976a3b40de1044b814fd0c4..f71c4bf79592494f6c7cf2e291d9e8019c9c9710 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-07  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * scm/define-markup-commands.scm (fill-line): handle text-widths =
+       '() case.
+
 2005-06-07  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * scm/ps-to-png.scm (make-ps-images): Bugfix: `Pages: 1\n' is not
diff --git a/VERSION b/VERSION
index 17d3159e6ba65e0d4230931fb566fb5f13d1cf82..b53029edd03a362c1a53bc68d34f88c79cb451f3 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=5
-PATCH_LEVEL=28
+PATCH_LEVEL=29
 MY_PATCH_LEVEL=
 
index 9502c2c89e8c1352592717168fa7691bdb386503..4c62c026150aa47f122e0bc32189c3bf5d211aa5 100644 (file)
@@ -194,6 +194,37 @@ gsave /ecrm10 findfont
    The markups are spaced/flushed to fill the entire line.
    If there are no arguments, return an empty stencil.
 "
+
+
+  (define (get-fill-space word-count line-width text-widths)
+    "Calculate the necessary paddings between each two adjacent texts.
+       The lengths of all texts are stored in @var{text-widths}.
+       The normal formula for the padding between texts a and b is:
+       padding = line-width/(word-count - 1) - (length(a) + length(b))/2
+       The first and last padding have to be calculated specially using the
+       whole length of the first or last text.
+       Return a list of paddings.
+"
+    (cond
+     ((null? text-widths) '())
+    
+     ;; special case first padding
+     ((= (length text-widths) word-count)
+      (cons 
+       (- (- (/ line-width (1- word-count)) (car text-widths))
+         (/ (car (cdr text-widths)) 2))
+       (get-fill-space word-count line-width (cdr text-widths))))
+     ;; special case last padding
+     ((= (length text-widths) 2)
+      (list (- (/ line-width (1- word-count))
+              (+ (/ (car text-widths) 2) (car (cdr text-widths)))) 0))
+     (else
+      (cons 
+       (- (/ line-width (1- word-count))
+         (/ (+ (car text-widths) (car (cdr text-widths))) 2))
+       (get-fill-space word-count line-width (cdr text-widths))))))
+
+
   (let* ((orig-stencils
          (map (lambda (x) (interpret-markup layout props x))
               markups))
@@ -241,32 +272,6 @@ gsave /ecrm10 findfont
        empty-stencil
        (stack-stencils-padding-list X RIGHT fill-space-normal line-stencils))))
        
-(define (get-fill-space word-count line-width text-widths)
-       "Calculate the necessary paddings between each two adjacent texts.
-       The lengths of all texts are stored in @var{text-widths}.
-       The normal formula for the padding between texts a and b is:
-       padding = line-width/(word-count - 1) - (length(a) + length(b))/2
-       The first and last padding have to be calculated specially using the
-       whole length of the first or last text.
-       Return a list of paddings.
-"
-       (cond
-        ;; special case first padding
-        ((= (length text-widths) word-count)
-         (cons 
-          (- (- (/ line-width (1- word-count)) (car text-widths))
-             (/ (car (cdr text-widths)) 2))
-          (get-fill-space word-count line-width (cdr text-widths))))
-        ;; special case last padding
-        ((= (length text-widths) 2)
-         (list (- (/ line-width (1- word-count))
-                  (+ (/ (car text-widths) 2) (car (cdr text-widths)))) 0))
-        (else
-         (cons 
-          (- (/ line-width (1- word-count))
-             (/ (+ (car text-widths) (car (cdr text-widths))) 2))
-          (get-fill-space word-count line-width (cdr text-widths))))))
-
 (define (font-markup qualifier value)
   (lambda (layout props arg)
     (interpret-markup layout (prepend-alist-chain qualifier value props) arg)))