]> git.donarmstrong.com Git - lilypond.git/blob - lily/page-breaking-scheme.cc
Web-ja: update introduction
[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 "one-page-breaking.hh"
25 #include "optimal-page-breaking.hh"
26 #include "minimal-page-breaking.hh"
27
28 LY_DEFINE (ly_page_turn_breaking, "ly:page-turn-breaking",
29            1, 0, 0, (SCM pb),
30            "Optimally break (pages and lines) the @code{Paper_book} object"
31            " @var{pb} such that page turns only happen in specified places,"
32            " returning its pages.")
33 {
34   Page_turn_page_breaking b (unsmob<Paper_book> (pb));
35   return b.solve ();
36 }
37
38 LY_DEFINE (ly_optimal_breaking, "ly:optimal-breaking",
39            1, 0, 0, (SCM pb),
40            "Optimally break (pages and lines) the @code{Paper_book} object"
41            " @var{pb} to minimize badness in bother vertical and horizontal"
42            " spacing.")
43 {
44   Optimal_page_breaking b (unsmob<Paper_book> (pb));
45   return b.solve ();
46 }
47
48 LY_DEFINE (ly_minimal_breaking, "ly:minimal-breaking",
49            1, 0, 0, (SCM pb),
50            "Break (pages and lines) the @code{Paper_book} object @var{pb}"
51            " without looking for optimal spacing: stack as many lines on"
52            " a page before moving to the next one.")
53 {
54   Minimal_page_breaking b (unsmob<Paper_book> (pb));
55   return b.solve ();
56 }
57
58 LY_DEFINE (ly_one_page_breaking, "ly:one-page-breaking",
59            1, 0, 0, (SCM pb),
60            "Put each score on a single page.  The paper-height settings"
61            " are modified so each score fits on one page, and the"
62            " height of the page matches the height of the full score.")
63 {
64   One_page_breaking b (unsmob<Paper_book> (pb));
65   return b.solve ();
66 }
67
68 LY_DEFINE (ly_one_line_breaking, "ly:one-line-breaking",
69            1, 0, 0, (SCM pb),
70            "Put each score on a single line, and put each line on its own"
71            " page.  Modify the paper-width setting so that every page"
72            " is wider than the widest line.")
73 {
74   One_line_page_breaking b (unsmob<Paper_book> (pb));
75   return b.solve ();
76 }
77
78 LY_DEFINE (ly_one_line_auto_height_breaking, "ly:one-line-auto-height-breaking",
79            1, 0, 0, (SCM pb),
80            "Put each score on a single line, and put each line on its own"
81            " page.  Modify the paper-width setting so that every page"
82            " is wider than the widest line. Modify the paper-height"
83            " setting to fit the height of the tallest line.")
84 {
85   One_line_auto_height_breaking b (unsmob<Paper_book> (pb));
86   return b.solve ();
87 }