- SCM al = scope->to_alist ();
- for (SCM s = al ; gh_pair_p (s); s = gh_cdr (s))
- {
- SCM k = gh_caar (s);
- SCM v = gh_cdar (s);
- String s = ly_symbol2string (k);
-
-
- if (gh_string_p (v))
- {
- output_String_def (prefix + s, ly_scm2string (v));
- }
- else if (scm_integer_p (v) == SCM_BOOL_T)
- {
- output_int_def (prefix + s, gh_scm2int (v));
- }
- else if (gh_number_p (v))
- {
- output_Real_def (prefix + s, gh_scm2double (v));
- }
- }
+ String creator = gnu_lilypond_version_string ();
+ creator += " (http://lilypond.org)";
+ time_t t (time (0));
+ String time_stamp = ctime (&t);
+ time_stamp = time_stamp.left_string (time_stamp.length () - 1)
+ + " " + *tzname;
+ output_scheme (scm_list_n (ly_symbol2scm ("header"),
+ scm_makfrom0str (creator.to_str0 ()),
+ scm_makfrom0str (time_stamp.to_str0 ()),
+ paper->self_scm (),
+ scm_int2num (page_count),
+ ly_bool2scm (is_classic),
+ SCM_UNDEFINED));
+
+ output_metadata (paper, scopes);
+ output_music_output_def (paper);
+
+ output_scheme (scm_list_1 (ly_symbol2scm ("header-end")));
+
+ /* TODO: maybe have Scheme extract the fonts directly from \paper ?
+
+ Alternatively, we could simply load the fonts on demand in the
+ output, and do away with this define-fonts step. */
+ SCM fonts = paper->font_descriptions ();
+ output_scheme (scm_list_3 (ly_symbol2scm ("define-fonts"),
+ paper->self_scm (),
+ //FIXME:
+ ly_quote_scm (ly_list_qsort_uniq_x (fonts))));