2 minimal-page-breaking.cc -- implement a page-breaker that stacks as
3 many systems on a page before moving to the next one. Specialized
4 for books with many pages, or a lot of text.
6 source file of the GNU LilyPond music typesetter
8 (c) 2007--2009 Nicolas Sceaux <nicolas.sceaux@free.fr>
11 #include "international.hh"
12 #include "minimal-page-breaking.hh"
13 #include "output-def.hh"
14 #include "page-spacing.hh"
15 #include "paper-book.hh"
23 Minimal_page_breaking::Minimal_page_breaking (Paper_book
*pb
)
24 : Page_breaking (pb
, is_break
)
28 Minimal_page_breaking::~Minimal_page_breaking ()
33 Minimal_page_breaking::solve ()
35 vsize end
= last_break_position ();
37 message (_ ("Calculating line breaks..."));
38 set_to_ideal_line_configuration (0, end
);
39 break_into_pieces (0, end
, current_configuration (0));
41 message (_ ("Calculating page breaks..."));
42 vsize first_page_num
= robust_scm2int (book_
->paper_
->c_variable ("first-page-number"), 1);
43 Page_spacing_result res
= pack_systems_on_least_pages (0, first_page_num
);
44 SCM lines
= systems ();
45 return make_pages (res
.systems_per_page_
, lines
);