]> 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 ae0d93e306754708f7d717fe8069643ad3d4b560..75251dcbfa0b081bb8d9bafdfda2e7514d20f868 100644 (file)
@@ -27,6 +27,7 @@
             bracket
             dashed-slur
             char
+            named-glyph
             dashed-line
             zigzag-line
             ez-ball
     (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) " "
     (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 (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 "