From: Han-Wen Nienhuys Date: Tue, 3 May 2005 11:31:51 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.5.22~9 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=71f73f018876fffc1886e3da59776f3f1c8200f4;p=lilypond.git *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index bd546918a0..621feac57a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,15 @@ 2005-05-03 Han-Wen Nienhuys + * 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. diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index c950349fc1..929cbc385c 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -77,12 +77,6 @@ best_quant_score_idx (Array 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 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 (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 (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); diff --git a/lily/main.cc b/lily/main.cc index cf6f9fd2c0..535014510d 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -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; } diff --git a/lily/stencil.cc b/lily/stencil.cc index 407fcd0ce5..3ebd5b2886 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -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" diff --git a/make/lilypond.fedora.spec.in b/make/lilypond.fedora.spec.in index 069bd1ef0b..2d9294955d 100644 --- a/make/lilypond.fedora.spec.in +++ b/make/lilypond.fedora.spec.in @@ -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@/ diff --git a/mf/GNUmakefile b/mf/GNUmakefile index 46a7dd063d..18825a86e6 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -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 diff --git a/scm/backend-library.scm b/scm/backend-library.scm index 97caa8ef98..d8428c106b 100644 --- a/scm/backend-library.scm +++ b/scm/backend-library.scm @@ -45,10 +45,11 @@ (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) diff --git a/scm/framework-eps.scm b/scm/framework-eps.scm index 976a41d077..b0212a8e69 100644 --- a/scm/framework-eps.scm +++ b/scm/framework-eps.scm @@ -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 diff --git a/scm/lily.scm b/scm/lily.scm index 9a0b1dfb60..79f88d2af6 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -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 "") diff --git a/scm/output-gnome.scm b/scm/output-gnome.scm index 0ea432e4f4..f9d45a4639 100644 --- a/scm/output-gnome.scm +++ b/scm/output-gnome.scm @@ -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)) diff --git a/scm/output-ps.scm b/scm/output-ps.scm index b31ac807a4..8789ab096a 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -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)) diff --git a/scripts/GNUmakefile b/scripts/GNUmakefile index b0d99517a1..90ff74929c 100644 --- a/scripts/GNUmakefile +++ b/scripts/GNUmakefile @@ -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 index 0000000000..194af0b31d --- /dev/null +++ b/scripts/lilypond-ps2png.py @@ -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