]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-ps.scm
* Documentation/topdocs/NEWS.tely (Top): simplify NEWS entry, add
[lilypond.git] / scm / output-ps.scm
index e06bca586302b5454ab92f94a21dcdd2b8149ec9..04de883e6a78d75a65e7b1afa6718e78cba9b1a0 100644 (file)
@@ -2,7 +2,7 @@
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;;                 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
 ;;;; Note: currently misused as testbed for titles with markup, see
 (define (glyph-string
         postscript-font-name
         size cid?
-        x-y-named-glyphs)
+        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
           (map (lambda  (item)
                  (let*
-                     ((x (car item))
-                      (y (cadr item))
-                      (g (caddr item))
+                     ((w (car item))
+                      (x (cadr item))
+                      (y (caddr item))
+                      (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 " ~a ~a rmoveto ~a~a glyphshow\n"
-                               x y
-                               prefix
-                               g))))
-               x-y-named-glyphs))))
+                   (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)
   (let* ((cause (ly:grob-property grob 'cause))
          (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.
   "")
 
 (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