]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/include/paper-system.hh (class Paper_system): remove
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 27 Sep 2005 11:33:28 +0000 (11:33 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 27 Sep 2005 11:33:28 +0000 (11:33 +0000)
staff_extents_ member.

* lily/paper-system-scheme.cc (LY_DEFINE): remove.

* lily/include/paper-system.hh (class Paper_system): remove
number_ variable. Remove is_title_. Remove break_before_penalty_

* lily/paper-system-scheme.cc: remove ly:paper-system-break-before-penalty
remove ly:paper-system-number.

* scm/lily-library.scm (paper-system-title?): new function.

* scm/paper.scm (set-paper-dimension-variables): add pagetopspace

* scm/page-layout.scm (ly:optimal-page-breaks): read next-space
and next-padding.
(optimal-page-breaks): rename from ly:optimal-page-breaks.

* lily/paper-system-scheme.cc (LY_DEFINE): new function.

* lily/paper-system.cc (internal_get_property): new function.

* scm/page-layout.scm (ly:optimal-page-breaks): add support for
pagetopspace

* input/regression/page-spacing.ly: new file.

* lily/paper-system.cc (read_left_bound): new function. Read
line-break-system-details from left bound to determine extents.

ChangeLog
VERSION
input/regression/page-spacing.ly
lily/beam.cc
lily/include/paper-system.hh
lily/paper-system-scheme.cc
lily/paper-system.cc
lily/system.cc
scm/font.scm
scm/page-layout.scm
scm/paper.scm

index da4975e51706ede0131a126dac05d3c2f01db4e4..8a327aa9a7eb261417884c4be307db6186aa8462 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2005-09-27  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/include/paper-system.hh (class Paper_system): remove
+       staff_extents_ member.
+
+       * lily/paper-system-scheme.cc (LY_DEFINE): remove.
+
        * lily/include/paper-system.hh (class Paper_system): remove
        number_ variable. Remove is_title_. Remove break_before_penalty_
 
diff --git a/VERSION b/VERSION
index ce8dc973f6ece76b759b4211c0190a6212a0878f..d5ecc913e8862e23ca9fd3404732fda0c0e6937b 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=7
-PATCH_LEVEL=10
+PATCH_LEVEL=11
 MY_PATCH_LEVEL=
 
index 928659a643bed8d05d5ce41ba6d2c3272047d5b3..015ad62285ddd66814b8391203b6164ce29cdeb9 100644 (file)
@@ -18,34 +18,46 @@ used for global overrides.
 
 \book {
   \score {
-    \relative c'' \new StaffGroup <<
+    \relative c'' \new PianoStaff <<
       \new Voice  {
-       c1\break
+       c1_"followed by default spacing"\break
+       c\break
 
        \outputProperty
        #"Score.NonMusicalPaperColumn"
        #'line-break-system-details
        #'((Y-extent . (-30 . 10)))
-       c^"This system has big extents (property Y-extent)"\break
+       c_"Big bounding box (property Y-extent)"\break
 
-       c\break
        \outputProperty
        #"Score.NonMusicalPaperColumn"
        #'line-break-system-details
-       #'((next-padding . 20))
+       #'((refpoint-Y-extent . (-37 . -10)))
+       c_\markup {
+         \column {
+           "Refpoints further apart (property refpoint-Y-extent)."
+           "Stretchable space runs between refpoints"
+         }
+       }
+       
+       \break
+       
+       \outputProperty
+       #"Score.NonMusicalPaperColumn"
+       #'line-break-system-details
+       #'((next-padding . 10))
 
-       c^"This system is followed by padding, ie unstretchable space. (property next-padding)" \break
+       c_"Followed by padding, ie unstretchable space. (property next-padding)" \break
        \outputProperty
        #"Score.NonMusicalPaperColumn"
        #'line-break-system-details
        #'((next-space . 20))
-       c^"This system is followed by stretchable space (property next-space)"\break
-       c\break
+       c_"Followed by stretchable space (property next-space)"\break
        c\break
        \outputProperty
        #"Score.NonMusicalPaperColumn" #'line-break-system-details
        #'((bottom-space . 25.0)) 
-       c^"This system has 25 staff space to the bottom of the page. (property bottom-space)"\break
+       c_"25 staff space to the bottom of the page. (property bottom-space)"\break
 
 
       }
@@ -55,5 +67,11 @@ used for global overrides.
   \paper {
     raggedlastbottom = ##f
     betweensystemspace = 1.0
+    #(set! text-font-defaults
+      (acons
+       'font-size 6
+       text-font-defaults)
+      
+    )
   }
 }
index 95e5c4fefc1804ef631a738ccccab93da8a5591d..d0fc2800755353f2d19d337f0318c80205f81fc5 100644 (file)
@@ -778,7 +778,7 @@ set_minimum_dy (Grob *me, Real *dy)
       Real hang = 1.0 - (thickness - slt) / 2;
 
       *dy = sign (*dy) * max (fabs (*dy),
-                                  min (min (sit, inter), hang));
+                             min (min (sit, inter), hang));
     }
 }
 
