]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge commit 'origin' into release/unstable
authorGraham Percival <graham@percival-music.ca>
Tue, 24 Aug 2010 13:42:59 +0000 (14:42 +0100)
committerGraham Percival <graham@percival-music.ca>
Tue, 24 Aug 2010 13:42:59 +0000 (14:42 +0100)
Documentation/changes.tely
Documentation/notation/vocal.itely
input/regression/center-title.ly [new file with mode: 0644]
input/regression/nested-fill-lines.ly [new file with mode: 0644]
ly/init.ly
python/book_snippets.py
scm/define-markup-commands.scm
scm/lily.scm

index 76ba8b56d1678b37db6048ab093314fa79bc14eb..7941e85c2762acbd7328ebca349e1a357c75572f 100644 (file)
@@ -66,6 +66,14 @@ which scares away people.
 
 @end ignore
 
+@item
+New option @code{-dinclude-settings=INCLUDEFILE.ly}, which causes lilypond
+to include the given file before the score is processed. This allows the
+user to change global settings without the need to change the score itself.
+That way, several different editions/version (e.g. different page sizes)
+can be generated from a file without having to modify the score for each 
+version.
+
 @item
 The autobeaming settings syntax has been changed.  beatLength,
 beatGrouping, beamSettings, and measureGrouping have all been eliminated.
index 3dc1dcedfb089d0162071f618b9c97bc954e3b42..0b2e0b075d2b4d84828bee0c5ba5dc1207763a3e 100644 (file)
@@ -1623,12 +1623,15 @@ Notation reference:
 @node Setting a chant
 @unnumberedsubsubsec Setting a chant
 
+Some approaches to setting a chant are shown in the following
+snippets.
+
+@snippets
 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
 {chant-or-psalms-notation.ly}
 
-@c TODO add this snippet when available
-@c @l ilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
-@c {Ancient notation template -- modern transcription of gregorian music.ly}
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{ancient-notation-template----modern-transcription-of-gregorian-music.ly}
 
 
 @node Pointing a psalm
diff --git a/input/regression/center-title.ly b/input/regression/center-title.ly
new file mode 100644 (file)
index 0000000..e67c5d6
--- /dev/null
@@ -0,0 +1,17 @@
+\version "2.13.31"
+
+\header {
+
+  texidoc = "
+Long titles should be properly centered.
+
+"
+
+  title = \markup \center-column {
+    "How Razorback Jumping Frogs Level Six Piqued Gymnasts"
+  }
+}
+
+\score {
+  s1
+}
diff --git a/input/regression/nested-fill-lines.ly b/input/regression/nested-fill-lines.ly
new file mode 100644 (file)
index 0000000..5927326
--- /dev/null
@@ -0,0 +1,16 @@
+\version "2.13.31"
+
+\header
+{
+
+  texidoc = "
+Nested fill-lines should work properly.  In this example, both occurences
+of FOO should be centered.
+
+"
+  title = \markup \column {
+    \fill-line { "|FOO|" }
+    \fill-line { \fill-line { "|FOO|" } }
+  }
+}
+\score {c''}
index 20416624c2f54c73ab03b9ef4246d42571f3d914..fa1dbe5993eba6d25504d600865e1c5f91d85617 100644 (file)
 #(define book-filename #f)
 #(define book-output-suffix #f)
 #(use-modules (scm clip-region))
