-
- (define (experimental-on)
- "")
-
- (define (repeat-slash w a t)
- (embedded-ps ((ps-scm 'repeat-slash) w a t)))
-
- (define (font-switch i)
- (string-append
- "\\" (font i) "\n"))
-
- (define (font-def i s)
- (string-append
- "\\font" (font-switch i) "=" s "\n"))
-
- (define (header-end)
- (string-append
- "\\special{! "
-
- ;; URG: ly-gulp-file: now we can't use scm output without Lily
- (if use-regex
- ;; fixed in 1.3.4 for powerpc -- broken on Windows
- (regexp-substitute/global #f "\n"
- (ly-gulp-file "lily.ps") 'pre " %\n" 'post)
- (ly-gulp-file "lily.ps"))
- "}"
- "\\input lilyponddefs\\newdimen\\outputscale \\outputscale=\\lilypondpaperoutputscale pt\\turnOnPostScript"))
-
- ;; Note: this string must match the string in ly2dvi.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) "}" ))
-
- (define (invoke-dim1 s d)
- (string-append
- "\n\\" s "{" (number->dim d) "}"))
- (define (pt->sp x)
- (* 65536 x))
-
- ;;
- ;; need to do something to make this really safe.
- ;;
- (define (output-tex-string s)
- (if security-paranoia
- (if use-regex
- (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
- (begin (display "warning: not paranoid") (newline) s))
- s))
-
- (define (lily-def key val)
- (let ((tex-key
- (if use-regex
- ;; fixed in 1.3.4 for powerpc -- broken on Windows
- (regexp-substitute/global
- #f "_" (output-tex-string key) 'pre "X" 'post)
- (output-tex-string key)))
- (tex-val (output-tex-string val)))
- (if (equal? (sans-surrounding-whitespace tex-val) "")
- (string-append "\\let\\" tex-key "\\undefined\n")
- (string-append "\\def\\" tex-key "{" tex-val "}\n"))))
-
- (define (number->dim x)
- (string-append
- ;;ugh ly-* in backend needs compatibility func for standalone output
- (ly-number->string x) " \\outputscale "))
-
- (define (placebox x y s)
- (string-append
- "\\placebox{"
- (number->dim y) "}{" (number->dim x) "}{" s "}\n"))
-
- (define (bezier-sandwich l thick)
- (embedded-ps ((ps-scm 'bezier-sandwich) l thick)))
-
- (define (start-line ht)
- (string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n"))
-
- (define (stop-line)
- "}\\vss}\\interscoreline\n")
- (define (stop-last-line)
- "}\\vss}")
- (define (filledbox breapth width depth height)
- (string-append
- "\\kern" (number->dim (- breapth))
- "\\vrule width " (number->dim (+ breapth width))
- "depth " (number->dim depth)
- "height " (number->dim height) " "))
-
- (define (text s)
- (string-append "\\hbox{" (output-tex-string s) "}"))
-
- (define (tuplet ht gapx dx dy thick dir)
- (embedded-ps ((ps-scm 'tuplet) ht gapx dx dy thick dir)))
-
- (define (volta h w thick vert_start vert_end)
- (embedded-ps ((ps-scm 'volta) h w thick vert_start vert_end)))
-
- (define (define-origin file line col)
- (if (procedure? point-and-click)
- (string-append "\\special{src:"
- (point-and-click line col file)
- "}" )
- "")
+
+(define (experimental-on)
+ "")
+
+(define (repeat-slash w a t)
+ (embedded-ps (list 'repeat-slash w a t)))
+
+(define (font-switch i)
+ (string-append
+ "\\" (font i) "\n"))
+
+(define (font-def i s)
+ (string-append
+ "\\font" (font-switch i) "=" s "\n"))
+
+(define (header-end)
+ (string-append
+ "\\def\\scaletounit{ "
+ (number->string (cond
+ ((equal? (ly-unit) "mm") (/ 72.0 25.4))
+ ((equal? (ly-unit) "pt") (/ 72.0 72.27))
+ (else (error "unknown unit" (ly-unit)))
+ ))
+ " mul }"
+ "\\special{\\string! "
+
+ ;; URG: ly-gulp-file: now we can't use scm output without Lily
+ (if use-regex
+ ;; fixed in 1.3.4 for powerpc -- broken on Windows
+ (regexp-substitute/global #f "\n"
+ (ly-gulp-file "music-drawing-routines.ps") 'pre " %\n" 'post)
+ (ly-gulp-file "music-drawing-routines.ps"))
+ (if (defined? 'ps-testing) "/testing true def%\n" "")
+ "}"
+ "\\input lilyponddefs \\outputscale=\\lilypondpaperoutputscale \\lilypondpaperunit"
+ "\\turnOnPostScript"))
+
+;; Note: this string must match the string in ly2dvi.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) "}" ))
+
+;;
+;; need to do something to make this really safe.
+;;
+(define-public (output-tex-string s)
+ (if security-paranoia
+ (if use-regex
+ (regexp-substitute/global #f "\\\\" s 'pre "$\\backslash$" 'post)
+ (begin (display "warning: not paranoid") (newline) s))
+ s))
+
+(define (lily-def key val)
+ (let ((tex-key
+ (if use-regex
+ ;; fixed in 1.3.4 for powerpc -- broken on Windows
+ (regexp-substitute/global
+ #f "_" (output-tex-string key) 'pre "X" 'post)
+ (output-tex-string key)))
+ (tex-val (output-tex-string val)))
+ (if (equal? (sans-surrounding-whitespace tex-val) "")
+ (string-append "\\let\\" tex-key "\\undefined\n")
+ (string-append "\\def\\" tex-key "{" tex-val "}\n"))))
+
+(define (number->dim x)
+ (string-append
+ ;;ugh ly-* in backend needs compatibility func for standalone output
+ (ly-number->string x) " \\outputscale "))
+
+(define (placebox x y s)
+ (string-append
+ "\\placebox{"
+ (number->dim y) "}{" (number->dim x) "}{" s "}%\n"))
+
+(define (bezier-bow l thick)
+ (embedded-ps (list 'bezier-bow `(quote ,l) thick)))
+
+(define (bezier-sandwich l thick)
+ (embedded-ps (list 'bezier-sandwich `(quote ,l) thick)))
+
+(define (start-system ht)
+ (string-append "\\vbox to " (number->dim ht) "{\\hbox{"
+ "%\n"))
+
+(define (stop-system)
+ "}\\vss}\\interscoreline\n")
+(define (stop-last-system)
+ "}\\vss}")
+
+(define (filledbox breapth width depth height)
+ (if (defined? 'ps-testing)
+ (embedded-ps
+ (string-append (numbers->string (list breapth width depth height))
+ " draw_box" ))
+ (string-append
+ "\\kern" (number->dim (- breapth))
+ "\\vrule width " (number->dim (+ breapth width))
+ "depth " (number->dim depth)
+ "height " (number->dim height) " ")))
+
+(define (roundfilledbox x y width height blotdiam)
+ (embedded-ps (list 'roundfilledbox x y width height blotdiam)))
+
+(define (text s)
+ (string-append "\\hbox{" (output-tex-string s) "}"))
+
+(define (tuplet ht gapx dx dy thick dir)
+ (embedded-ps (list 'tuplet ht gapx dx dy thick dir)))
+
+(define (draw-line thick fx fy tx ty)
+ (embedded-ps (list 'draw-line thick fx fy tx ty)))
+
+(define (between-system-string string)
+ string
+ )
+(define (define-origin file line col)
+ (if (procedure? point-and-click)
+ (string-append "\\special{src:" ;;; \\string ?
+ (point-and-click line col file)
+ "}" )
+ "")