index e35077b9cb1d219dd25e329e60ef3bcf7953eb03..7cf6285ed503b25dc1836d13fb7d7296889b9de8 100644 (file)
@@ -26,7 +26,6 @@ class Paper_system
 
   void init_vars ();
 public:
-  Interval staff_refpoints_;
 
   Paper_system (Stencil, SCM);
   Stencil to_stencil () const;
@@ -35,7 +34,6 @@ public:
   void internal_set_property (SCM sym, SCM val);
   bool is_title () const;
   Real break_before_penalty () const;
-  Interval staff_refpoints () const;
 };
 
 DECLARE_UNSMOB (Paper_system, paper_system);
index 8f89313e5bc00fac55e4899b42851b2545da11e0..9d887213c027339c053c248df938554fb22d71a7 100644 (file)
@@ -28,15 +28,6 @@ LY_DEFINE (ly_paper_system_stencil, "ly:paper-system-stencil",
   return ps->to_stencil ().smobbed_copy ();
 }
 
-LY_DEFINE (ly_paper_system_staff_extent, "ly:paper-system-staff-extents",
-          1, 0, 0, (SCM system),
-          "Return the top and bottom staff refpoint.")
-{
-  Paper_system *ps = unsmob_paper_system (system);
-  SCM_ASSERT_TYPE (ps, system, SCM_ARG1, __FUNCTION__, "paper-system");
-  return ly_interval2scm (ps->staff_refpoints ());
-}
-
 
 
 LY_DEFINE (ly_paper_system_property, "ly:paper-system-property",
index a7e95227d061251f97960625e4d60193979e0c50..0d206a0aae64135f1c7fcd00953ce44034eeeb7c 100644 (file)
@@ -21,7 +21,6 @@ Paper_system::Paper_system (Stencil s, SCM immutable_init)
   immutable_property_alist_ = immutable_init;
   smobify_self ();
   stencil_ = s;
-  staff_refpoints_ = Interval (0, 0);
   init_vars ();
 }
 
@@ -45,8 +44,9 @@ Paper_system::print_smob (SCM smob, SCM port, scm_print_state*)
   scm_puts ("#<", port);
   scm_puts (classname (p), port);
   scm_display (p->mutable_property_alist_, port);
+  scm_display (p->immutable_property_alist_, port);
   
-  scm_puts (" >", port);
+  scm_puts (" >\n", port);
   return 1;
 }
 
@@ -61,22 +61,14 @@ void
 Paper_system::init_vars ()
 {
   SCM yext = get_property ("Y-extent");
-  SCM staff_ext = get_property ("refpoint-Y-extent");
 
-  if (scm_is_pair (yext)
-      && is_number_pair (scm_cdr (yext)))
+  if (is_number_pair (yext))
     {
       Box b = stencil_.extent_box();
-      b[Y_AXIS] = ly_scm2interval (scm_cdr (yext));
+      b[Y_AXIS] = ly_scm2interval (yext);
       
       stencil_ = Stencil (b, stencil_.expr ());
     }
-
-  if (scm_is_pair (staff_ext)
-      && is_number_pair (scm_cdr (staff_ext)))
-    {
-      staff_refpoints_ = ly_scm2interval (scm_cdr (staff_ext));
-    }
 }
 
 SCM
@@ -100,12 +92,3 @@ Paper_system::internal_set_property (SCM sym, SCM val)
 {
   mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, sym, val);
 }
-
-/*
-  todo: move to Paper_system property.
- */
-Interval
-Paper_system::staff_refpoints () const
-{
-  return staff_refpoints_;
-}
index 1ede4824c52684eef33d072805c8b1731f8fe598..4795e63c0aaf1c754b19fa323bc3a44c7e12dce6 100644 (file)
@@ -374,24 +374,28 @@ System::get_paper_system ()
                       scm_cons (ly_symbol2scm ("combine-stencil"),
                                 exprs));
 
-  Interval staff_refpoints;
-  staff_refpoints.set_empty ();
-  extract_grob_set (this, "spaceable-staves", staves);
-  for (int i = staves.size (); i--;)
-    {
-      Grob *g = staves[i];
-      staff_refpoints.add_point (g->relative_coordinate (this, Y_AXIS));
-    }
+
 
   Grob *left_bound = this->get_bound (LEFT);
   SCM prop_init = left_bound->get_property ("line-break-system-details");
   Paper_system *pl = new Paper_system (sys_stencil,
                                       prop_init);
-  
-  pl->staff_refpoints_ = staff_refpoints;
   pl->set_property ("penalty",
                    left_bound->get_property ("page-penalty"));
   
