]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/lily.scm
release: 1.2.6
[lilypond.git] / scm / lily.scm
index cdeca540f1671890216ef58f427285b204c4ef52..f1431284bce8d48ddcfe92bf91701169f89bf231 100644 (file)
 
   (define (select-font font-name magnification)
       (if (not (equal? font-name current-font))
-         (begin
+         (let* ((font-cmd (assoc font-name font-alist)))
            (set! current-font font-name)
-           (define font-cmd (assoc font-name font-alist))
            (if (eq? font-cmd #f)
                (begin
                  (set! font-cmd (cached-fontname font-count))
     (string-append
      "\\font" (font-switch i) "=" s "\n"))
 
-  ;; UGH
-   
-  (define (header-end) "\\turnOnPostScript")
+  (define (header-end)
+    (string-append
+     "\\special{! "
+     (ly-gulp-file "lily.ps")
+     ;; breaks on ppc
+;;     (regexp-substitute/global #f "\n" (ly-gulp-file "lily.ps") 'pre " %\n" 'post)
+     "}"
+     "\\input lilyponddefs \\turnOnPostScript"))
 
   (define (header creator generate) 
     (string-append
   ;;
   ;; need to do something to make this really safe.
   ;;
-  (if security-paranoia
-      (define (output-tex-string s)
-       (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post))
-      (define (output-tex-string s)    s))
+  (define (output-tex-string s)
+      (if security-paranoia
+         (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
+         s))
+      
 
   (define (lily-def key val)
     (string-append
     )
 
 
-  (define (rulesym h w) 
-    (string-append 
-     "\\vrule height " (number->dim (/ h 2))
-     " depth " (number->dim (/ h 2))
-     " width " (number->dim w)
-     )
-    )
-
   (define (bezier-sandwich l thick)
     (embedded-ps ((ps-scm 'bezier-sandwich) l thick)))
 
            (define invoke-dim1 ,invoke-dim1)
            (define pianobrace ,pianobrace)
            (define placebox ,placebox)
-           (define rulesym ,rulesym)
            (define select-font ,select-font)
            (define start-line ,start-line)
            (define stop-line ,stop-line)
        ((eq? action-name 'invoke-char) invoke-char) 
        ((eq? action-name 'invoke-dim1) invoke-dim1)
        ((eq? action-name 'placebox) placebox)
-       ((eq? action-name 'rulesym) rulesym)
        ((eq? action-name 'bezier-sandwich) bezier-sandwich)
        ((eq? action-name 'start-line) start-line)
        ((eq? action-name 'stem) stem)
      (apply string-append (map control->string l)) 
      (number->string thick) 
      " [ "
-     (if (> 1 dash) (number->string (- (* thick dash) thick)) "0") " "
+     (if (> 1 dash)
+        (number->string (- (* thick dash) thick))
+        "0")
+     " "
      (number->string (* 2 thick))
      " ] 0 draw_dashed_slur"))
 
   (define (font-switch i)
     (string-append (font i) " "))
 
-  (define (header-end) "")
+  (define (header-end)
+    (string-append
+     (ly-gulp-file "lilyponddefs.ps")
+     " {exch pop //systemdict /run get exec} "
+     (ly-gulp-file "lily.ps")
+     "{ exch pop //systemdict /run get exec } "
+    ))
+  
   (define (lily-def key val)
 
      (if (string=? (substring key 0 (min (string-length "mudelapaper") (string-length key))) "mudelapaper")
     )
 
 
-  (define (rulesym x y) 
-    (string-append 
-     (number->string x) " "
-     (number->string y) " "
-     " rulesym"))
-
   (define (bezier-sandwich l thick)
     (string-append 
      (apply string-append (map control->string l))
            (define invoke-char ,invoke-char) 
            (define invoke-dim1 ,invoke-dim1)
            (define placebox ,placebox)
-           (define rulesym ,rulesym)
            (define select-font ,select-font)
            (define start-line ,start-line)
            (define stem ,stem)