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.
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_
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=7
-PATCH_LEVEL=10
+PATCH_LEVEL=11
MY_PATCH_LEVEL=
\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
}
\paper {
raggedlastbottom = ##f
betweensystemspace = 1.0
+ #(set! text-font-defaults
+ (acons
+ 'font-size 6
+ text-font-defaults)
+
+ )
}
}
Real hang = 1.0 - (thickness - slt) / 2;
*dy = sign (*dy) * max (fabs (*dy),
- min (min (sit, inter), hang));
+ min (min (sit, inter), hang));
}
}
void init_vars ();
public:
- Interval staff_refpoints_;
Paper_system (Stencil, SCM);
Stencil to_stencil () const;
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);
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",
immutable_property_alist_ = immutable_init;
smobify_self ();
stencil_ = s;
- staff_refpoints_ = Interval (0, 0);
init_vars ();
}
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;
}
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
{
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_;
-}
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 ();
}
(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)
(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))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(define-public (paper-system-staff-extents ps)
+ (ly:paper-system-property ps 'refpoint-Y-extent '(0 . 0)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(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)))))
'()))))
(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
(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
(+
(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))))
<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))
(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))))
(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)