]> git.donarmstrong.com Git - lilypond.git/commitdiff
(dump-stencil-as-EPS): robustness: ensure
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 30 Jan 2005 23:17:23 +0000 (23:17 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 30 Jan 2005 23:17:23 +0000 (23:17 +0000)
that both X and Y extents of bbox are non-nil.

ChangeLog
ps/lilyponddefs.ps
scm/framework-eps.scm
scm/framework-ps.scm

index a5a1408cd6567f7c4bce78cfe202ff88950a12cf..a7ec29b27f1345ce99c3bd73d4d598654c2248bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-31  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * scm/framework-ps.scm (dump-stencil-as-EPS): robustness: ensure
+       that both X and Y extents of bbox are non-nil.
+
 2005-01-30  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * scm/chord-name.scm (alteration->text-accidental-markup): change
index cc9a3d785c0f74c3144f4eeb6aaa17e34662d17e..a53b452af7ba59e3785cc01c0c23a5bfd2e4763f 100644 (file)
@@ -18,7 +18,6 @@
 
 /init-paper {
        gsave
-       .1 setlinewidth
        clippath pathbbox newpath
        /vsize exch def
        /hsize exch def pop pop pop
@@ -93,7 +92,6 @@
 /init-lilypond-parameters {
        staff-line-thickness setlinewidth
        staff-height init-paper
-       pstack
 } bind def
 
 
index 9389302e081e3e4b407edc7c57306f5e04d3c393..28c53d66de79a08f3686bb1946c531c884939170 100644 (file)
@@ -52,7 +52,7 @@
     (for-each (lambda (c)
                (display (format "\\includegraphics{~a-~a.eps}%\n"
                                 basename (1+ c)) tex-system-port)
-               (display (format "@image{~a-~a}%\n"
+               (display (format "@image{~a-~a}@c\n"
                                 basename (1+ c)) texi-system-port))
              (iota (length stencils)))
 
index 2af732a818ffefb02d18a9238e4f2184161f4909..6968c06e3e180b6c19eb4f9c201ca08750741ad6 100644 (file)
 
 
 (define-public (dump-stencil-as-EPS paper dump-me filename load-fonts?)
+  (define (mm-to-bp-box mmbox)
+    (let*
+       ((scale  (ly:output-def-lookup paper 'outputscale))
+        (box (map 
+              (lambda (x)
+                (inexact->exact
+                 (round (* x scale mm-to-bigpoint)))) mmbox)))
+
+    (list (car box) (cadr box)
+         (max (1+ (car box)) (caddr box))
+         (max (1+ (cadr box)) (cadddr box)))))
+  
   (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)
               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))
+       (rounded-bbox (mm-to-bp-box bbox))
        (port (ly:outputter-port outputter))
        (header (eps-header paper rounded-bbox load-fonts?)))