]> git.donarmstrong.com Git - lilypond.git/blob - lily/page-breaking-scheme.cc
Issue 4954/1: Change spanner-id to be a key instead of a string
[lilypond.git] / lily / page-breaking-scheme.cc
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2006--2015 Joe Neeman <joeneeman@gmail.com>
5
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.
10
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.
15
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/>.
18 */
19
20 #include "paper-book.hh"
21 #include "page-turn-page-breaking.hh"
22 #include "one-line-page-breaking.hh"
23 #include "one-line-auto-height-breaking.hh"
24 #include "optimal-page-breaking.hh"
25 #include "minimal-page-breaking.hh"
26
27 LY_DEFINE (ly_page_turn_breaking, "ly:page-turn-breaking",
28            1, 0, 0, (SCM pb),
29            "Optimally break (pages and lines) the @code{Paper_book} object"
30            " @var{pb} such that page turns only happen in specified places,"
31            " returning its pages.")
32 {
33   Page_turn_page_breaking b (unsmob<Paper_book> (pb));
34   return b.solve ();
35 }
36
37 LY_DEFINE (ly_optimal_breaking, "ly:optimal-breaking",
38            1, 0, 0, (SCM pb),
39            "Optimally break (pages and lines) the @code{Paper_book} object"
40            " @var{pb} to minimize badness in bother vertical and horizontal"
41            " spacing.")
42 {
43   Optimal_page_breaking b (unsmob<Paper_book> (pb));
44   return b.solve ();
45 }
46
47 LY_DEFINE (ly_minimal_breaking, "ly:minimal-breaking",
48            1, 0, 0, (SCM pb),
49            "Break (pages and lines) the @code{Paper_book} object @var{pb}"
50            " without looking for optimal spacing: stack as many lines on"
51            " a page before moving to the next one.")
52 {
53   Minimal_page_breaking b (unsmob<Paper_book> (pb));
54   return b.solve ();
55 }
56
57 LY_DEFINE (ly_one_line_breaking, "ly:one-line-breaking",
58            1, 0, 0, (SCM pb),
59            "Put each score on a single line, and put each line on its own"
60            " page.  Modify the paper-width setting so that every page"
61            " is wider than the widest line.")
62 {
63   One_line_page_breaking b (unsmob<Paper_book> (pb));
64   return b.solve ();
65 }
66
67 LY_DEFINE (ly_one_line_auto_height_breaking, "ly:one-line-auto-height-breaking",
68            1, 0, 0, (SCM pb),
69            "Put each score on a single line, and put each line on its own"
70            " page.  Modify the paper-width setting so that every page"
71            " is wider than the widest line. Modify the paper-height"
72            " setting to fit the height of the tallest line.")
73 {
74   One_line_auto_height_breaking b (unsmob<Paper_book> (pb));
75   return b.solve ();
76 }