"
}
-\paper {
- #(define page-breaking ly:page-turn-breaking)
- paper-height = #70
- print-page-number = ##t
-}
+\book {
+ \paper {
+ #(define page-breaking ly:page-turn-breaking)
+ paper-height = #65
+ print-page-number = ##t
+ }
-\relative c' {
- a b c d a b c d \break
- c d e f c d e f \break
- d e f g d e f g
+ \score {
+ \relative c' {
+ a b c d a b c d \break
+ c d e f c d e f \break
+ d e f g d e f g
+ }
+ }
}
--- /dev/null
+\version "2.10.0"
+
+\header {
+ texidoc = "The page-turn engraver will not count potential page
+turns if they occur in the middle of a repeat unless there is a
+long gap at the beginning or at the end of the repeat.
+"
+}
+
+\layout {
+ \context {
+ \Staff
+ \consists "Page_turn_engraver"
+ }
+}
+
+\book {
+ \paper {
+ #(define page-breaking ly:page-turn-breaking)
+ paper-height = #80
+ print-page-number = ##t
+ print-first-page-number = ##t
+ }
+
+ \score {
+ \relative {
+ \set Score.skipBars = ##t
+ % this should be kept on one page
+ \repeat volta 2 {
+ \repeat unfold 7 {a4 b c d16 d d d} R1*10
+ \repeat unfold 8 {a4 b c d16 d d d} \pageTurn
+ }
+ % use up a page
+ a4 b c d a b c d \pageBreak
+
+ % this should be allowed to have a page turn
+ \repeat volta 2 {
+ \repeat unfold 7 {a4 b c d16 d d d} R1*10
+ \repeat unfold 7 {a4 b c d16 d d d} R1*3
+ }
+ }
+ }
+}
\ No newline at end of file
"
}
-\paper {
- #(define page-breaking ly:page-turn-breaking)
- paper-height = #70
- auto-first-page-number = ##t
- print-page-number = ##t
- print-first-page-number = ##t
-}
-
\layout {
\context {
\Staff
}
}
-\relative c' {
- a b c d a b c d \break
- c d e f c d e f R1*4
- \repeat unfold 15 {d4 e f g} \break
- c d e f c d e f R1*2 \bar "||" R1*2
- \repeat unfold 15 {d4 e f g}
+\book {
+
+ \paper {
+ #(define page-breaking ly:page-turn-breaking)
+ paper-height = #65
+ auto-first-page-number = ##t
+ print-page-number = ##t
+ print-first-page-number = ##t
+ }
+
+ \score {
+ \relative c' {
+ a b c d a b c d \break
+ c d e f c d e f R1*4
+ \repeat unfold 15 {d4 e f g} \break
+ c d e f c d e f R1*2 \bar "||" R1*2
+ \repeat unfold 15 {d4 e f g}
+ }
+ }
}
#include "international.hh"
#include "item.hh"
#include "output-def.hh"
+#include "paper-column.hh"
#include "pitch.hh"
#include "stencil.hh"
return SCM_UNSPECIFIED;
}
+MAKE_SCHEME_CALLBACK (Accidental_interface, pure_height, 3);
+SCM
+Accidental_interface::pure_height (SCM smob, SCM start_scm, SCM)
+{
+ Item *me = dynamic_cast<Item*> (unsmob_grob (smob));
+ int start = scm_to_int (start_scm);
+ int rank = me->get_column ()->get_rank ();
+
+ bool visible = to_boolean (me->get_property ("forced"))
+ || !unsmob_grob (me->get_object ("tie"))
+ || rank != start + 1; /* we are in the middle of a line */
+
+ return visible ? Grob::stencil_height (smob) : ly_interval2scm (Interval ());
+}
+
vector<Box>
Accidental_interface::accurate_boxes (Grob *me, Grob **common)
{
Interval
Grob::pure_height (Grob *refp, int start, int end)
{
- SCM proc = get_property_data ( ly_symbol2scm ("Y-extent"));
- Interval iv = robust_scm2interval (call_pure_function (proc,
- scm_list_1 (self_scm ()),
- start, end),
- Interval (0, 0));
+ SCM proc = get_property_data (ly_symbol2scm ("Y-extent"));
+ SCM pure_proc = get_property_data (ly_symbol2scm ("pure-Y-extent"));
+ SCM iv_scm;
+
+ if (ly_is_procedure (pure_proc))
+ iv_scm = scm_apply_3 (pure_proc,
+ self_scm (),
+ scm_from_int (start),
+ scm_from_int (end), SCM_EOL);
+ else
+ iv_scm = call_pure_function (proc,
+ scm_list_1 (self_scm ()),
+ start, end);
+
+ Interval iv = robust_scm2interval (iv_scm, Interval (0, 0));
Real offset = pure_relative_y_coordinate (refp, start, end);
SCM min_ext = get_property ("minimum-Y-extent");
"outside-staff-horizontal-padding "
"outside-staff-padding "
"outside-staff-priority "
+ "pure-Y-extent "
"rotation "
"springs-and-rods "
"staff-symbol "
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (calc_stencils, (SCM));
DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+ DECLARE_SCHEME_CALLBACK (pure_height, (SCM, SCM, SCM));
DECLARE_GROB_INTERFACE();
static string get_fontcharname (string style, int alteration);
/* If [START, END] does not contain an intermediate
breakpoint, we may need to consider solutions that result in a bad turn.
In this case, we won't abort if the min_page_count is too big */
- if (start < end - 1 && min_p_count > 2)
+ if (start < end - 1 && min_p_count + (page_number % 2) > 2)
return Break_node ();
/* if PAGE-NUMBER is odd, we are starting on a right hand page. That is, we
Page_turn_page_breaking::final_page_num (Break_node const &b)
{
vsize end = b.first_page_number_ + b.page_count_;
- return end + 1 - (end % 2);
+ return end - 1 + (end % 2);
}
void
cur = put_systems_on_pages (start, end, line, div[d], p_num);
if (isinf (cur.demerits_)
- || (cur.page_count_ > 2
+ || (cur.page_count_ + (p_num % 2) > 2
&& (!isinf (this_start_best.demerits_))
&& final_page_num (cur) > final_page_num (this_start_best)))
{
(glyph-name-alist . ,standard-alteration-glyph-name-alist)
(alteration . ,accidental-interface::calc-alteration)
(stencil . ,ly:accidental-interface::print)
+ (pure-Y-extent . ,ly:accidental-interface::pure-height)
(after-line-breaking
. ,ly:accidental-interface::after-line-breaking)
(meta . ((class . Item)
(glyph-name-alist . ,standard-alteration-glyph-name-alist)
(alteration . ,accidental-interface::calc-alteration)
(stencil . ,ly:accidental-interface::print)
+ (pure-Y-extent . ,ly:accidental-interface::pure-height)
(after-line-breaking
. ,ly:accidental-interface::after-line-breaking)
(meta . ((class . Item)
(X-offset . ,ly:side-position-interface::x-aligned-side)
(direction . ,LEFT)
(stencil . ,ly:accidental-interface::print)
+ (pure-Y-extent . ,ly:accidental-interface::pure-height)
(glyph-name-alist . ,standard-alteration-glyph-name-alist)
(after-line-breaking . ,ly:accidental-interface::after-line-breaking)
(side-axis . ,X)