+2005-01-30 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * scm/output-ps.scm (utf8-string): add utf8-string for completeness.
+
+ * scm/framework-ps.scm (dump-stencil-as-EPS): new function
+
+ * Documentation/user/invoking.itely (Invoking lilypond): add note
+ about EPS backend.
+
+ * scm/framework-eps.scm: new file: create per-system/per-page EPS
+ files for inclusion in lilypond-book document.
+
+ * input/tutorial/lbook-latex-test.tex: rename from lilbook.tex
+
+ * input/tutorial/lbook-texi-test.texi: new file.
+
+ * scm/safe-lily.scm (safe-objects): add
+ {begin,end}-of-line-(in)?visible as safe.
+
2005-01-30 Graham Percival <gperlist@shaw.ca>
* Documentation/user/changing-defaults.itely: fixed example
2005-01-29 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/stencil.cc (moved_to_edge): don't halt on adding empty
+ stencils.
+
* ps/lilyponddefs.ps: add start-page, start-system doesn't
translate to top of page. Fixes alignment problems of
lilypond-generated EPS files.
@item texstr
dump text strings to @file{.texstr} file, which can be run through
(La)@TeX{}, resulting in a @code{.textmetrics} file, which contains the
-extents of strings of text.
+extents of strings of text.
@item ps
for PostScript
@cindex PostScript output
+@item eps
+ for encapsulated PostScript. This dumps every page (system) as a separate
+@file{EPS} file, without fonts, and as one collated @file{EPS} file with
+all pages (systems) including fonts.
+
+This mode is used by default by lilypond-book.
+
@item svg
for SVG (Scalable Vector Graphics)
@cindex SVG (Scalable Vector Graphics)
LOCALSTEPMAKE_TEMPLATES=ly mutopia
-EXTRA_DIST_FILES=lilbook.tex
+EXTRA_DIST_FILES=lilbook.tex lbook-texi-test.texi
include $(depth)/make/stepmake.make
--- /dev/null
+\documentclass[a4paper]{article}
+\usepackage{graphics}
+\begin{document}
+
+Documents for lilypond-book may freely mix music and text. For
+example,
+
+\begin{lilypond}
+\relative {
+ c2^"test" g'2 \times 2/3 { f8 e d } c'2 g4
+}
+\end{lilypond}
+
+Options are put in brackets.
+
+\begin[fragment,quote,staffsize=26,verbatim]{lilypond}
+ c'4 f16
+\end{lilypond}
+
+Larger examples can be put in a separate file, and introduced with
+\verb+\lilypondfile+.
+
+%\lilypondfile[quote,noindent]{screech-boink.ly}
+
+\end{document}
--- /dev/null
+\input texinfo @c -*-texinfo-*-
+@setfilename lilbook.info
+@settitle lilypond-book test
+@node Top, , ,
+@top
+
+@chapter lilypond-book test
+
+@section Introduction
+
+Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah
+blah
+
+Fragment:
+
+
+@lilypond
+\relative {
+ c2 g'2^"test" \times 2/3 { f8 e d } c'2 g4
+}
+@end lilypond
+
+
+Bla bla blah
+
+This is a multipage / multipicture fragment:
+
+@lilypond
+\book {
+ \score { { c1 \break \pageBreak c1 } }
+}
+@end lilypond
+
+@bye
+++ /dev/null
-\documentclass[a4paper]{article}
-\usepackage{graphics}
-\begin{document}
-
-Documents for lilypond-book may freely mix music and text. For
-example,
-
-\begin{lilypond}
-\relative {
- c2^"test" g'2 \times 2/3 { f8 e d } c'2 g4
-}
-\end{lilypond}
-
-Options are put in brackets.
-
-\begin[fragment,quote,staffsize=26,verbatim]{lilypond}
- c'4 f16
-\end{lilypond}
-
-Larger examples can be put in a separate file, and introduced with
-\verb+\lilypondfile+.
-
-%\lilypondfile[quote,noindent]{screech-boink.ly}
-
-\end{document}
ptr = ptr->next;
}
- if (output_backend_global != "ps")
+ /*
+ UGH. Should have flags per output format signifying supported
+ options.
+ */
+ if (output_backend_global != "ps"
+ && output_backend_global != "eps")
{
/*
For Pango based backends, we take a shortcut.
scm_puts ("#<", port);
scm_puts (classname (b), port);
scm_puts (" ", port);
- //scm_puts (b->, port);
scm_puts (">", port);
return 1;
}
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);
-
scm_apply_0 (func, scm_list_n (scm_makfrom0str (outname.to_str0 ()),
self_scm (),
scopes,
{
programming_error ("Stencil::moved_to_edge: adding empty stencil.");
his_extent = 0.0;
- SCM_ASSERT_TYPE (0, SCM_EOL, SCM_ARG1, __FUNCTION__, "");
+ // SCM_ASSERT_TYPE (0, s.expr (), SCM_ARG1, __FUNCTION__, "non-empty stencil");
}
else
his_extent = i[-d];
LILYPOND = $(builddir)/lily/$(outconfbase)/lilypond
LILYPOND_BOOK = $(script-dir)/lilypond-book.py
LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(builddir)/mf/$(outconfbase)/ -I $(builddir)/mf/out/
-LILYPOND_BOOK_FLAGS = --process="lilypond --backend ps --formats=ps,png --header=texidoc -I $(srcdir)/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'"
+LILYPOND_BOOK_FLAGS = --process="lilypond --backend eps --formats=ps,png --header=texidoc -I $(srcdir)/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'"
#texi-html for www only:
LILYPOND_BOOK_FORMAT=$(if $(subst out-www,,$(notdir $(outdir))),texi,texi-html)
--- /dev/null
+;;;; backend-library.scm -- helpers for the backends.
+;;;;
+;;;; source file of the GNU LilyPond music typesetter
+;;;;
+;;;; (c) 2005 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; backend helpers.
+
+(define-public (ly:system command)
+ (let* ((status 0)
+
+ (silenced
+ (string-append command (if (ly:get-option 'verbose)
+ ""
+ " > /dev/null 2>&1 "))))
+
+ (if (ly:get-option 'verbose)
+ (format (current-error-port) (_ "Invoking `~a'...\n") command))
+
+ (set! status (system silenced))
+ (if (> status 0)
+ (begin
+ (format (current-error-port)
+ (_ "Error invoking `~a'. Return value ~a") silenced status)
+ (newline (current-error-port))))))
+
+(define-public (sanitize-command-option str)
+ (string-append
+ "\""
+ (regexp-substitute/global #f "[^- 0-9,.a-zA-Z'\"\\]" str 'pre 'post)
+ "\""))
+
+(define-public (postscript->pdf papersizename name)
+ (let* ((cmd (string-append "ps2pdf "
+ (string-append
+ " -sPAPERSIZE="
+ (sanitize-command-option papersizename)
+ " "
+ name)))
+ (pdf-name (string-append (basename name ".ps") ".pdf" )))
+
+ (if (access? pdf-name W_OK)
+ (delete-file pdf-name))
+
+ (format (current-error-port) (_ "Converting to `~a'...") pdf-name)
+ (ly:system cmd)))
+
+(define-public (postscript->png resolution name)
+ (let ((cmd (string-append
+ "ps2png --resolution="
+ (if (number? resolution)
+ (number->string resolution)
+ "90 ")
+ (if (ly:get-option 'verbose)
+ "--verbose "
+ " ")
+ name)))
+
+ (ly:system cmd)))
+
+(define-public (postprocess-output paper-book module filename formats)
+ (for-each
+ (lambda (f)
+ ((eval (string->symbol (string-append "convert-to-" f))
+ module)
+ paper-book filename))
+
+ formats))
+
+(define-public (completize-formats formats)
+ (define new-fmts '())
+
+ (if (member "png" formats)
+ (set! formats (cons "ps" formats)))
+ (if (member "pdf" formats)
+ (set! formats (cons "ps" formats)))
+
+ (for-each
+ (lambda (x)
+ (if (member x formats) (set! new-fmts (cons x new-fmts))))
+ '("tex" "dvi" "ps" "pdf" "png"))
+
+ new-fmts)
+
(define (stack-stencils stencils bskip last-stencil)
(cond
((null? stencils) '())
- ((not last-stencil)
+ ((not (ly:stencil? last-stencil))
(cons (car stencils)
(stack-stencils (cdr stencils) bskip (car stencils))))
(else
x)) args))
(leading
(chain-assoc-get 'baseline-skip props))
- (stacked (stack-stencils stencils 1.25 #f))
+ (stacked (stack-stencils
+ (remove ly:stencil-empty? stencils) 1.25 #f))
(brackets (make-brackets stacked indices '())))
(apply ly:stencil-add
--- /dev/null
+;;;; framework-ps.scm --
+;;;;
+;;;; source file of the GNU LilyPond music typesetter
+;;;;
+;;;; (c) 2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+(define-module (scm framework-eps))
+
+;;; this is still too big a mess.
+
+(use-modules (ice-9 regex)
+ (ice-9 string-fun)
+ (ice-9 format)
+ (guile)
+ (scm framework-ps)
+ (scm output-ps)
+ (srfi srfi-1)
+ (srfi srfi-13)
+ (lily))
+
+(define framework-eps-module (current-module))
+
+(define (dump-stencils-as-EPSes stencils book basename)
+ (define paper (ly:paper-book-paper book))
+ (define (dump-infinite-stack-EPS stencils)
+ (let*
+ ((dump-me (stack-stencils Y DOWN 2.0 stencils)))
+ (dump-stencil-as-EPS paper dump-me basename #t)
+ ))
+
+ (define (dump-stencils-as-separate-EPS stencils count)
+ (if (pair? stencils)
+ (let*
+ ((line (car stencils))
+ (rest (cdr stencils)))
+ (dump-stencil-as-EPS
+ paper
+ line (format "~a-~a" basename count)
+ #f)
+
+ (dump-stencils-as-separate-EPS rest (1+ count))
+ )))
+
+ (let* ((tex-system-name (format "~a-systems.tex" basename))
+ (texi-system-name (format "~a-systems.texi" basename))
+ (tex-system-port (open-output-file tex-system-name))
+ (texi-system-port (open-output-file texi-system-name)))
+
+ (display (format "Writing ~a\n" tex-system-name))
+ (display (format "Writing ~a\n" texi-system-name))
+ (dump-stencils-as-separate-EPS stencils 1)
+ (for-each (lambda (c)
+ (display (format "\\includegraphics{~a-~a.eps}%\n"
+ basename (1+ c)) tex-system-port)
+ (display (format "@image{~a-~a}%\n"
+ basename (1+ c)) texi-system-port))
+ (iota (length stencils)))
+
+ (display "@c eof" texi-system-port)
+ (display "% eof" tex-system-port)
+
+ (dump-infinite-stack-EPS stencils))
+ (postprocess-output book framework-eps-module
+ (format "~a.eps" basename) (ly:output-formats)))
+
+(define-public (output-classic-framework
+ basename book scopes fields)
+
+ (dump-stencils-as-EPSes
+ (map ly:paper-system-stencil (ly:paper-book-systems book))
+ book
+ basename))
+
+(define-public (output-framework basename book scopes fields)
+ (dump-stencils-as-EPSes (ly:paper-book-pages book)
+ book
+ basename))
+
+
+; redefine to imports from framework-ps
+(define convert-to-pdf convert-to-pdf)
+(define convert-to-ps convert-to-ps)
+(define convert-to-png convert-to-png)
+(define convert-to-tex convert-to-tex)
+(define convert-to-dvi convert-to-dvi)
+
(define-public (output-framework basename book scopes fields)
(let* ((filename (format "~a.ps" basename))
- (outputter (ly:make-paper-outputter filename
- (ly:output-backend)))
+ (outputter (ly:make-paper-outputter filename "ps"))
(paper (ly:paper-book-paper book))
(pages (ly:paper-book-pages book))
(landscape? (eq? (ly:output-def-lookup paper 'landscape) #t))
(if (not (defined? 'inf?))
(define (inf? x) #f))
+
+(define-public (dump-stencil-as-EPS paper dump-me filename load-fonts?)
+ (let*
+ ((outputter (ly:make-paper-outputter (format "~a.eps" filename)
+ "ps"))
+
+ (port (ly:outputter-port outputter))
+ (xext (ly:stencil-extent dump-me X))
+ (yext (ly:stencil-extent dump-me Y))
+ (scale (ly:output-def-lookup paper 'outputscale))
+ (bbox
+ (map
+ (lambda (x)
+ (if (or (nan? x) (inf? x))
+ 0.0 x))
+ (list (car xext) (car yext)
+ (cdr xext) (cdr yext))))
+ (rounded-bbox
+ (map
+ (lambda (x)
+ (inexact->exact
+ (round (* x scale mm-to-bigpoint)))) bbox))
+ (port (ly:outputter-port outputter))
+ (header (eps-header paper rounded-bbox load-fonts?)))
+
+ (display header port)
+ (write-preamble paper load-fonts? port)
+ (display "start-system { set-ps-scale-to-lily-scale \n" port)
+ (ly:outputter-dump-stencil outputter dump-me)
+ (display "} stop-system\n%%Trailer\n%%EOF\n" port)
+ (ly:outputter-close outputter)
+ ))
+
+
(define-public (output-preview-framework basename book scopes fields )
- (let* ((filename (format "~a.ps" basename))
- (outputter (ly:make-paper-outputter filename
- (ly:output-backend)))
+ (let* ((outputter (ly:make-paper-outputter filename
+ "ps"))
(paper (ly:paper-book-paper book))
(systems (ly:paper-book-systems book))
(scale (ly:output-def-lookup paper 'outputscale ))
(dump-me
(stack-stencils Y DOWN 0.0
(map ly:paper-system-stencil
- (append titles (list non-title)))))
- (xext (ly:stencil-extent dump-me X))
- (yext (ly:stencil-extent dump-me Y))
- (bbox
- (map
- (lambda (x)
- (if (or (nan? x) (inf? x))
- 0.0 x))
- (list (car xext) (car yext)
- (cdr xext) (cdr yext))))
- (rounded-bbox
- (map
- (lambda (x)
- (inexact->exact
- (round (* x scale mm-to-bigpoint))))))
- (port (ly:outputter-port outputter))
- )
-
-
- (display (eps-header paper rounded-bbox #t) port)
- (write-preamble paper #t port)
- (display "start-system { set-ps-scale-to-lily-scale \n" port)
- (ly:outputter-dump-stencil outputter dump-me)
- (display outputter "} stop-system\n%%Trailer\n%%EOF\n" port)
- (ly:outputter-close outputter)
- (postprocess-output book framework-ps-module filename
- (ly:output-formats))
-))
-
+ (append titles (list non-title))))))
+ (dump-stencil-as-EPS paper dump-me basename #t)))
-(define-public (output-classic-framework
- basename book scopes fields)
- (define paper (ly:paper-book-paper book))
- (define (dump-line outputter line)
- (let*
- ((dump-me (ly:paper-system-stencil line))
- (xext (ly:stencil-extent dump-me X))
- (yext (ly:stencil-extent dump-me Y))
- (scale (ly:output-def-lookup paper 'outputscale))
- (bbox
- (map
- (lambda (x)
- (if (or (nan? x) (inf? x))
- 0.0 x))
- (list (car xext) (car yext)
- (cdr xext) (cdr yext))))
- (rounded-bbox
- (map
- (lambda (x)
- (inexact->exact
- (round (* x scale mm-to-bigpoint)))) bbox))
- (port (ly:outputter-port outputter))
- (header (eps-header paper rounded-bbox #f)))
- (display header port)
- (write-preamble paper #f port)
- (display "start-system { set-ps-scale-to-lily-scale \n" port)
- (ly:outputter-dump-stencil outputter dump-me)
- (display "} stop-system\n%%Trailer\n%%EOF\n" port)
- (ly:outputter-close outputter)))
-
-
- (define (dump-infinite-page lines)
- (let*
- ((outputter (ly:make-paper-outputter (format "~a.eps" basename)
- (ly:output-backend)))
- (stencils (map ly:paper-system-stencil lines))
- (dump-me (stack-stencils Y DOWN 2.0 stencils))
- (xext (ly:stencil-extent dump-me X))
- (yext (ly:stencil-extent dump-me Y))
- (scale (ly:output-def-lookup paper 'outputscale))
- (bbox
- (map
- (lambda (x)
- (if (or (nan? x) (inf? x))
- 0.0 x))
- (list (car xext) (car yext)
- (cdr xext) (cdr yext))))
- (ps-bbox (map (lambda (x)
- (inexact->exact
- (round (* x scale mm-to-bigpoint))))
- bbox))
-
- (port (ly:outputter-port outputter))
- (header (eps-header paper ps-bbox #t)))
-
- (display header port)
- (write-preamble paper #t port)
- (display "start-system { set-ps-scale-to-lily-scale \n" port)
- (ly:outputter-dump-stencil outputter dump-me)
- (display "} stop-system\n%%Trailer\n%%EOF\n" port)
- (ly:outputter-close outputter)))
-
- (define (dump-lines lines count)
- (if (pair? lines)
- (let*
- ((outputter (ly:make-paper-outputter (format "~a-~a.eps" basename count)
- (ly:output-backend)))
- (line (car lines))
- (rest (cdr lines)))
- (dump-line outputter line)
- (dump-lines rest (1+ count))
- )))
-
- (let* ((lines (ly:paper-book-systems book))
- (tex-system-name (format "~a-systems.tex" basename))
- (texi-system-name (format "~a-systems.texi" basename))
- (tex-system-port (open-output-file tex-system-name))
- (texi-system-port (open-output-file texi-system-name))
- (last-line (car (last-pair lines)))
- (pages (ly:paper-book-pages book))
- )
-
- (display (format "Writing ~a\n" tex-system-name))
- (display (format "Writing ~a\n" texi-system-name))
- (dump-lines lines 1)
- (for-each (lambda (c)
- (display (format "\\includegraphics{~a-~a.eps}%\n"
- basename (1+ c)) tex-system-port)
- (display (format "@image{~a-~a}%\n"
- basename (1+ c)) texi-system-port))
- (iota (length lines)))
-
- (display "@c eof" texi-system-port)
- (display "% eof" tex-system-port)
- (dump-infinite-page lines))
- (postprocess-output book framework-ps-module (format "~a.eps" basename) (ly:output-formats)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
"titling.scm"
"paper.scm"
-
+ "backend-library.scm"
; last:
"safe-lily.scm"))
outfile)))
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; backend helpers.
-
-(define-public (ly:system command)
- (let* ((status 0)
-
- (silenced
- (string-append command (if (ly:get-option 'verbose)
- ""
- " > /dev/null 2>&1 "))))
-
- (if (ly:get-option 'verbose)
- (format (current-error-port) (_ "Invoking `~a'...\n") command))
-
- (set! status (system silenced))
- (if (> status 0)
- (begin
- (format (current-error-port)
- (_ "Error invoking `~a'. Return value ~a") silenced status)
- (newline (current-error-port))))))
-
-(define-public (sanitize-command-option str)
- (string-append
- "\""
- (regexp-substitute/global #f "[^- 0-9,.a-zA-Z'\"\\]" str 'pre 'post)
- "\""))
-
-(define-public (postscript->pdf papersizename name)
- (let* ((cmd (string-append "ps2pdf "
- (string-append
- " -sPAPERSIZE="
- (sanitize-command-option papersizename)
- " "
- name)))
- (pdf-name (string-append (basename name ".ps") ".pdf" )))
-
- (if (access? pdf-name W_OK)
- (delete-file pdf-name))
-
- (format (current-error-port) (_ "Converting to `~a'...") pdf-name)
- (ly:system cmd)))
-
-(define-public (postscript->png resolution name)
- (let ((cmd (string-append
- "ps2png --resolution="
- (if (number? resolution)
- (number->string resolution)
- "90 ")
- (if (ly:get-option 'verbose)
- "--verbose "
- " ")
- name)))
-
- (ly:system cmd)))
-
-(define-public (postprocess-output paper-book module filename formats)
- (for-each
- (lambda (f)
- ((eval (string->symbol (string-append "convert-to-" f))
- module)
- paper-book filename))
-
- formats))
-
-(define-public (completize-formats formats)
- (define new-fmts '())
-
- (if (member "png" formats)
- (set! formats (cons "ps" formats)))
- (if (member "pdf" formats)
- (set! formats (cons "ps" formats)))
-
- (for-each
- (lambda (x)
- (if (member x formats) (set! new-fmts (cons x new-fmts))))
- '("tex" "dvi" "ps" "pdf" "png"))
-
- new-fmts)
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-public (lilypond-main files)
" draw_box"))
+(define (utf8-string pango-font-description string)
+ (ly:warn "utf8-string encountered in PS backend"))
+
(define (glyph-string
postscript-font-name
size
Vaticana_ligature::brew_ligature_primitive
Vaticana_ligature::print
Volta_bracket_interface::print
+
+ begin-of-line-invisible
+ begin-of-line-visible
+
+ end-of-line-invisible
+ end-of-line-visible
+
)))
(define-public (make-safe-lilypond-module)
NOTES = 'body'
NOTIME = 'notime'
OUTPUT = 'output'
+OUTPUTIMAGE = 'outputimage'
PAPER = 'paper'
PREAMBLE = 'preamble'
PRINTFILENAME = 'printfilename'
%(code)s
@lilypond''',
- OUTPUT: r'''@noindent
+ OUTPUT: r'''
@iftex
@include %(base)s-systems.texi
-@end iftex
+@end iftex''',
+ OUTPUTIMAGE: r'''@noindent
@ifnottex
@image{%(base)s,,,[image of music],%(ext)s}
@end ifnottex
# URG, makeinfo implicitly prepends dot to extension.
# Specifying no extension is most robust.
ext = ''
- str += output[TEXINFO][OUTPUT] % vars ()
+ str += output[TEXINFO][OUTPUTIMAGE] % vars ()
+
+ base = self.basename()
+ str += output[format][OUTPUT] % vars()
return str
def output_latex (self):
base = self.basename ()
filename = self.substring ('filename')
str = output[format][PRINTFILENAME] % vars ()
+
return str
def output_texinfo (self):
str = output[TEXINFO][NOQUOTE] % vars()
str += self.output_info ()
+
# str += ('@ifinfo\n' + self.output_info () + '\n@end ifinfo\n')
# str += ('@tex\n' + self.output_latex () + '\n@end tex\n')
# str += ('@html\n' + self.output_html () + '\n@end html\n')
ly.progress (_ ("All snippets are up to date..."))
ly.progress ('\n')
+def guess_format (input_filename):
+ format = None
+ e = os.path.splitext (input_filename)[1]
+ if e in ext2format.keys ():
+ # FIXME
+ format = ext2format[e]
+ else:
+ ly.error (_ ("cannot determine format for: %s" \
+ % input_filename))
+ ly.exit (1)
+ return format
+
def do_file (input_filename):
# Ugh.
- global format
- if not format:
- e = os.path.splitext (input_filename)[1]
- if e in ext2format.keys ():
- # FIXME
- format = ext2format[e]
- else:
- ly.error (_ ("cannot determine format for: %s" \
- % input_filename))
- ly.exit (1)
-
if not input_filename or input_filename == '-':
in_handle = sys.stdin
input_fullname = '<stdin>'
def main ():
files = do_options ()
- global process_cmd
+ if not files:
+ ly.warning ("Need to have command line option")
+ ly.exit (2)
+
+ file = files[0]
+ global process_cmd, format
+ format = guess_format (files[0])
formats = "ps"
if format == TEXINFO:
- formats += ",png"
+ formats += ',png'
if process_cmd == '':
- process_cmd = lilypond_binary + ' --formats=%s --backend ps ' % formats
+ process_cmd = lilypond_binary + ' --formats=%s --backend eps ' % formats
if process_cmd:
process_cmd += string.join ([(' -I %s' % p)
ly.identify (sys.stderr)
ly.setup_environment ()
- if files:
- try:
- do_file (files[0])
- except Compile_error:
- ly.exit (1)
+
+ try:
+ do_file (file)
+ except Compile_error:
+ ly.exit (1)
+
if __name__ == '__main__':
main ()