-
-/* calculate book height, #lines, stencils. */
-void
-Paper_book::init ()
-{
- int score_count = score_lines_.size ();
-
- /* Calculate the full book height. Hmm, can't we cache system
- heights while making stencils? */
- height_ = 0;
- Stencil btitle = book_title ();
- if (!btitle.is_empty ())
- height_ += btitle.extent (Y_AXIS).length ();
-
- for (int i = 0; i < score_count; i++)
- {
- Stencil title = score_title (i);
- if (!title.is_empty ())
- height_ += title.extent (Y_AXIS).length ();
-
- int line_count = SCM_VECTOR_LENGTH (score_lines_[i].lines_);
- for (int j = 0; j < line_count; j++)
- {
- SCM s = scm_vector_ref ((SCM) score_lines_[i].lines_, scm_int2num (j));
- height_ += unsmob_paper_line (s)->dim ()[Y_AXIS];
- }
- }
-
- Output_def *paper = bookpaper_;
-
- SCM scopes = SCM_EOL;
- if (ly_c_module_p (header_))
- scopes = scm_cons (header_, scopes);
-
- SCM make_tagline = paper->c_variable ("make-tagline");
- tagline_ = scm_call_2 (make_tagline, paper->self_scm (), scopes);
- Real tag_height = 0;
- if (Stencil *s = unsmob_stencil (tagline_))
- tag_height = s->extent (Y_AXIS).length ();
- height_ += tag_height;
-
- SCM make_copyright = paper->c_variable ("make-copyright");
- copyright_ = scm_call_2 (make_copyright, paper->self_scm (), scopes);
- Real copy_height = 0;
- if (Stencil *s = unsmob_stencil (copyright_))
- copy_height = s->extent (Y_AXIS).length ();
- height_ += copy_height;
-}
-