]> git.donarmstrong.com Git - lilypond.git/commitdiff
use -dbackend=eps iso. --backend=eps for setting backend.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 3 Feb 2007 17:24:08 +0000 (18:24 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 3 Feb 2007 17:24:08 +0000 (18:24 +0100)
14 files changed:
lily/general-scheme.cc
lily/include/program-option.hh
lily/lily-parser.cc
lily/main.cc
lily/modified-font-metric.cc
lily/pango-font.cc
lily/paper-book.cc
lily/program-option-scheme.cc
lily/program-option.cc
make/lilypond-vars.make
scm/framework-svg.scm
scm/framework-texstr.scm
scm/lily.scm
scripts/lilypond-book.py

index 7723bd477b6af67bd5f21d575bb2c6349bc9ad3f..cc46b631a301e473c596738b1fb10811a4cd3da2 100644 (file)
@@ -230,13 +230,6 @@ LY_DEFINE (ly_gettext, "ly:gettext",
   return ly_string2scm (_ (scm_i_string_chars (string)));
 }
 
-LY_DEFINE (ly_output_backend, "ly:output-backend",
-          0, 0, 0, (),
-          "Return name of output backend.")
-{
-  return ly_string2scm (output_backend_global);
-}
-
 LY_DEFINE (ly_output_formats, "ly:output-formats",
           0, 0, 0, (),
           "Formats passed to --format as a list of strings, "
index 66babd51a90376b0bdd7710230854c18561d8beb..7192ea7c46dd51535082e89dacfb77229b822f7c 100644 (file)
@@ -11,8 +11,6 @@
 #include "lily-guile.hh"
 
 /* options */
-extern bool do_midi_debugging_global;
-extern int testing_level_global;
 extern bool lily_1_8_relative;
 extern bool lily_1_8_compatibility_used;
 
@@ -20,5 +18,6 @@ SCM ly_get_option (SCM);
 SCM ly_set_option (SCM, SCM);
 
 bool get_program_option (const char *);
+string get_output_backend_name ();
 
 #endif /* SCM_OPTION_HH */
index 456acd1a9e023109c88139e1a66b270a4f3f3323..05412ad05a6ede933174598b2caba5eb3f8a665b 100644 (file)
@@ -23,6 +23,7 @@
 #include "sources.hh"
 #include "text-metrics.hh"
 #include "warn.hh"
+#include "program-option.hh"
 
 #include "ly-smobs.icc"
 
@@ -85,7 +86,7 @@ Lily_parser::print_smob (SCM s, SCM port, scm_print_state*)
 void
 Lily_parser::parse_file (string init, string name, string out_name)
 {
-  if (output_backend_global == "tex")
+  if (get_output_backend_name () == "tex")
     try_load_text_metrics (out_name);
 
   // TODO: use $parser 
index 4232f17e2e2fc9ee0e212a28f03cffc49a18f4d5..28f3587f3f198e6570620228cb36182660c85ff0 100644 (file)
@@ -53,9 +53,6 @@ vector<string> dump_header_fieldnames_global;
 /* Name of initialisation file. */
 string init_name_global;
 
-/* Selected output backend
-   One of (gnome, ps [default], eps, scm, svg, tex, texstr)") */
-string output_backend_global = "ps";
 
 /* Output formats to generate.  */
 string output_format_global = "";
@@ -150,8 +147,6 @@ static Getopt_long *option_parser = 0;
 
 static Long_option_init options_static[]
 = {
-  {_i ("BACK"), "backend", 'b', _i ("use backend BACK (eps, gnome, ps [default],\nscm, svg, tex, texstr)")},
-
   {_i ("SYM[=VAL]"), "define-default", 'd',
    _i ("set Scheme option SYM to VAL (default: #t).\n"
        "Use -dhelp for help.")},
@@ -383,8 +378,6 @@ main_with_guile (void *, int, char **)
 
   if (be_verbose_global)
     dir_info (stderr);
-  is_TeX_format_global = (output_backend_global == "tex"
-                         || output_backend_global == "texstr");
 
   is_pango_format_global = !is_TeX_format_global;
   init_scheme_variables_global = "(list " + init_scheme_variables_global + ")";
@@ -397,6 +390,9 @@ main_with_guile (void *, int, char **)
   init_freetype ();
   ly_reset_all_fonts ();
 
+  is_TeX_format_global = (get_output_backend_name () == "tex"
+                         || get_output_backend_name () == "texstr");
+  
 
   /* We accept multiple independent music files on the command line to
      reduce compile time when processing lots of small files.
@@ -492,7 +488,7 @@ parse_argv (int argc, char **argv)
              }
 
            init_scheme_variables_global
-             += "(cons \'" + key + "  " + val + ")\n";
+             += "(cons \'" + key + " '" + val + ")\n";
          }
          break;
 
@@ -519,10 +515,6 @@ parse_argv (int argc, char **argv)
          exit (0);
          break;
 
-       case 'b':
-         output_backend_global = option_parser->optional_argument_str0_;
-         break;
-
        case 'f':
          {
            vector<string> components
index 9a5488f1ccca0c971cdea50044ba60f39a24d8b6..ad43d756bc38f4dd74846abc50707dbcdb293f9d 100644 (file)
@@ -14,6 +14,7 @@ using namespace std;
 #include "warn.hh"
 #include "stencil.hh"
 #include "main.hh"
+#include "program-option.hh"
 
 Modified_font_metric::Modified_font_metric (Font_metric *fm,
                                            Real magnification)
@@ -181,7 +182,7 @@ Modified_font_metric::text_dimension (string text) const
   SCM stext = ly_string2scm (text);
   
   Box b;
-  if (output_backend_global == "tex")
+  if (get_output_backend_name () == "tex")
     {
       b = lookup_tex_text_dimension (orig_, stext);
 
index f1fb20e6c58758c04c2b070e4294ec0587e28152..43766881c28e6ba7e0d9c7da6e735ba23678363f 100644 (file)
@@ -23,6 +23,7 @@
 #include "string-convert.hh"
 #include "warn.hh"
 #include "all-font-metrics.hh"
+#include "program-option.hh"
 
 #if HAVE_PANGO_FT2
 #include "stencil.hh"
@@ -351,8 +352,8 @@ Pango_font::text_stencil (string str, bool tight) const
     UGH. Should have flags per output format signifying supported
     options.
   */
-  if (output_backend_global != "ps"
-      && output_backend_global != "eps")
+  string name = get_output_backend_name ();
+  if (name != "ps" && name != "eps")
     {
       /*
        For Pango based backends, we take a shortcut.
index bf6a98e5363416673161cddb9410d655f6b60331..195e978f65a1581e84d1f4913e6d45c104ae76d2 100644 (file)
@@ -16,6 +16,7 @@
 #include "paper-system.hh"
 #include "text-interface.hh"
 #include "warn.hh"
+#include "program-option.hh"
 
 #include "ly-smobs.icc"
 
@@ -106,7 +107,7 @@ Paper_book::output (SCM output_channel)
   if (ly_is_module (header_))
     scopes = scm_cons (header_, scopes);
 
-  string mod_nm = "scm framework-" + output_backend_global;
+  string mod_nm = "scm framework-" + get_output_backend_name ();
 
   SCM mod = scm_c_resolve_module (mod_nm.c_str ());
   if (make_print)
@@ -153,7 +154,7 @@ Paper_book::classic_output (SCM output)
   if (ly_is_module (header_0_))
     scopes = scm_cons (header_0_, scopes);
 
-  string format = output_backend_global;
+  string format = get_output_backend_name ();
   string mod_nm = "scm framework-" + format;
 
   SCM mod = scm_c_resolve_module (mod_nm.c_str ());
index fe0f290c2744c60dd9a5dc65871d645841cab11d..1efcc75a2949d164b9eb92661c635e5e10cdb6ac 100644 (file)
@@ -92,16 +92,6 @@ void internal_set_option (SCM var, SCM val)
 
 
 
-
-bool
-get_program_option (const char *s)
-{
-  SCM sym = ly_symbol2scm (s);
-
-  return to_boolean (ly_get_option (sym));
-}
-
-
 ssize const HELP_INDENT = 30;
 ssize const INDENT = 2;
 ssize const SEPARATION = 5;
@@ -242,3 +232,5 @@ LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
   LY_ASSERT_TYPE (ly_is_symbol, var, 1);
   return scm_hashq_ref (option_hash, var, SCM_BOOL_F);
 }
+
+
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ebc2c92ba1dbf5671532654c39cc2c9cb6ab3b50 100644 (file)
@@ -0,0 +1,25 @@
+/* 
+  program-option.cc -- program options, non-scheme.
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 2007 Han-Wen Nienhuys <hanwen@lilypond.org>
+  
+*/
+
+#include "program-option.hh"
+
+string
+get_output_backend_name ()
+{
+  return ly_symbol2string (ly_get_option (ly_symbol2scm ("backend")));
+}
+
+bool
+get_program_option (const char *s)
+{
+  SCM sym = ly_symbol2scm (s);
+
+  return to_boolean (ly_get_option (sym));
+}
+
index 6c158329815a06c18b5fafb435999102a5b39aca..fd821eddcb8b7d17b174963f1d3df47c293fa2a6 100644 (file)
@@ -27,7 +27,7 @@ LILYPOND_BOOK_INCLUDES = -I $(src-dir)/ -I $(outdir) -I $(input-dir) -I $(input-
 ## override from cmd line to speed up. 
 ANTI_ALIAS_FACTOR=2
 LILYPOND_JOBS=$(if $(CPU_COUNT),-djob-count=$(CPU_COUNT),)
-LILYPOND_BOOK_LILYPOND_FLAGS=--backend=eps --formats=ps,png,pdf $(LILYPOND_JOBS) -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -dcheck-internal-types -ddump-signatures -danti-alias-factor=$(ANTI_ALIAS_FACTOR)
+LILYPOND_BOOK_LILYPOND_FLAGS=-dbackend=eps --formats=ps,png,pdf $(LILYPOND_JOBS) -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -dcheck-internal-types -ddump-signatures -danti-alias-factor=$(ANTI_ALIAS_FACTOR)
 LILYPOND_BOOK_VERBOSE = --verbose
 LILYPOND_BOOK_FLAGS = --process="$(LILYPOND_BINARY) $(LILYPOND_BOOK_LILYPOND_FLAGS)" $(LILYPOND_BOOK_VERBOSE)
 TEXINPUTS=$(top-src-dir)/tex/::
index 2e40558e64d448045218286f58cfcd77ca1d092b..6abb3438b8f11b072c0dcc83a8e6890a45bf7fcf 100644 (file)
@@ -20,7 +20,7 @@
 (define-public (output-framework basename book scopes fields)
   (let* ((filename (format "~a.svg" basename))
         (outputter  (ly:make-paper-outputter (open-file filename "wb")
-                                             (ly:output-backend)))
+                                             (ly:get-option 'backend)))
         (dump (lambda (str) (display str (ly:outputter-port outputter))))
         (paper (ly:paper-book-paper book))
         (unit-length (ly:output-def-lookup paper 'output-scale))
index 5078b35b9d53dc7845675a9487769bd97817c806..6bde0616bd2ebfb2d65691f0bb687efd65814ca2 100644 (file)
@@ -35,7 +35,7 @@
   (let* ((filename (format "~a.texstr" basename))
         (outputter (ly:make-paper-outputter
                     (open-file filename "wb")
-                    (ly:output-backend)))
+                    (ly:get-option 'backend)))
         (paper (ly:paper-book-paper book))
         (lines (ly:paper-book-systems book)))
     (ly:outputter-dump-string outputter (header basename))
@@ -50,7 +50,7 @@
         (outputter
          (ly:make-paper-outputter
           (open-file filename "wb")
-          (ly:output-backend)))
+          (ly:get-option 'backend)))
         (paper (ly:paper-book-paper book))
         (pages (ly:paper-book-pages book)))
     (ly:outputter-dump-string outputter (header basename))
index 893cc59243f8b7ef45819aa78465878f2bf64b19..b366507f5d1a05e909d7772a89795f80dc45135c 100644 (file)
@@ -28,6 +28,7 @@
     ;; - [subject-]-verb-object-object
 
     (anti-alias-factor 1 "render at higher resolution and scale down result\nto prevent jaggies in PNG")
+    (backend ps "which backend to use by default; Options: eps, ps [default], scm, svg, tex, texstr)")
     (check-internal-types #f "check every property assignment for types")
     (clip-systems #f "Generate cut-out snippets of a score")
     (debug-gc #f "dump memory debugging statistics")
@@ -137,7 +138,7 @@ on errors, and print a stack trace.")
     (coverage:enable))
 
 (define-public tex-backend?
-  (member (ly:output-backend) '("texstr" "tex")))
+  (member (ly:get-option 'backend) '(texstr tex)))
 
 (define-public parser #f)
 
index 09eefff340c2322be5dd50b53770ad8661d2d5cb..2ff452fdf9304d6ffd34a03e6c60ab66b19e021c 100644 (file)
@@ -140,7 +140,7 @@ def get_option_parser ():
     p.add_option ('-P', '--process', metavar=_ ("COMMAND"),
                   help = _ ("process ly_files using COMMAND FILE..."),
                   action='store', 
-                  dest='process_cmd', default='lilypond -eps')
+                  dest='process_cmd', default='lilypond -dbackend=eps')
     p.add_option ('--pdf',
                   action="store_true",
                   dest="create_pdf",