]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 3 May 2005 11:31:51 +0000 (11:31 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 3 May 2005 11:31:51 +0000 (11:31 +0000)
14 files changed:
ChangeLog
lily/beam-quanting.cc
lily/main.cc
lily/stencil.cc
make/lilypond.fedora.spec.in
mf/GNUmakefile
scm/backend-library.scm
scm/framework-eps.scm
scm/lily.scm
scm/output-gnome.scm
scm/output-ps.scm
scripts/GNUmakefile
scripts/lilypond-ps2png.py [new file with mode: 0644]
scripts/ps2png.py [deleted file]

index bd546918a0f6865ffb78e47b519855e69a5552d7..621feac57aa8642212d0d7e677070550b0ebe710 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
 2005-05-03  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/beam-quanting.cc (quanting): robustness fix, don't produce
+       infinity for unfeasible beams.
+
+       * make/lilypond.fedora.spec.in (Group): idem.
+
+       * scripts/GNUmakefile (SEXECUTABLES): rename ps2png to lilypond-ps2png
+
+       * mf/GNUmakefile (ALL_GEN_FILES): remove .map
+
        * scm/framework-ps.scm (write-preamble): extract CFF from OTF
        fonts directly.
 
index c950349fc18fd5082bd1e7f3d5803b1c5ac2402d..929cbc385c482574853f53e032f5fbc2e7b54e1c 100644 (file)
@@ -77,12 +77,6 @@ best_quant_score_idx (Array<Quant_score> const &qscores)
        }
     }
 
-  if (best_idx < 0)
-    {
-      programming_error ("no best beam quant score");
-      best_idx = 0;
-    }
-
   return best_idx;
 }
 
@@ -265,10 +259,10 @@ Beam::quanting (SCM smob)
       }
 
   int best_idx = best_quant_score_idx (qscores);
-
+  
 #if DEBUG_QUANTING
   SCM inspect_quants = me->get_property ("inspect-quants");
