+ Output_def *def = outdef_count ? defs_[i] : default_def;
+ SCM scaled = SCM_EOL;
+
+ if (def->c_variable ("is-layout") == SCM_BOOL_T)
+ {
+ def = scale_output_def (def, scale);
+ def->parent_ = layoutbook;
+
+ scaled = def->unprotect ();
+ }
+
+ /* TODO: fix or junk --no-layout. */
+ SCM context = ly_run_translator (music_, def->self_scm ());
+ if (dynamic_cast<Global_context *> (unsmob_context (context)))
+ {
+ SCM s = ly_format_output (context);
+
+ *tail = scm_cons (s, SCM_EOL);
+ tail = SCM_CDRLOC (*tail);
+ }
+
+ scm_remember_upto_here_1 (scaled);