+
+void
+set_system_penalty (Prob *ps, SCM header)
+{
+ if (ly_is_module (header))
+ {
+ SCM force = ly_module_lookup (header, ly_symbol2scm ("breakbefore"));
+ if (SCM_VARIABLEP (force)
+ && scm_is_bool (SCM_VARIABLE_REF (force)))
+ {
+ ps->set_property ("penalty",
+ scm_from_int(to_boolean (SCM_VARIABLE_REF (force))
+ ? -10000
+ : 10000));
+ }
+ }
+}
+
+void
+Paper_book::add_score_title (SCM header)
+{
+ Stencil title = score_title (header);
+ if (title.is_empty ())
+ title = score_title (header_);
+ if (!title.is_empty ())
+ {
+ /*
+ TODO: this should come from the \layout {} block, which should
+ override settings from \paper {}
+ */
+ SCM props = paper_->lookup_variable (ly_symbol2scm ("score-title-properties"));
+ Prob *ps = make_paper_system (props);
+ paper_system_set_stencil (ps, title);
+
+ systems_ = scm_cons (ps->self_scm (), systems_);
+ ps->unprotect ();
+ set_system_penalty (ps, header);
+ }
+}
+