X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fstencil.scm;h=32a64fdedee300616c5cccca1490fe29beef80f4;hb=4a1ebae93cee86427a5b732a568af90062234d60;hp=283f04fe2d6665055ab605b3eb564a0b63e8f874;hpb=2819ba86363def7f615b7fbbf03aecef761296c6;p=lilypond.git diff --git a/scm/stencil.scm b/scm/stencil.scm index 283f04fe2d..32a64fdede 100644 --- a/scm/stencil.scm +++ b/scm/stencil.scm @@ -274,14 +274,21 @@ encloses the contents. (define-public (eps-file->stencil axis size file-name) (let* ((contents (ly:gulp-file file-name)) - (bbox (get-postscript-bbox contents)) + (bbox (get-postscript-bbox (car (string-split contents #\nul)))) (bbox-size (if (= axis X) (- (list-ref bbox 2) (list-ref bbox 0)) (- (list-ref bbox 3) (list-ref bbox 1)) )) (factor (exact->inexact (/ size bbox-size))) (scaled-bbox - (map (lambda (x) (* factor x)) bbox))) + (map (lambda (x) (* factor x)) bbox)) + (clip-rect-string (format + "~a ~a ~a ~a rectclip" + (list-ref bbox 0) + (list-ref bbox 1) + (- (list-ref bbox 2) (list-ref bbox 0)) + (- (list-ref bbox 3) (list-ref bbox 1))))) + (if bbox (ly:make-stencil @@ -293,9 +300,11 @@ encloses the contents. gsave currentpoint translate BeginEPSF -~a ~a scale +~a dup scale +~a %%BeginDocument: ~a -" factor factor +" factor clip-rect-string + file-name ) contents