]> git.donarmstrong.com Git - lilypond.git/commitdiff
* stepmake/stepmake/texinfo-rules.make: strip DVI support.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 17 Jul 2006 09:40:36 +0000 (09:40 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 17 Jul 2006 09:40:36 +0000 (09:40 +0000)
* scm/framework-eps.scm (dump-stencils-as-EPSes): generate
systems.pdftex too.o

* scm/backend-library.scm (postscript->pdf): use -dEPSCrop for PDF.

* make/lilypond-vars.make (TEXINPUTS): add pdf output format.

* Documentation/topdocs/NEWS.tely (Top): add pdftex note.

* scm/output-ps.scm (resetrotation): use gsave/grestore for rotation.

* lily/main.cc (parse_argv): don't overwrite previous --formats string.

* scm/backend-library.scm (postscript->pdf): strip .eps too.

ChangeLog
Documentation/topdocs/NEWS.tely
lily/main.cc
make/lilypond-vars.make
make/ly-rules.make
scm/backend-library.scm
scm/framework-eps.scm
scm/output-ps.scm
scm/stencil.scm
scripts/lilypond-book.py
stepmake/stepmake/texinfo-rules.make

index 6298d7232298e8428856fb8619b1f2bf5c9c2c0c..56e88a65f41dd0e6772cbfe482dcbbe245a41875 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2006-07-17  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * stepmake/stepmake/texinfo-rules.make: strip DVI support.
+
+       * scm/framework-eps.scm (dump-stencils-as-EPSes): generate
+       systems.pdftex too.o 
+
+       * scm/backend-library.scm (postscript->pdf): use -dEPSCrop for PDF.
+
+       * make/lilypond-vars.make (TEXINPUTS): add pdf output format.
+
+       * Documentation/topdocs/NEWS.tely (Top): add pdftex note.
+
+       * scm/output-ps.scm (resetrotation): use gsave/grestore for rotation.
+
+       * lily/main.cc (parse_argv): don't overwrite previous --formats string.
+
+       * scm/backend-library.scm (postscript->pdf): strip .eps too. 
+
 2006-07-14  Nicolas Sceaux  <nicolas.sceaux@free.fr>
 
        * scm/layout-page-layout.scm: Define module, tidy code, use more
index 47e3c70838a2d44a284eb03d324ad74962ae65b2..45d3c18e35b1353ae42c145bb4d7f2b4d8195db7 100644 (file)
@@ -65,6 +65,11 @@ which scares away people.
 * only show user-visible changes. 
 
 @end ignore
+@item
+@code{lilypond-book} now includes support for PDF@TeX{}.
+
+This feature was sponsored by David Roundy. 
+
 @item
 Nested tuplets can have different formatting for each nesting level,
 
@@ -73,7 +78,7 @@ Nested tuplets can have different formatting for each nesting level,
   \time 5/4
   \tweak #'text #tuplet-number::calc-fraction-text
   \times 5/3 {
-     \tweak #'tupletNumberFormatFunction #tuplet-number::calc-denominator-text
+     \tweak #'text  #tuplet-number::calc-denominator-text
      \times 2/3 {
         c'8[ c'8 c'8]
      }
index 5f9b2a77f657f3e4c02dd68518e8a7d39cf66c31..bfdf01566f0d5ebf239cdb5e2ce244bd7a453e32 100644 (file)
@@ -540,7 +540,12 @@ parse_argv (int argc, char **argv)
          break;
 
        case 'f':
-         output_format_global = option_parser->optional_argument_str0_;
+         {
+           vector<string> components
+             = string_split (option_parser->optional_argument_str0_, ',');
+           for (vsize i = 0; i < components.size (); i++)
+             add_output_format (components[i]);
+         }
          break;
 
        case 'H':
index 67ff5fca9aa120445fb60530236b3c81edf3d0a2..107dd0a5067b12a5cc17b03e24e6a9177f0fd910 100644 (file)
@@ -25,7 +25,7 @@ CONVERT_LY = $(script-dir)/convert-ly.py
 LILYPOND_BOOK = $(script-dir)/lilypond-book.py
 LILYPOND_BOOK_INCLUDES = -I $(src-dir)/ -I $(outdir) -I $(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/manual/ -I $(input-dir)/tutorial/ -I $(top-build-dir)/mf/$(outconfbase)/  -I $(top-build-dir)/mf/out/
 LILYPOND_BOOK_LILYPOND_FLAGS=-dgs-font-load
-LILYPOND_BOOK_FLAGS = --process="$(LILYPOND_BINARY) --backend=eps --formats=ps,png --header=texidoc -I $(top-src-dir)/input/manual -dinternal-type-checking -ddump-signatures -danti-alias-factor=2 $(LILYPOND_BOOK_LILYPOND_FLAGS)"
+LILYPOND_BOOK_FLAGS = --process="$(LILYPOND_BINARY) --backend=eps --formats=ps,png,pdf -deps-font-include -dgs-font-load --header=texidoc -I $(top-src-dir)/input/manual -dinternal-type-checking -ddump-signatures -danti-alias-factor=2 $(LILYPOND_BOOK_LILYPOND_FLAGS)"
 TEXINPUTS=$(top-src-dir)/tex/::
 export TEXINPUTS
 
index b3c4f4108c1fad05886c37b258db026866dfd0f0..e7dbb42719f60faf7fbfc3100170c19241599ed7 100644 (file)
@@ -1,19 +1,19 @@
-.SUFFIXES: .doc .dvi .tely .texi .ly
+.SUFFIXES: .doc .tely .texi .ly
 
 
-$(outdir)/%.latex $(outdir)/%.psfonts:  %.doc
+$(outdir)/%.latex:  %.doc
        $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --verbose $(LILYPOND_BOOK_FLAGS) $<
 
 # don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir.
 # it is not, for --srcdir builds
 $(outdir)/%.texi: %.tely
-       rm -f $$(grep -LF '% eof' $(outdir)/lily-*systems.tex 2>/dev/null)
-       $(PYTHON) $(LILYPOND_BOOK) --psfonts $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) $<
+       rm -f $$(grep -LF '% eof' $(outdir)/lily-*systems.*tex 2>/dev/null)
+       $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) $<
 
 
 $(outdir)/%.texi: $(outdir)/%.tely
-       rm -f $$(grep -LF '% eof' $(outdir)/lily-*systems.tex 2>/dev/null)
-       $(PYTHON) $(LILYPOND_BOOK) --psfonts $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) $<
+       rm -f $$(grep -LF '% eof' $(outdir)/lily-*systems.*tex 2>/dev/null)
+       $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BINARY) $(LILYPOND_BOOK_INCLUDES)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) $<
 #
 # DON'T REMOVE SOURCE FILES, otherwise the .TEXI ALWAYS OUT OF DATE.
 #      rm -f $<
