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 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"
20 (void) g
; /* shutup warning */
24 Minimal_page_breaking::Minimal_page_breaking (Paper_book
*pb
)
25 : Page_breaking (pb
, is_break
)
29 Minimal_page_breaking::~Minimal_page_breaking ()
34 Minimal_page_breaking::solve ()
36 vsize end
= last_break_position ();
38 message ("Computing line breaks...");
39 set_to_ideal_line_configuration (0, end
);
40 break_into_pieces (0, end
, current_configuration (0));
42 message (_ ("Computing page breaks..."));
43 vsize first_page_num
= robust_scm2int (book_
->paper_
->c_variable ("first-page-number"), 1);
44 Page_spacing_result res
= pack_systems_on_least_pages (0, first_page_num
);
45 SCM lines
= systems ();
46 return make_pages (res
.systems_per_page_
, lines
);