]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-pdftex.scm
* mf/SConscript: Update multiple target rules.
[lilypond.git] / scm / output-pdftex.scm
index f89cda7c9d5814378b58a4322e0d9c5b5c68587a..09d448c1f682613e4d9c243e191acba014f6af7c 100644 (file)
@@ -1,11 +1,11 @@
-;;; pdftex.scm -- implement Scheme output routines for PDFTeX
-;;;
-;;;  source file of the GNU LilyPond music typesetter
-;;;  modified from the existing tex.scm
-;;; 
-;;; (c)  1998--2003 Jan Nieuwenhuizen <janneke@gnu.org>
-;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
-;;; Stephen Peters <portnoy@portnoy.org>
+;;;; pdftex.scm -- implement Scheme output routines for PDFTeX
+;;;;
+;;;;  source file of the GNU LilyPond music typesetter
+;;;;  modified from the existing tex.scm
+;;;; 
+;;;; (c)  1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;;                 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;;                 Stephen Peters <portnoy@portnoy.org>
 
 
 ;; TODO: port this  to the new module framework.
@@ -48,8 +48,8 @@
     
     ))
 
-(define (beam width slope thick)
-  (embedded-pdf (list 'beam  width slope thick)))
+(define (beam width slope thick blot)
+  (embedded-pdf (list 'beam  width slope thick blot)))
 
 (define (bracket arch_angle arch_width arch_height height arch_thick thick)
   (embedded-pdf (list 'bracket  arch_angle arch_width arch_height height arch_thick thick)))
@@ -58,7 +58,7 @@
   (embedded-pdf (list 'dashed-slur   thick dash l)))
 
 (define (char i)
-  (string-append "\\char" (inexact->string i 10) " "))
+  (string-append "\\char" (ly:inexact->string i 10) " "))
 
 (define (dashed-line thick on off dx dy)
   (embedded-pdf (list 'dashed-line  thick on off dx dy)))
@@ -68,7 +68,7 @@
    "\\font\\" command "="
    (car name-mag)
    " scaled "
-   (ly:number->string (inexact->exact (* 1000  (cdr name-mag))))
+   (ly:number->string (inexact->exact (* 1000 (cdr name-mag))))
    "\n"))
 
 (define (ez-ball c l b)
     (string-append "\\embeddedpdf{" (get-output-string os) "}")))
 
 
-(define (comment s)
-  (simple-format #f "% ~a\n" s))
-
-(define (end-output) 
-  (begin
-                                       ; uncomment for some stats about lily memory      
-                                       ;               (display (gc-stats))
-    (string-append "%\n\\lilypondend\n"
-                                       ; Put GC stats here.
-                  )))
 
 (define (experimental-on)
   "")
 
 (define (repeat-slash w a t)
   (embedded-pdf (list 'repeat-slash w a t)))
-(define (fontify name-mag-pair exp)
-  (string-append (select-font name-mag-pair)
-                exp))
 
 
 (define (tex-encoded-fontswitch name-mag)
    "\\lilypondpostscript\n"
    "\\pdfcompresslevel=0"))
 
-;; Note: this string must match the string in ly2dvi.py!!!
+;; Note: this string must match the string in lilypond.py!!!
 (define (header creator generate) 
   (string-append
    "% Generated automatically by: " creator generate "\n"))
 
 (define (invoke-char s i)
   (string-append 
-   "\n\\" s "{" (inexact->string i 10) "}" ))
+   "\n\\" s "{" (ly:inexact->string i 10) "}" ))
 
-;;
-;; need to do something to make this really safe.
-;;
+;; FIXME: explain ploblem: need to do something to make this really safe.  
 (define (output-tex-string s)
-  (if security-paranoia
-      (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
+  (if (ly:get-option 'safe)
+      (regexp-substitute/global #f "\\\\"
+                               (regexp-substitute/global #f "\\([{}]\\)" s 'pre "\\1" 'post)
+                                'pre "$\\backslash$" 'post)
+      
       s))
 
 (define (lily-def key val)
                 (ly:number->string depth) "}{"
                 (ly:number->string height) "}"))
 
-(define (roundfilledbox x y width height blotdiam)
-  (embedded-pdf (list 'roundfilledbox  x y width height blotdiam)))
+(define (round-filled-box x y width height blotdiam)
+  (embedded-pdf (list 'round-filled-box  x y width height blotdiam)))
 
 (define (text s)
   (string-append "\\hbox{" (output-tex-string s) "}"))