Offset dim = Offset (stil->extent (X_AXIS).length (),
stil->extent (Y_AXIS).length ());
Paper_line *pl = new Paper_line (dim, scm_cons (stil->smobbed_copy (),
- SCM_EOL), is_title);
+ SCM_EOL),
+ -10001 * is_title, is_title);
return scm_gc_unprotect_object (pl->self_scm ());
}
if (get_footer ())
out->output_line (stencil2line (get_footer ()), &o, is_last);
out->output_scheme (scm_list_2 (ly_symbol2scm ("stop-page"),
- gh_bool2scm (is_last && !get_footer ())));
+ ly_bool2scm (is_last && !get_footer ())));
progress_indication ("]");
}
/****************************************************************/
-/* Current global paper book. Gives default_rendering access from
- input-file-results. */
-Paper_book *paper_book;
-
Paper_book::Paper_book ()
{
copyright_ = SCM_EOL;
Paper_def *paper = papers_[0];
Paper_outputter *out = paper->get_paper_outputter (outname);
- out->output_header (paper, scopes (0), pages->size ());
+ out->output_header (paper, scopes (0), pages->size (), false);
int page_count = pages->size ();
for (int i = 0; i < page_count; i++)
out->output_scheme (scm_list_1 (ly_symbol2scm ("end-output")));
- /*
- Ugh
- */
- for (int i =pages->size (); i--;)
- delete pages->elem(i);
+ /* Ugh. */
+ for (int i = pages->size (); i--;)
+ delete pages->elem (i);
delete pages;
-
progress_indication ("\n");
}
SCM scopes = SCM_EOL;
if (headers_[i])
scopes = scm_cons (headers_[i], scopes);
- if (global_headers_[i] && global_headers_[i] != headers_[i])
+ if (global_headers_.size ()
+ && global_headers_[i] && global_headers_[i] != headers_[i])
scopes = scm_cons (global_headers_[i], scopes);
return scopes;
}
Paper_book::title (int i)
{
SCM user_title = ly_scheme_function ("user-title");
- SCM book_title = ly_scheme_function ("book-title");
- SCM score_title = ly_scheme_function ("score-title");
+ SCM book_title = ly_scheme_function ("book-title");
+ SCM score_title = ly_scheme_function ("score-title");
SCM field = (i == 0 ? ly_symbol2scm ("bookTitle")
: ly_symbol2scm ("scoreTitle"));
{
int count = scores_.size ();
Paper_outputter *out = papers_.top ()->get_paper_outputter (outname);
- out->output_header (papers_.top (), scopes (count - 1), 0);
+ out->output_header (papers_.top (), scopes (count - 1), 0, true);
+ Paper_line *first = unsmob_paper_line (scm_vector_ref (scores_.top (),
+ scm_int2num (0)));
+ Offset o (0, -0.5 * first->dim ()[Y_AXIS]);
int line_count = SCM_VECTOR_LENGTH ((SCM) scores_.top ());
for (int i = 0; i < line_count; i++)
out->output_line (scm_vector_ref ((SCM) scores_.top (), scm_int2num (i)),
- 0, i == line_count - 1);
+ &o, i == line_count - 1);
out->output_scheme (scm_list_1 (ly_symbol2scm ("end-output")));
progress_indication ("\n");
SCM all = lines ();
SCM proc = paper->get_scmvar ("page-breaking");
- SCM breaks = scm_apply_0 (proc, scm_list_n (all, gh_double2scm (height_),
- gh_double2scm (text_height),
- gh_double2scm (-copy_height),
- gh_double2scm (-tag_height),
- SCM_UNDEFINED));
+ SCM breaks = scm_apply_0 (proc, scm_list_n (all, scm_make_real (height_),
+ scm_make_real (text_height),
+ scm_make_real (-copy_height),
+ scm_make_real (-tag_height),
+ SCM_UNDEFINED));
/* Copyright on first page. */
if (unsmob_stencil (copyright_))
if (i)
page = new Page (paper, i+1);
int next = i + 1 < page_count
- ? gh_scm2int (scm_vector_ref (breaks, gh_int2scm (i))) : 0;
+ ? ly_scm2int (scm_vector_ref (breaks, scm_int2num (i))) : 0;
while ((!next && all != SCM_EOL) || line <= next)
{
SCM s = ly_car (all);
h += pl->dim ()[Y_AXIS];
if (!pl->is_title () && h > page_height)
{
- breaks = ly_snoc (gh_int2scm (number), breaks);
+ breaks = ly_snoc (scm_int2num (number), breaks);
page_number++;
page_height = text_height + (page_number == page_count) * last;
h = 0;
}
if (ly_cdr (s) == SCM_EOL)
- breaks = ly_snoc (gh_int2scm (pl->number_), breaks);
+ breaks = ly_snoc (scm_int2num (pl->number_), breaks);
}
return scm_vector (breaks);
"Return a vector with line numbers of page breaks.")
{
SCM_ASSERT_TYPE (scm_pair_p (lines), lines, SCM_ARG1, __FUNCTION__, "list");
- SCM_ASSERT_TYPE (gh_number_p (book), book, SCM_ARG2, __FUNCTION__, "real");
- SCM_ASSERT_TYPE (gh_number_p (text), text, SCM_ARG2, __FUNCTION__, "real");
- SCM_ASSERT_TYPE (gh_number_p (first), first, SCM_ARG2, __FUNCTION__, "real");
- SCM_ASSERT_TYPE (gh_number_p (last), last, SCM_ARG2, __FUNCTION__, "real");
+ SCM_ASSERT_TYPE (is_number (book), book, SCM_ARG2, __FUNCTION__, "real");
+ SCM_ASSERT_TYPE (is_number (text), text, SCM_ARG2, __FUNCTION__, "real");
+ SCM_ASSERT_TYPE (is_number (first), first, SCM_ARG2, __FUNCTION__, "real");
+ SCM_ASSERT_TYPE (is_number (last), last, SCM_ARG2, __FUNCTION__, "real");
return c_ragged_page_breaks (lines,
- gh_scm2double (book), gh_scm2double (text),
- gh_scm2double (first), gh_scm2double (last));
+ ly_scm2double (book), ly_scm2double (text),
+ ly_scm2double (first), ly_scm2double (last));
}