index 689478f291c4c8c401be20108294e861f8f337ca..42cc2688da6b3a558f6e59e655cb9cc690be9937 100644 (file)
   
   ;; must be sure that we don't catch stuff from old GUBs.
   (search-executable '("gs")))
-
+  
 (define-public (postscript->pdf paper-width paper-height name)
-  (let* ((pdf-name (string-append (basename name ".ps") ".pdf"))
+  (let* ((pdf-name (string-append
+                   (basename (basename name ".ps") ".eps")
+                   ".pdf"))
+        (is-eps (string-match "\\.eps$" name))
+        (paper-size-string (if is-eps
+                               " -dEPSCrop "
+                               (format "-dDEVICEWIDTHPOINTS=~,2f \
+-dDEVICEHEIGHTPOINTS=~,2f "
+                                       paper-width
+                                       paper-height)))
+
         (cmd (format #f
                      "~a\
  ~a\
  ~a\
+ ~a\
  -dCompatibilityLevel=1.4 \
- -dDEVICEWIDTHPOINTS=~,2f -dDEVICEHEIGHTPOINTS=~,2f\
  -dNOPAUSE\
  -dBATCH\
  -r1200 \
@@ -70,8 +80,7 @@
                      (if (ly:get-option 'gs-font-load)
                          " -dNOSAFER "
                          " -dSAFER ")
-                     paper-width
-                     paper-height
+                     paper-size-string
                      pdf-name
                      name)))
     ;; The wrapper on windows cannot handle `=' signs,
                      (lambda (x)
                        (member x formats)) 
                      completed)))
+
     (for-each
      (lambda (f)
-       ((eval (string->symbol (string-append "convert-to-" f)) module)
+       ((eval (string->symbol (format "convert-to-~a" f)) module)
        paper-book filename))
      completed)
 
index 2260c00c2eb84df7d30726e5b703abb894fc732b..23f5779f869981fb85b49fadb3e3ede7a6ca2391 100644 (file)
@@ -44,32 +44,41 @@ stencil, so LaTeX includegraphics doesn't fuck up the alignment."
          ))
        stencils))
 
+  
 (define (dump-stencils-as-EPSes stencils book basename)
+  (define do-pdf (member  "pdf" (ly:output-formats)))
   (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)
+  (define (dump-stencils-as-separate-EPS stencils count )
     (if (pair? stencils)
        (let* ((line (car stencils))
-              (rest (cdr stencils)))
+              (rest (cdr stencils))
+              (system-base-name (format "~a-~a" basename count))
+              )
 
          (dump-stencil-as-EPS
-          paper line (format "~a-~a" basename count)
+          paper line system-base-name
           (ly:get-option 'eps-font-include))
-         
+
+         (if do-pdf
+             (postscript->pdf  0 0  (string-append system-base-name ".eps")))
          (dump-stencils-as-separate-EPS rest (1+ count)))))
 
 
   ;; main body 
   (let* ((tex-system-name (format "~a-systems.tex" basename))
+        (pdftex-system-name (format "~a-systems.pdftex" 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)))
+        (texi-system-port (open-output-file texi-system-name))
+        (pdftex-system-port (open-output-file pdftex-system-name)))
     
     (ly:message (_ "Writing ~a...") tex-system-name)
     (ly:message (_ "Writing ~a...") texi-system-name)
+    (ly:message (_ "Writing ~a...") pdftex-system-name)
 
     (set! stencils (widen-left-stencil-edges stencils))
     
@@ -84,6 +93,8 @@ stencil, so LaTeX includegraphics doesn't fuck up the alignment."
 " c) tex-system-port))
                (display (format "\\includegraphics{~a-~a.eps}\n"
                                 basename (1+ c)) tex-system-port)
+               (display (format "\\includegraphics{~a-~a.pdf}\n"
+                                basename (1+ c)) pdftex-system-port)
                (display (format "@image{~a-~a}\n"
                                 basename (1+ c)) texi-system-port))
              (iota (length stencils)))
@@ -91,9 +102,9 @@ stencil, so LaTeX includegraphics doesn't fuck up the alignment."
     (display "@c eof - 'eof' is a Makefile marker; do not remove. " texi-system-port)
     (display "% eof - 'eof' is Makefile marker; do not remove. " tex-system-port)
     
-    (dump-infinite-stack-EPS stencils))
+    (dump-infinite-stack-EPS stencils)
     (postprocess-output book framework-eps-module
-                       (format "~a.eps" basename) (ly:output-formats)))
+                       (format "~a.eps" basename) (ly:output-formats))))
 
 
 
@@ -121,3 +132,4 @@ stencil, so LaTeX includegraphics doesn't fuck up the alignment."
 (define convert-to-tex convert-to-tex)
 (define convert-to-dvi convert-to-dvi)
 
+
index 2e8c78e2d5f9ba4b161c040c8de8085ed31d7cf5..1beaef6361563410a48cb270c29bbbc1df815703 100644 (file)
 ;; restore color from stack
 (define (resetcolor) "setrgbcolor\n")
 
-;; reset rotation
-(define (resetrotation ang x y)
-  (format "~a translate ~a rotate ~a translate\n"
-    (numbers->string4 (list x y))
-    (number->string (* -1 ang))
-    (numbers->string4 (list (* -1 x) (* -1 y)))))
 
 (define (round-filled-box left right bottom top blotdiam)
   (let* ((halfblot (/ blotdiam 2))
 
 ;; rotation around given point
 (define (setrotation ang x y)
-  (format "~a translate ~a rotate ~a translate\n"
+  (format "gsave ~a translate ~a rotate ~a translate\n"
     (numbers->string4 (list x y))
     (number->string ang)
     (numbers->string4 (list (* -1 x) (* -1 y)))))
 
+(define (resetrotation ang x y)
+  "grestore  ")
+
+
 (define (text font s)
   ;; (ly:warning (_ "TEXT backend-command encountered in Pango backend"))
   ;; (ly:warning (_ "Arguments: ~a ~a"" font str))
index 0c4bf830cf6765432561360913a2c3130185b864..e4befe50d3de28076c0f9333d381a0a29051da92 100644 (file)
@@ -279,6 +279,7 @@ grestore
          (write-system-signatures basename (cdr paper-systems) (1+ count))))))
 
 
+(use-modules (scm paper-system))
 (define-public (write-system-signature filename paper-system)
   (define (float? x)
     (and (number? x) (inexact? x)))
index 29e112e4987c8e8363b06d90e1e4a71283de4454..3fe9421fa2af635fe3497fb656cf96d69744c724 100644 (file)
@@ -1743,18 +1743,18 @@ def main ():
         exit (1)
 
     if global_options.format in (TEXINFO, LATEX):
-        if not global_options.psfonts:
-            warning (_ ("option --psfonts not used"))
-            warning (_ ("processing with dvips will have no fonts"))
-
         psfonts_file = os.path.join (global_options.output_name, basename + '.psfonts')
         output = os.path.join (global_options.output_name, basename +  '.dvi' )
         
-        progress ('\n')
-        progress (_ ("DVIPS usage:"))
-        progress ('\n')
-        progress ("    dvips -h %(psfonts_file)s %(output)s" % vars ())
-        progress ('\n')
+        if not global_options.psfonts:
+            warning (_ ("option --psfonts not used"))
+            warning (_ ("processing with dvips will have no fonts"))
+        else:
+            progress ('\n')
+            progress (_ ("DVIPS usage:"))
+            progress ('\n')
+            progress ("    dvips -h %(psfonts_file)s %(output)s" % vars ())
+            progress ('\n')
 
     inputs = note_input_file ('')
     inputs.pop ()
index 5941224ed1b24cd562ca7c9a1c11154caf51277e..5cf8c2d011b254f588a2369cfc685fd6f956ee84 100644 (file)
@@ -20,9 +20,8 @@ $(outdir)/%.ps.gz.omf: %.texi
 $(outdir)/%/%.html: $(outdir)/%.texi
        $(MAKEINFO) --output=$@ --css-include=$(top-src-dir)/Documentation/texinfo.css --html $<
 
-
-$(outdir)/%.dvi: $(outdir)/%.texi
-       cd $(outdir); texi2dvi $(TEXI2DVI_FLAGS) --batch $(TEXINFO_PAPERSIZE_OPTION) $(<F)
+$(outdir)/%.pdf: $(outdir)/%.texi
+       cd $(outdir); texi2pdf $(TEXI2PDF_FLAGS) --batch $(TEXINFO_PAPERSIZE_OPTION) $(<F)
 
 $(outdir)/%.txt: $(outdir)/%.texi
        $(MAKEINFO) -I $(src-dir) -I $(outdir) --no-split --no-headers --output $@ $<