+  if (!scm_is_pair (pl->get_property ("refpoint-Y-extent")))
+    {
+      Interval staff_refpoints;
+      staff_refpoints.set_empty ();
+      extract_grob_set (this, "spaceable-staves", staves);
+      for (int i = staves.size (); i--;)
+       {
+         Grob *g = staves[i];
+         staff_refpoints.add_point (g->relative_coordinate (this, Y_AXIS));
+       }
+      pl->set_property ("refpoint-Y-extent", ly_interval2scm (staff_refpoints));
+    }
+  
   return pl->unprotect ();
 }
 
index 2dd29cc9d49953672374295207e965bd700969db..d72a8d23a197f514d51775eaf137550485a8c0ef 100644 (file)
 (define-method (display (leaf <Font-tree-leaf>) port)
   (map (lambda (x) (display x port))
        (list
-       "Font-size-family: \n"
+       "#<Font-size-family: \n"
        (slot-ref leaf 'default-size) 
-       (slot-ref leaf 'size-vector))))
+       (slot-ref leaf 'size-vector)
+       "#>"
+       )))
 
 (define-method (display (node <Font-tree-node>) port)
 
@@ -66,6 +68,7 @@
 (define-method (add-font (node <Font-tree-node>) fprops size-family)
   (define (assoc-delete key alist)
     (assoc-remove! (list-copy alist) key))
+  
   (define (make-node fprops size-family)
     (if (null? fprops)
        (make-font-tree-leaf (car size-family) (cdr size-family))
index 3272a2ff3f0db802b464e88090cabc773bb7c9ce..172b5f4ff76af317b1b1fb20384d01634b2591ba 100644 (file)
@@ -32,6 +32,8 @@
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(define-public (paper-system-staff-extents ps)
+  (ly:paper-system-property ps 'refpoint-Y-extent '(0 . 0)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
@@ -143,9 +145,9 @@ create offsets.
                  (add-to-page
                   system-separator-stencil
                   (average (- last-y
-                              (car (ly:paper-system-staff-extents last-system)))
+                              (car (paper-system-staff-extents last-system)))
                            (- y
-                              (cdr (ly:paper-system-staff-extents system))))))
+                              (cdr (paper-system-staff-extents system))))))
              (set! last-system system)
              (set! last-y y)))))
 
@@ -244,11 +246,11 @@ is what have collected so far, and has ascending page numbers."
                                       '()))))
           (staff-extents
            (list->vector
-            (append (map ly:paper-system-staff-extents lines)
+            (append (map paper-system-staff-extents lines)
                     (if (= (length lines) 1)
                         '((0 . 0))
                         '()))))
-          
+
           (real-extents
            (list->vector
             (append
@@ -347,8 +349,8 @@ is what have collected so far, and has ascending page numbers."
          (begin
            (display (list "\n# systems: " system-count
                           "\nreal-ext" real-extents "\nstaff-ext" staff-extents
-                          "\ninterscore" inter-system-space
-                          "\nspace-letf" space-left
+                          "\ninterscore" global-inter-system-space
+                          "\nspace-left" space-left
                           "\nspring,rod" springs rods
                           "\ntopskip " topskip
                           " space " space
@@ -398,11 +400,11 @@ CURRENT-BEST is the best result sofar, or #f."
            (+
             (max (get-break-penalty (car current-lines)) 0.0)
             user-nobreak-penalties))
+          
            (total-penalty (combine-penalties
                            force user-penalty
                           best-paths))
 
-
            (better? (or
                      (not current-best)
                      (< total-penalty (node-penalty current-best))))
@@ -450,6 +452,7 @@ CURRENT-BEST is the best result sofar, or #f."
 <optimal-page-break-node> for optimally breaking TODO ++
 DONE.reversed. BEST-PATHS is a list of break nodes corresponding to
 DONE."
+    
     (if (null? todo)
        (car best-paths)
        (let* ((this-line (car todo))
@@ -468,6 +471,8 @@ DONE."
   (set! force-equalization-factor
        (ly:output-def-lookup paper 'verticalequalizationfactor 0.3))
 
+  (display lines)
+  
   (let* ((best-break-node (walk-lines '() '() lines))
         (break-nodes (get-path best-break-node '()))
         (last-node (car (last-pair break-nodes))))
index 2b3512b04f72a89a0ddc326f073e1868f75b57fa..2b4d2d1a5d42e7564bd4552e58e595ff22582d60 100644 (file)
@@ -40,7 +40,7 @@
                    (if tex-backend?
                        (make-cmr-tree (/  sz (* 20 pt)))
                        (make-century-schoolbook-tree
-                        (/  sz (* 20 pt)))))
+                        (/ sz (* 20 pt)))))
     (module-define! m 'staffheight sz)
     (module-define! m 'staff-space ss)
     (module-define! m 'staffspace ss)