+
+#(if (ly:get-option 'include-settings)
+  (ly:parser-include-string parser
+    (format "\\include \"~a\"" (ly:get-option 'include-settings))))
+
 \maininput
 %% there is a problem at the end of the input file
 
index 443ad3c363ed5e23fbf06b099a4d81d7cfa2018d..a19a5796d7e330eb74ab87053791963b6d40450d 100644 (file)
@@ -6,7 +6,11 @@ global _;_=ly._
 import re
 import os
 import copy
-from subprocess import Popen, PIPE
+# TODO: We are using os.popen3, which has been deprecated since python 2.6. The
+# suggested replacement is the Popen function of the subprocess module.
+# Unfortunately, on windows this needs the msvcrt module, which doesn't seem
+# to be available in GUB?!?!?!
+# from subprocess import Popen, PIPE
 
 progress = ly.progress
 warning = ly.warning
@@ -717,10 +721,10 @@ printing diff against existing file." % filename)
         if self.global_options.verbose:
             progress (_ ("Opening filter `%s'\n") % cmd)
 
-        #(stdin, stdout, stderr) = os.popen3 (cmd)
-
-        p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
-        (stdin, stdout, stderr) = (p.stdin, p.stdout, p.stderr)
+        # TODO: Use Popen once we resolve the problem with msvcrt in Windows:
+        (stdin, stdout, stderr) = os.popen3 (cmd)
+        p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
+        (stdin, stdout, stderr) = (p.stdin, p.stdout, p.stderr)
         stdin.write (input)
         status = stdin.close ()
 
index d863d16200343a45bb5f086eeaf433f209371a39..5dc3f420e70031854b85cc87380629518a7d1f09 100644 (file)
@@ -885,14 +885,16 @@ Like simple-markup, but use tie characters for @q{~} tilde symbols.
   (make-simple-markup ""))
 
 ;; helper for justifying lines.
-(define (get-fill-space word-count line-width text-widths)
+(define (get-fill-space word-count line-width word-space 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."
+  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.
+  All paddings are checked to be at least word-space, to ensure that
+  no texts collide.
+  Return a list of paddings."
   (cond
    ((null? text-widths) '())
 
@@ -901,23 +903,27 @@ Like simple-markup, but use tie characters for @q{~} tilde symbols.
     (cons
      (- (- (/ line-width (1- word-count)) (car text-widths))
        (/ (car (cdr text-widths)) 2))
-     (get-fill-space word-count line-width (cdr text-widths))))
+     (get-fill-space word-count line-width word-space (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 ((default-padding
+            (- (/ line-width (1- word-count))
+               (/ (+ (car text-widths) (car (cdr text-widths))) 2))))
+      (cons
+       (if (> word-space default-padding)
+           word-space
+           default-padding)
+       (get-fill-space word-count line-width word-space (cdr text-widths)))))))
 
 (define-markup-command (fill-line layout props args)
   (markup-list?)
   #:category align
   #:properties ((text-direction RIGHT)
-               (word-space 1)
-               (line-width #f))
+                (word-space 0.6)
+                (line-width #f))
   "Put @var{markups} in a horizontal line of width @var{line-width}.
 The markups are spaced or flushed to fill the entire line.
 If there are no arguments, return an empty stencil.
@@ -940,55 +946,58 @@ If there are no arguments, return an empty stencil.
 }
 @end lilypond"
   (let* ((orig-stencils (interpret-markup-list layout props args))
-        (stencils
-         (map (lambda (stc)
-                (if (ly:stencil-empty? stc)
-                    point-stencil
-                    stc)) orig-stencils))
-        (text-widths
-         (map (lambda (stc)
-                (if (ly:stencil-empty? stc)
-                    0.0
-                    (interval-length (ly:stencil-extent stc X))))
-              stencils))
-        (text-width (apply + text-widths))
-        (word-count (length stencils))
-        (line-width (or line-width (ly:output-def-lookup layout 'line-width)))
-        (fill-space
-               (cond
-                       ((= word-count 1)
-                               (list
-                                       (/ (- line-width text-width) 2)
-                                       (/ (- line-width text-width) 2)))
-                       ((= word-count 2)
-                               (list
-                                       (- line-width text-width)))
-                       (else
-                               (get-fill-space word-count line-width text-widths))))
-        (fill-space-normal
-         (map (lambda (x)
-                (if (< x word-space)
-                    word-space
-                    x))
-              fill-space))
-
-        (line-stencils (if (= word-count 1)
-                           (list
-                            point-stencil
-                            (car stencils)
-                            point-stencil)
-                           stencils)))
-
-    (if (= text-direction LEFT)
-       (set! line-stencils (reverse line-stencils)))
+         (stencils
+          (map (lambda (stc)
+                 (if (ly:stencil-empty? stc)
+                     point-stencil
+                     stc)) orig-stencils))
+         (text-widths
+          (map (lambda (stc)
+                 (if (ly:stencil-empty? stc)
+                     0.0
+                     (interval-length (ly:stencil-extent stc X))))
+               stencils))
+         (text-width (apply + text-widths))
+         (word-count (length stencils))
+         (line-width (or line-width (ly:output-def-lookup layout 'line-width)))
+         (fill-space
+          (cond
+           ((= word-count 1)
+            (list
+             (/ (- line-width text-width) 2)
+             (/ (- line-width text-width) 2)))
+           ((= word-count 2)
+            (list
+             (- line-width text-width)))
+           (else
+            (get-fill-space word-count line-width word-space text-widths))))
+
+         (line-contents (if (= word-count 1)
+                            (list
+                             point-stencil
+                             (car stencils)
+                             point-stencil)
+                            stencils)))
 
     (if (null? (remove ly:stencil-empty? orig-stencils))
-       empty-stencil
-       (ly:stencil-translate-axis
-         (stack-stencils-padding-list X
-                                      RIGHT fill-space-normal line-stencils)
-         (- (car (ly:stencil-extent (car stencils) X)))
-         X))))
+        empty-stencil
+        (begin
+          (if (= text-direction LEFT)
+              (set! line-contents (reverse line-contents)))
+          (set! line-contents
+                (stack-stencils-padding-list
+                 X RIGHT fill-space line-contents))
+          (if (> word-count 1)
+              ;; shift s.t. stencils align on the left edge, even if
+              ;; first stencil had negative X-extent (e.g. center-column)
+              ;; (if word-count = 1, X-extents are already normalized in
+              ;; the definition of line-contents)
+              (set! line-contents
+                    (ly:stencil-translate-axis
+                     line-contents
+                     (- (car (ly:stencil-extent (car stencils) X)))
+                     X)))
+          line-contents))))
 
 (define-markup-command (line layout props args)
   (markup-list?)
index 515ff2e02c333ce28a510458a8b826cd3a28277d..4a00ab66e4e73730284336cd6eb74b8c6a2dd2a6 100644 (file)
@@ -104,6 +104,8 @@ a log file.")
 "Include book titles in preview images.")
     (include-eps-fonts #t
 "Include fonts in separate-system EPS files.")
+    (include-settings #f
+"Include file for global settings, included before the score is processed.")
     (job-count #f
 "Process in parallel, using the given number of
 jobs.")