From: Han-Wen Nienhuys Date: Sun, 30 Jan 2005 23:17:23 +0000 (+0000) Subject: (dump-stencil-as-EPS): robustness: ensure X-Git-Tag: release/2.5.14~190 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9327175383c509e6e7e2677b9dfc0cb55a362901;p=lilypond.git (dump-stencil-as-EPS): robustness: ensure that both X and Y extents of bbox are non-nil. --- diff --git a/ChangeLog b/ChangeLog index a5a1408cd6..a7ec29b27f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-01-31 Han-Wen Nienhuys + + * 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 * scm/chord-name.scm (alteration->text-accidental-markup): change diff --git a/ps/lilyponddefs.ps b/ps/lilyponddefs.ps index cc9a3d785c..a53b452af7 100644 --- a/ps/lilyponddefs.ps +++ b/ps/lilyponddefs.ps @@ -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 diff --git a/scm/framework-eps.scm b/scm/framework-eps.scm index 9389302e08..28c53d66de 100644 --- a/scm/framework-eps.scm +++ b/scm/framework-eps.scm @@ -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))) diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index 2af732a818..6968c06e3e 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -266,6 +266,18 @@ (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")) @@ -273,7 +285,7 @@ (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) @@ -281,11 +293,7 @@ 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?)))