]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/page-layout.scm (ly:optimal-page-breaks): Bugfix: underful
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 19 Mar 2004 17:26:31 +0000 (17:26 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 19 Mar 2004 17:26:31 +0000 (17:26 +0000)
solutions are now optimal too.

* input/test/page-breaks.ly: New file.

ChangeLog
input/test/page-breaks.ly [new file with mode: 0644]
input/test/title-markup.ly
scm/page-layout.scm

index a01fa81a8d2202c38de4c0ea0aef3677bcd45896..72403fee62d2a07f65b3167cd34886c7df6f789b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
        * scm/page-layout.scm (ly:optimal-page-breaks): Bugfix: underful
        solutions are now optimal too.
 
+       * input/test/page-breaks.ly: New file.
+
        * lily/paper-outputter.cc (Paper_outputter): Import page breaking
        functions into safe module.
 
diff --git a/input/test/page-breaks.ly b/input/test/page-breaks.ly
new file mode 100644 (file)
index 0000000..ff03bf0
--- /dev/null
@@ -0,0 +1,33 @@
+\version "2.1.30"
+
+\header {
+    texidoc = "Stress optimal page breaking.  This should look nice on 4 a6 pages."
+    copyright = "Copyright by /me"
+    
+    title = "Title"
+    subtitle = "(and (the) subtitle)"
+    subsubtitle = "Sub sub title"
+    poet = "Poet"
+    composer = "Composer"
+    texttranslator = "Text Translator"
+    opus = "opus 0"
+    meter = "Meter (huh?)"
+    arranger = "Arranger"
+    instrument = "Instrument"
+    piece = "Piece"
+}
+
+\score {
+    \context Staff \notes \relative c' {
+       %% 16: ideally cramped
+       %% 17: very bad without density
+       \repeat unfold 17 { a b c d \break }
+    }
+    \paper {
+       %% #(set-paper-size "a6")
+       linewidth = 80\mm
+       vsize = 150 \mm
+       hsize = 105 \mm
+       #(define page-breaking ly:optimal-page-breaks)
+    }
+}
index 9d0a77689b63525206e216444eeca825bbc16bd7..138d1760ad5f173e59d320ed164118ff104fab69 100644 (file)
@@ -85,7 +85,7 @@ spaceTest = \markup { "two space chars" }
        %% stress page breaking:
        %% 35 keep on 3 pages
        %% 36 spread evenly over 4 pages
-       \repeat unfold 35 { a b c d \break }
+       \repeat unfold 36 { a b c d \break }
        c1
     }
 }
index 0c75b5e58acf331e6c1300967ad3dcdb023a0a39..80270ec48f22a8f1846d47973414fe67f81b4d35 100644 (file)
           (hh (make-node '() (node-line node) 0 0 height))
           (break-score (robust-break-score node))
           (density-score (if (null? paths) 0
-                             (* 0 (density-variance
+                             ;; TODO: find out why we need density
+                             ;;       use other height-score parameters?
+                             ;; See: input/test/page-breaks.ly
+                             (* 1 (density-variance
                                    (cons hh (get-path (car paths)))))))
           (page-score (height-score page height))
           (this-score (add-scores page-score break-score density-score))