1 ;;;; framework-ps.scm --
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 (define-module (scm framework-eps))
9 ;;; this is still too big a mess.
11 (use-modules (ice-9 regex)
21 (define framework-eps-module (current-module))
23 (define (dump-stencils-as-EPSes stencils book basename)
24 (define paper (ly:paper-book-paper book))
25 (define (dump-infinite-stack-EPS stencils)
27 ((dump-me (stack-stencils Y DOWN 2.0 stencils)))
28 (dump-stencil-as-EPS paper dump-me basename #t)
31 (define (dump-stencils-as-separate-EPS stencils count)
34 ((line (car stencils))
35 (rest (cdr stencils)))
38 line (format "~a-~a" basename count)
41 (dump-stencils-as-separate-EPS rest (1+ count))
44 (let* ((tex-system-name (format "~a-systems.tex" basename))
45 (texi-system-name (format "~a-systems.texi" basename))
46 (tex-system-port (open-output-file tex-system-name))
47 (texi-system-port (open-output-file texi-system-name)))
49 (display (format "Writing ~a\n" tex-system-name))
50 (display (format "Writing ~a\n" texi-system-name))
51 (dump-stencils-as-separate-EPS stencils 1)
53 (display (format "\\includegraphics{~a-~a.eps}%\n"
54 basename (1+ c)) tex-system-port)
55 (display (format "@image{~a-~a}%\n"
56 basename (1+ c)) texi-system-port))
57 (iota (length stencils)))
59 (display "@c eof" texi-system-port)
60 (display "% eof" tex-system-port)
62 (dump-infinite-stack-EPS stencils))
63 (postprocess-output book framework-eps-module
64 (format "~a.eps" basename) (ly:output-formats)))
66 (define-public (output-classic-framework
67 basename book scopes fields)
69 (dump-stencils-as-EPSes
70 (map ly:paper-system-stencil (ly:paper-book-systems book))
74 (define-public (output-framework basename book scopes fields)
75 (dump-stencils-as-EPSes (ly:paper-book-pages book)
80 ; redefine to imports from framework-ps
81 (define convert-to-pdf convert-to-pdf)
82 (define convert-to-ps convert-to-ps)
83 (define convert-to-png convert-to-png)
84 (define convert-to-tex convert-to-tex)
85 (define convert-to-dvi convert-to-dvi)