]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-ps.scm
* scm/output-tex.scm (named-glyph): new function. This fixes TeX output.
[lilypond.git] / scm / output-ps.scm
index 1615102f6cf5657adca701f7ba07a04753be3430..75251dcbfa0b081bb8d9bafdfda2e7514d20f868 100644 (file)
@@ -27,9 +27,9 @@
             bracket
             dashed-slur
             char
+            named-glyph
             dashed-line
             zigzag-line
-            symmetric-x-triangle
             ez-ball
             comment
             repeat-slash
@@ -41,7 +41,6 @@
             round-filled-box
             text
             white-text
-            tuplet
             polygon
             draw-line
             no-origin
@@ -99,9 +98,9 @@
    (ly:numbers->string (list slope width thick blot)) " draw_beam" ))
 
 ;; two beziers
-(define (bezier-sandwich l thick)
+(define (bezier-sandwich lst thick)
   (string-append 
-   (string-join (map ly:number-pair->string l) " ")
+   (string-join (map ly:number-pair->string lst) " ")
    " "
    (ly:number->string thick)
    " draw_bezier_sandwich"))
     (ps-font-command font) " setfont " 
    "(\\" (ly:inexact->string i 8) ") show" ))
 
+(define (named-glyph font glyph)
+  (string-append 
+    (ps-font-command font) " setfont " 
+   "/" glyph " glyphshow "))
+
 (define (dashed-line thick on off dx dy)
   (string-append 
    (ly:number->string dx) " "
   (draw-line th x1 0 x2 0))
 
 (define (lily-def key val)
-  (let ((prefix "lilypondpaper"))
+  (let ((prefix "lilypondlayout"))
     (if (string=?
         (substring key 0 (min (string-length prefix) (string-length key)))
         prefix)
     (ly:numbers->string
      (list x y width height blotdiam)) " draw_round_box"))
 
-
-(define (stem breapth width depth height) ; FIXME: use draw_round_box.
-  (string-append
-   (ly:numbers->string (list breapth width depth height))
-   " draw_box" ))
-
-(define (symmetric-x-triangle thick w h)
-  (string-append
-   (ly:numbers->string (list h w thick))
-   " draw_symmetric_x_triangle"))
-
-(define (text font s)
+(define (old-text font s)
   (let*
       
       ;; ugh, we should find a better way to
      (string-join (reverse commands)))
     ))
 
+(define (new-text font s)
+  (let*
+      ((space-length (cdar (ly:text-dimension font "t")))
+       (space-move (string-append (number->string space-length) " 0.0 rmoveto "))
+       
+       (input-enc (assoc-get 'input-name
+                            (ly:font-encoding-alist font)
+                            'latin1))
+       (out-vec (decode-byte-string input-enc s)))
+
+
+    (string-append
+     (ps-font-command font) " setfont "
+     (string-join
+      (vector->list
+       (vector-for-each
+       
+       (lambda (sym)
+         (if (eq? sym 'space)
+             space-move
+             (string-append "/" (symbol->string sym) " glyphshow")))
+       out-vec)))
+     )))
+
+;(define text old-text)
+(define text new-text)
 
 (define (white-text scale s)
    (let ((mystring (string-append "(" s  ") " (number->string scale)   " /Helvetica-bold "