X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Foutput-ps.scm;h=f7d0ee5b44a5ba0890f3c5e686890498ef5da70d;hb=aed0295b202901dcd07b289f94ff258a06b547e7;hp=74e1d01b61b54c6fa0e8dbbc82d8dff559e66641;hpb=7c02aa927345c3506e1910fb9241cdb1602e2eb7;p=lilypond.git diff --git a/scm/output-ps.scm b/scm/output-ps.scm index 74e1d01b61..f7d0ee5b44 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -2,7 +2,7 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 1998--2005 Jan Nieuwenhuizen +;;;; (c) 1998--2006 Jan Nieuwenhuizen ;;;; Han-Wen Nienhuys ;;;; Note: currently misused as testbed for titles with markup, see @@ -130,21 +130,20 @@ (ly:number->string y2) " lineto stroke")) (define (embedded-ps string) + (display (list "len " (string-length string) "\n")) string) - (define (glyph-string postscript-font-name size cid? w-x-y-named-glyphs) - (format #f "gsave 1 output-scale div 1 output-scale div scale - /~a ~a ~a scalefont setfont\n~a grestore" + (format #f "gsave + /~a ~a ~a output-scale div scalefont setfont\n~a grestore" postscript-font-name (if cid? " /CIDFont findresource " " findfont") - size (apply string-append @@ -156,14 +155,8 @@ (g (cadddr item)) (prefix (if (string? g) "/" ""))) - (if (and (= 0.0 x) - (= 0.0 y)) - (format #f " ~a~a glyphshow\n" prefix g) -;; (format #f " gsave ~a~a glyphshow grestore ~a 0 rmoveto \n" prefix g w) - (format #f " ~a ~a rmoveto ~a~a glyphshow\n" - x y - prefix - g)))) + (format #f " gsave ~a~a glyphshow grestore ~a ~a rmoveto \n" prefix g (+ w x) y) + )) w-x-y-named-glyphs)))) (define (grob-cause offset grob) @@ -183,10 +176,10 @@ (if (and (< 0 (interval-length x-ext)) (< 0 (interval-length y-ext))) (format "~a ~a ~a ~a (textedit://~a:~a:~a:~a) mark_URI\n" - (+ (car offset) (car x-ext)) - (+ (cdr offset) (car y-ext)) - (+ (car offset) (cdr x-ext)) - (+ (cdr offset) (cdr y-ext)) + (ly:number->string (+ (car offset) (car x-ext))) + (ly:number->string (+ (cdr offset) (car y-ext))) + (ly:number->string (+ (car offset) (cdr x-ext))) + (ly:number->string (+ (cdr offset) (cdr y-ext))) ;; TODO ;; full escaping. @@ -213,8 +206,15 @@ "") (define (placebox x y s) - (string-append - (ly:number->string x) " " (ly:number->string y) " { " s " } place-box\n")) + (format + "gsave ~a ~a translate +0 0 moveto +~a +grestore\n" + + (ly:number->string x) + (ly:number->string y) + s)) (define (polygon points blotdiameter filled?) (string-append