From: Han-Wen Nienhuys Date: Fri, 24 Dec 2004 22:52:43 +0000 (+0000) Subject: (output): revert: only allow a single output X-Git-Tag: release/2.5.14~357 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=92f333736a4864a1e53c7af6b8702cc2d2bce7ff;p=lilypond.git (output): revert: only allow a single output format. --- diff --git a/ChangeLog b/ChangeLog index 42ce849f9c..bf8e2f3a6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-12-24 Han-Wen Nienhuys + * lily/paper-book.cc (output): revert: only allow a single output + format. + * lily/include/pango-font.hh: new file. * lily/pango-font.cc: new file. diff --git a/flower/include/parse-afm.hh b/flower/include/parse-afm.hh index 34162dbbe2..3b2d30b577 100644 --- a/flower/include/parse-afm.hh +++ b/flower/include/parse-afm.hh @@ -81,42 +81,11 @@ #include - -/* your basic constants */ -#define TRUE 1 -#define FALSE 0 -#define EOL '\n' /* end-of-line indicator */ -#define MAX_NAME 4096 /* max length for identifiers */ #define BOOL int #define FLAGS int -/* Flags that can be AND'ed together to specify exactly what - * information from the AFM file should be saved. - */ -#define P_G 0x01 /* 0000 0001 */ /* Global Font Info */ -#define P_W 0x02 /* 0000 0010 */ /* Character Widths ONLY */ -#define P_M 0x06 /* 0000 0110 */ /* All Char Metric Info */ -#define P_P 0x08 /* 0000 1000 */ /* Pair Kerning Info */ -#define P_T 0x10 /* 0001 0000 */ /* Track Kerning Info */ -#define P_C 0x20 /* 0010 0000 */ /* Composite Char Info */ - - -/* Commonly used flags - */ -#define P_GW\ - (P_G | P_W) -#define P_GM\ - (P_G | P_M) -#define P_GMP\ - (P_G | P_M | P_P) -#define P_GMK\ - (P_G | P_M | P_P | P_T) -#define P_GALL\ - (P_G | P_M | P_P | P_T | P_C) - - /* Possible return codes from the parseFile procedure. * * ok means there were no problems parsing the file. diff --git a/lily/main.cc b/lily/main.cc index fd1ed22fa9..be54c91bba 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -44,7 +44,8 @@ String init_name_global; bool no_layout_global_b = false; /* Selected output format. - One of tex, ps, scm, as. */ + One of tex, ps, scm, as. +*/ String output_format_global = "ps"; /* Current output name. */ @@ -253,16 +254,10 @@ prepend_load_path (String dir) static void determine_output_options () { - bool found_gnome = false; - bool found_svg = false; - bool found_tex = false; - SCM formats = ly_output_formats (); - for (SCM s = formats; scm_is_pair (s); s = scm_cdr (s)) - { - found_gnome = found_gnome || ly_scm2string(scm_car (s)) == "gnome"; - found_svg = found_gnome || ly_scm2string(scm_car (s)) == "svg"; - found_tex = found_tex || (ly_scm2string (scm_car (s)) == "tex"); - } + bool found_gnome = (output_format_global == "gnome"); + bool found_svg = (output_format_global == "svg"); + bool found_tex = (output_format_global == "tex"); + if (make_pdf || make_png) { diff --git a/lily/paper-book.cc b/lily/paper-book.cc index 446725543b..8ce6188fa5 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -98,21 +98,6 @@ dump_fields () return fields; } -LY_DEFINE (ly_output_formats, "ly:output-formats", - 0, 0, 0, (), - "Formats passed to --format as a list of strings, " - "used for the output.") -{ - Array output_formats = split_string (output_format_global, ','); - - SCM lst = SCM_EOL; - int output_formats_count = output_formats.size (); - for (int i = 0; i < output_formats_count; i ++) - lst = scm_cons (scm_makfrom0str (output_formats[i].to_str0 ()), lst); - - return lst; -} - void Paper_book::post_processing (SCM module, SCM file_name) @@ -154,59 +139,55 @@ Paper_book::output (String outname) /* Generate all stencils to trigger font loads. */ pages (); - SCM formats = ly_output_formats (); - for (SCM s = formats; scm_is_pair (s); s = scm_cdr (s)) - { - String format = ly_scm2string (scm_car (s)); - String file_name = outname; + String format = output_format_global; + String file_name = outname; - if (file_name != "-") - file_name += "." + format; + if (file_name != "-") + file_name += "." + format; - Paper_outputter *out = get_paper_outputter (file_name, format); + Paper_outputter *out = get_paper_outputter (file_name, format); - SCM scopes = SCM_EOL; - if (ly_c_module_p (header_)) - scopes = scm_cons (header_, scopes); + SCM scopes = SCM_EOL; + if (ly_c_module_p (header_)) + scopes = scm_cons (header_, scopes); - String mod_nm = "scm framework-" + format; + String mod_nm = "scm framework-" + format; - SCM mod = scm_c_resolve_module (mod_nm.to_str0 ()); - if (make_pages) - { - SCM func = scm_c_module_lookup (mod, "output-framework"); - - func = scm_variable_ref (func); - scm_apply_0 (func, scm_list_n (out->self_scm (), - self_scm (), - scopes, - dump_fields (), - scm_makfrom0str (outname.to_str0 ()), - SCM_UNDEFINED)); - out->close (); - scm_gc_unprotect_object (out->self_scm ()); - post_processing (mod, scm_makfrom0str (file_name.to_str0 ())); - } + SCM mod = scm_c_resolve_module (mod_nm.to_str0 ()); + if (make_pages) + { + SCM func = scm_c_module_lookup (mod, "output-framework"); + + func = scm_variable_ref (func); + scm_apply_0 (func, scm_list_n (out->self_scm (), + self_scm (), + scopes, + dump_fields (), + scm_makfrom0str (outname.to_str0 ()), + SCM_UNDEFINED)); + out->close (); + scm_gc_unprotect_object (out->self_scm ()); + post_processing (mod, scm_makfrom0str (file_name.to_str0 ())); + } - if (make_preview) - { - String file_name = outname + ".preview." + format; - Paper_outputter *out = get_paper_outputter (file_name, format); + if (make_preview) + { + String file_name = outname + ".preview." + format; + Paper_outputter *out = get_paper_outputter (file_name, format); - SCM func = scm_c_module_lookup (mod, "output-preview-framework"); - func = scm_variable_ref (func); - scm_apply_0 (func, scm_list_n (out->self_scm (), - self_scm (), - scopes, - dump_fields (), - scm_makfrom0str (outname.to_str0 ()), - SCM_UNDEFINED)); - - out->close (); - scm_gc_unprotect_object (out->self_scm ()); - - post_processing (mod, scm_makfrom0str (file_name.to_str0 ())); - } + SCM func = scm_c_module_lookup (mod, "output-preview-framework"); + func = scm_variable_ref (func); + scm_apply_0 (func, scm_list_n (out->self_scm (), + self_scm (), + scopes, + dump_fields (), + scm_makfrom0str (outname.to_str0 ()), + SCM_UNDEFINED)); + + out->close (); + scm_gc_unprotect_object (out->self_scm ()); + + post_processing (mod, scm_makfrom0str (file_name.to_str0 ())); } progress_indication ("\n"); } @@ -226,29 +207,24 @@ Paper_book::classic_output (String outname) scopes = scm_cons (score_systems_[0].header_, scopes); //end ugh - Array output_formats = split_string (output_format_global, ','); - - for (int i = 0; i < output_formats.size (); i++) - { - String format = output_formats[i]; - String mod_nm = "scm framework-" + format; + String format = output_format_global; + String mod_nm = "scm framework-" + format; - SCM mod = scm_c_resolve_module (mod_nm.to_str0 ()); - SCM func = scm_c_module_lookup (mod, "output-classic-framework"); + SCM mod = scm_c_resolve_module (mod_nm.to_str0 ()); + SCM func = scm_c_module_lookup (mod, "output-classic-framework"); - func = scm_variable_ref (func); + func = scm_variable_ref (func); - Paper_outputter *out = get_paper_outputter (outname + "." + format, - format); + Paper_outputter *out = get_paper_outputter (outname + "." + format, + format); - scm_apply_0 (func, scm_list_n (out->self_scm (), self_scm (), scopes, - dump_fields (), - scm_makfrom0str (outname.to_str0 ()), - SCM_UNDEFINED)); + scm_apply_0 (func, scm_list_n (out->self_scm (), self_scm (), scopes, + dump_fields (), + scm_makfrom0str (outname.to_str0 ()), + SCM_UNDEFINED)); - scm_gc_unprotect_object (out->self_scm ()); - progress_indication ("\n"); - } + scm_gc_unprotect_object (out->self_scm ()); + progress_indication ("\n"); } LY_DEFINE (ly_paper_book_pages, "ly:paper-book-pages", diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index e056216422..d480dcf143 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -11,16 +11,13 @@ \context { \type "Engraver_group_engraver" \name Staff - \consists "Output_property_engraver" - \consists "Bar_engraver" % Bar_engraver must be first so default bars aren't overwritten % with empty ones. \consists "Font_size_engraver" - \consists "Volta_engraver" \consists "Separating_line_group_engraver" \consists "Dot_column_engraver"