2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2007--2011 Nicolas Sceaux <nicolas.sceaux@free.fr>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "international.hh"
21 #include "minimal-page-breaking.hh"
22 #include "output-def.hh"
23 #include "page-spacing.hh"
24 #include "paper-book.hh"
26 Minimal_page_breaking::Minimal_page_breaking (Paper_book
*pb
)
27 : Page_breaking (pb
, 0, 0)
31 Minimal_page_breaking::~Minimal_page_breaking ()
36 Minimal_page_breaking::solve ()
38 vsize end
= last_break_position ();
40 message (_ ("Calculating line breaks..."));
41 set_to_ideal_line_configuration (0, end
);
42 break_into_pieces (0, end
, current_configuration (0));
44 message (_ ("Calculating page breaks..."));
45 vsize first_page_num
= robust_scm2int (book_
->paper_
->c_variable ("first-page-number"), 1);
46 Page_spacing_result res
= pack_systems_on_least_pages (0, first_page_num
);
47 SCM lines
= systems ();
48 return make_pages (res
.systems_per_page_
, lines
);