-  if (to_boolean (me->get_layout ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting")))
+  if ( to_boolean (me->get_layout ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting")))
       && scm_is_pair (inspect_quants))
     {
       Drul_array<Real> ins = ly_scm2interval (inspect_quants);
@@ -289,12 +283,18 @@ Beam::quanting (SCM smob)
        programming_error ("can't find quant");
     }
 #endif
-
-  me->set_property ("positions",
-                   ly_interval2scm (Drul_array<Real> (qscores[best_idx].yl,
-                                                      qscores[best_idx].yr)));
+  if (best_idx < 0)
+    {
+      warning (_ ("no feasible beam position"));
+      me->set_property ("positions", ly_interval2scm (Interval (0,0)));
+    }
+  else
+    me->set_property ("positions",
+                     ly_interval2scm (Drul_array<Real> (qscores[best_idx].yl,
+                                                        qscores[best_idx].yr)));
 #if DEBUG_QUANTING
-  if (to_boolean (me->get_layout ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting"))))
+  if (best_idx >= 0
+      && to_boolean (me->get_layout ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting"))))
     {
       qscores[best_idx].score_card_ += to_string ("i%d", best_idx);
 
index cf6f9fd2c062fa0ca22ab070416a861786515745..535014510ddfb1ad1f02698c4acfa7430f135c5b 100644 (file)
@@ -607,6 +607,8 @@ main (int argc, char **argv)
 
   scm_boot_guile (argc, argv, main_with_guile, 0);
 
-  /* Unreachable */
-  return 0;
+  /*
+    If we get here, GUILE exited. This is an error.
+   */
+  return 1;
 }
index 407fcd0ce53b8bedbffa9a3d301c73c9279abaee..3ebd5b28864f99d2d8a041e441c98fee80aa1ef8 100644 (file)
@@ -87,7 +87,11 @@ Stencil::translate (Offset o)
   Axis a = X_AXIS;
   while (a < NO_AXES)
     {
-      if (isinf (o[a]) || isnan (o[a]))
+      if (isinf (o[a])
+         || isnan (o[a])
+
+         // ugh, hardcoded. 
+         || fabs (o[a]) > 1e6) 
        {
          programming_error (String_convert::form_string ("Improbable offset for stencil: %f staff space", o[a])
                             + "\n"
index 069bd1ef0b67e64b5b068cd856388604591ebc8f..2d9294955d9e38ac06684d591bf845f1ce51562f 100644 (file)
@@ -155,7 +155,7 @@ scrollkeeper-update
 %{_bindir}/midi2ly
 %{_bindir}/lilypond-book
 %{_bindir}/mup2ly
-%{_bindir}/ps2png
+%{_bindir}/lilypond-ps2png
 %{_bindir}/lilypond-pdfpc-helper
 
 %doc THANKS
@@ -177,7 +177,7 @@ scrollkeeper-update
 %{_mandir}/man1/midi2ly.1.gz
 %{_mandir}/man1/lilypond-book.1.gz
 %{_mandir}/man1/mup2ly.1.gz
-%{_mandir}/man1/ps2png.1.gz
+%{_mandir}/man1/lilypond-ps2png.1.gz
 %{_mandir}/man1/lilypond-pdfpc-helper.1.gz
 
 %{_datadir}/lilypond/@TOPLEVEL_VERSION@/
index 46a7dd063db5d0bc04be294f09cefddc7c4a8ce9..18825a86e69d3216b680ad621efaf58e42c66c1c 100644 (file)
@@ -127,7 +127,7 @@ PFA_FILES = $(ALL_FONTS:%=$(outdir)/%.pfa) $(PFA_OTF_FILES)
 
 # Make tfm files first, log files last, 
 # so that normally log files aren't made twice
-ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(FETA_LIST_FILES)  $(OTF_TABLES) $(PFA_FILES) $(outdir)/lilypond.map $(OTF_FILES) $(SVG_FILES)
+ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(FETA_LIST_FILES)  $(OTF_TABLES) $(PFA_FILES) $(OTF_FILES) $(SVG_FILES)
 
 #PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
 INSTALLATION_DIR=$(local_lilypond_datadir)/fonts/source
index 97caa8ef98878a540eaf0f1fe1b847547f73e77d..d8428c106bc341b607655ab287946fc2be1ccb73 100644 (file)
 
 (define-public (postscript->png resolution papersizename name)
   (let* ((prefix (ly:effective-prefix))
-        ;; FIXME: should scripts/ps2png.py be installed in PREFIX?
+
+        ;; run the source, if  we are in the build-directory
         (ps2png-source (if prefix
-                          (format "~a/scripts/ps2png.py" prefix)
-                          "ps2png"))
+                          (format "~a/scripts/lilypond-ps2png.py" prefix)
+                          "lilypond-ps2png"))
         (cmd (format #f
                      "~a --resolution=~S --papersize=~a~a '~a'"
                      (if (file-exists? ps2png-source)
index 976a41d077025e6d18135e54270778c3ae3c4f49..b0212a8e69545a58b230ad9008b16060df70f16f 100644 (file)
@@ -30,6 +30,7 @@
     (if (pair? stencils)
        (let* ((line (car stencils))
               (rest (cdr stencils)))
+
          (dump-stencil-as-EPS
           paper
           line (format "~a-~a" basename count)
@@ -68,6 +69,7 @@
 
 (define-public (output-classic-framework basename book scopes fields)
   (output-scopes scopes fields basename)
+  
   (dump-stencils-as-EPSes
    (map ly:paper-system-stencil (ly:paper-book-systems book))
    book
index 9a0b1dfb605034a4a6d53c08796c8eccb63bc5b2..79f88d2af6c7b4043301d764fdf57e2139a729e0 100644 (file)
@@ -317,7 +317,9 @@ The syntax is the same as `define*-public'."
      files)
     
     (if (pair? failed)
-       (ly:error (_ "failed files: ~S") (string-join failed))
+       (begin
+         (ly:error (_ "failed files: ~S") (string-join failed))
+         (exit 1))
        (begin
          ;; HACK: be sure to exit with single newline
          (ly:message "")
index 0ea432e4f477797b544d6302e659106557b8d53c..f9d45a46395659190be6ab1fadcee64d9a4644a1 100644 (file)
@@ -79,8 +79,6 @@ lilypond -fgnome input/simple-song.ly
 ;;; point-and-click: (mouse-1) click on a graphical object;
 ;;; grob-property-list: (mouse-3) click on a graphical object.
 
-(debug-enable 'backtrace)
-
 (define-module (scm output-gnome))
 (define this-module (current-module))
 
index b31ac807a49d98437f2fa0b5ce0fb06a5c1c8cac..8789ab096ae92479de175aa0f76c9cc3081a0e21 100644 (file)
@@ -62,7 +62,6 @@
 ;;(write (ly:all-output-backend-commands))
 ;;(write (ly:all-stencil-expressions))
 
-
 ;;; helper functions, not part of output interface
 (define (escape-parentheses s)
   (regexp-substitute/global #f "(^|[^\\])([\\(\\)])" s 'pre 1 "\\" 2 'post))
index b0d99517a1ecb12f12108fc4d674be0b64a2ecd7..90ff74929cb23ec23d6acb58af28298829122401 100644 (file)
@@ -1,6 +1,6 @@
 depth = ..
 
-SEXECUTABLES=convert-ly lilypond-book abc2ly etf2ly mup2ly midi2ly ps2png lilypond-pdfpc-helper
+SEXECUTABLES=convert-ly lilypond-book abc2ly etf2ly mup2ly midi2ly lilypond-ps2png lilypond-pdfpc-helper
 
 STEPMAKE_TEMPLATES=script help2man po
 LOCALSTEPMAKE_TEMPLATES = lilypond
diff --git a/scripts/lilypond-ps2png.py b/scripts/lilypond-ps2png.py
new file mode 100644 (file)
index 0000000..194af0b
--- /dev/null
@@ -0,0 +1,77 @@
+#!@PYTHON@
+
+import getopt
+import glob
+import os
+import string
+import sys
+
+datadir = '@local_lilypond_datadir@'
+if not os.path.isdir (datadir):
+       datadir = '@lilypond_datadir@'
+if os.environ.has_key ('LILYPONDPREFIX') :
+       datadir = os.environ['LILYPONDPREFIX']
+       while datadir[-1] == os.sep:
+               datadir= datadir[:-1]
+
+sys.path.insert (0, os.path.join (datadir, 'python'))
+
+# Customize these
+#if __name__ == '__main__':
+
+import lilylib as ly
+global _;_=ly._
+global re;re = ly.re
+
+preview_resolution = 90
+# Use /etc/papersize?
+preview_papersize = "a4"
+
+# lilylib globals
+program_name = os.path.basename (sys.argv[0])
+verbose_p = 0
+program_version = '@TOPLEVEL_VERSION@'
+pseudo_filter_p = 0 # ugr.
+
+help_summary = _ ("Convert PostScript to PNG image.")
+copyright = ('Han-Wen Nienhuys <hanwen@cs.uu.nl',
+            'Jan Nieuwenhuizen <janneke@gnu.org')
+
+option_definitions = [
+       ('', 'h', 'help', _ ("print this help")),
+       ('', 'V', 'verbose', _ ("be verbose")),
+       (_ ('PAPER'), 'P', 'papersize', _ ("use papersize PAPER")),
+       (_ ('RES'), 'R', 'resolution', _ ("set the resolution of the preview to RES")),
+       ]
+
+(sh, long) = ly.getopt_args (option_definitions)
+try:
+       (options, files) = getopt.getopt (sys.argv[1:], sh, long)
+except getopt.error, s:
+       sys.stderr.write ('\n')
+       ly.error (_ ("getopt says: `%s\'" % s))
+       sys.stderr.write ('\n')
+       ly.help ()
+       ly.exit (2)
+       
+for opt in options:
+       o = opt[0]
+       a = opt[1]
+
+       if o == '--help' or o == '-h':
+               ly.identify (sys.stdout)
+               ly.help ()
+               sys.exit (0)
+       elif o == '--papersize' or o == '-P':
+               preview_papersize = a
+       elif o == '--resolution' or o == '-R':
+               preview_resolution = string.atoi (a)
+       elif o == '--verbose' or o == '-V':
+               verbose_p = 1
+
+ly.identify (sys.stderr)
+for f in files:
+       outfiles = ly.make_ps_images (f, resolution = preview_resolution,
+                                     papersize = preview_papersize)
+       sys.stderr.write (_ ("Wrote `%s'" % string.join (outfiles, ', ')))
+       sys.stderr.write ('\n')
diff --git a/scripts/ps2png.py b/scripts/ps2png.py
deleted file mode 100644 (file)
index 194af0b..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#!@PYTHON@
-
-import getopt
-import glob
-import os
-import string
-import sys
-
-datadir = '@local_lilypond_datadir@'
-if not os.path.isdir (datadir):
-       datadir = '@lilypond_datadir@'
-if os.environ.has_key ('LILYPONDPREFIX') :
-       datadir = os.environ['LILYPONDPREFIX']
-       while datadir[-1] == os.sep:
-               datadir= datadir[:-1]
-
-sys.path.insert (0, os.path.join (datadir, 'python'))
-
-# Customize these
-#if __name__ == '__main__':
-
-import lilylib as ly
-global _;_=ly._
-global re;re = ly.re
-
-preview_resolution = 90
-# Use /etc/papersize?
-preview_papersize = "a4"
-
-# lilylib globals
-program_name = os.path.basename (sys.argv[0])
-verbose_p = 0
-program_version = '@TOPLEVEL_VERSION@'
-pseudo_filter_p = 0 # ugr.
-
-help_summary = _ ("Convert PostScript to PNG image.")
-copyright = ('Han-Wen Nienhuys <hanwen@cs.uu.nl',
-            'Jan Nieuwenhuizen <janneke@gnu.org')
-
-option_definitions = [
-       ('', 'h', 'help', _ ("print this help")),
-       ('', 'V', 'verbose', _ ("be verbose")),
-       (_ ('PAPER'), 'P', 'papersize', _ ("use papersize PAPER")),
-       (_ ('RES'), 'R', 'resolution', _ ("set the resolution of the preview to RES")),
-       ]
-
-(sh, long) = ly.getopt_args (option_definitions)
-try:
-       (options, files) = getopt.getopt (sys.argv[1:], sh, long)
-except getopt.error, s:
-       sys.stderr.write ('\n')
-       ly.error (_ ("getopt says: `%s\'" % s))
-       sys.stderr.write ('\n')
-       ly.help ()
-       ly.exit (2)
-       
-for opt in options:
-       o = opt[0]
-       a = opt[1]
-
-       if o == '--help' or o == '-h':
-               ly.identify (sys.stdout)
-               ly.help ()
-               sys.exit (0)
-       elif o == '--papersize' or o == '-P':
-               preview_papersize = a
-       elif o == '--resolution' or o == '-R':
-               preview_resolution = string.atoi (a)
-       elif o == '--verbose' or o == '-V':
-               verbose_p = 1
-
-ly.identify (sys.stderr)
-for f in files:
-       outfiles = ly.make_ps_images (f, resolution = preview_resolution,
-                                     papersize = preview_papersize)
-       sys.stderr.write (_ ("Wrote `%s'" % string.join (outfiles, ', ')))
-       sys.stderr.write ('\n')