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.
}
}
- if (best_idx < 0)
- {
- programming_error ("no best beam quant score");
- best_idx = 0;
- }
-
return best_idx;
}
}
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);
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);
scm_boot_guile (argc, argv, main_with_guile, 0);
- /* Unreachable */
- return 0;
+ /*
+ If we get here, GUILE exited. This is an error.
+ */
+ return 1;
}
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"
%{_bindir}/midi2ly
%{_bindir}/lilypond-book
%{_bindir}/mup2ly
-%{_bindir}/ps2png
+%{_bindir}/lilypond-ps2png
%{_bindir}/lilypond-pdfpc-helper
%doc THANKS
%{_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@/
# 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
(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)
(if (pair? stencils)
(let* ((line (car stencils))
(rest (cdr stencils)))
+
(dump-stencil-as-EPS
paper
line (format "~a-~a" basename count)
(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
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 "")
;;; 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))
;;(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))
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
--- /dev/null
+#!@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')
+++ /dev/null
-#!@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')