+ for (SCM s = get_elt_pointer ("all-elements");
+ gh_pair_p (s); s = gh_cdr (s))
+ {
+ Score_element* sc = unsmob_element (gh_car (s));
+ sc->calculate_dependencies (POSTCALCED, POSTCALCING,
+ ly_symbol2scm ("after-line-breaking-callback"));
+ }
+
+ Interval i(extent(Y_AXIS));
+ if (i.empty_b())
+ programming_error ("Huh? Empty Line_of_score?");
+ else
+ translate_axis (- i[MAX], Y_AXIS);
+
+ Real height = i.length ();
+ if (height > 50 CM)
+ {
+ programming_error ("Improbable system height");
+ height = 50 CM;
+ }
+
+ /*
+ generate all molecules to trigger all font loads.
+
+ (ugh. This is not very memory efficient.) */
+ for (SCM s = get_elt_pointer ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+ unsmob_element (gh_car (s))->get_molecule ();
+
+ /*
+ font defs;
+ */
+ SCM font_names = ly_quote_scm (all_fonts_global_p->font_descriptions ());
+ output_scheme (gh_list (ly_symbol2scm ("define-fonts"),
+ font_names,
+ SCM_UNDEFINED));
+
+ /*
+ line preamble.
+ */
+ output_scheme (gh_list (ly_symbol2scm ("start-line"),
+ gh_double2scm (height),
+ SCM_UNDEFINED));
+
+ Real il = paper_l ()->get_var ("interline");
+
+ /*
+ all elements.
+ */
+ for (SCM s = get_elt_pointer ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
+ {
+ Score_element * sc = unsmob_element (gh_car (s));
+ Molecule m = sc->get_molecule ();
+
+ Offset o (sc->relative_coordinate (this, X_AXIS),
+ sc->relative_coordinate (this, Y_AXIS));
+
+ SCM e = sc->get_elt_property ("extra-offset");
+ if (gh_pair_p (e))
+ {
+ o[X_AXIS] += il * gh_scm2double (gh_car (e));
+ o[Y_AXIS] += il * gh_scm2double (gh_cdr (e));
+ }
+
+ output_molecule (m.get_expr (), o);
+ }
+ output_scheme (gh_list (ly_symbol2scm ("stop-line"), SCM_UNDEFINED));