-
- (define (lily-def key val)
-
- (if (string=? (substring key 0 (min (string-length "lilypondpaper") (string-length key))) "lilypondpaper")
- (string-append "/" key " {" val "} bind def\n")
- (string-append "/" key " (" val ") def\n")
- )
- )
-
- (define (header creator generate)
- (string-append
- "%!PS-Adobe-3.0\n"
- "%%Creator: " creator generate "\n"))
-
- (define (invoke-char s i)
- (string-append
- "(\\" (inexact->string i 8) ") " s " " ))
-
- (define (invoke-dim1 s d)
- (string-append
- (ly-number->string (* d (/ 72.27 72))) " " s ))
-
- (define (placebox x y s)
- (string-append
- (ly-number->string x) " " (ly-number->string y) " {" s "} placebox\n"))
-
- (define (bezier-sandwich l thick)
- (string-append
- (apply string-append (map control->string l))
- (ly-number->string thick)
- " draw_bezier_sandwich"))
-
- (define (start-line height)
- "\nstart_line {
+
+(define (font-load-command name-mag command)
+ (string-append
+ "/" command
+ " { /"
+ (car name-mag)
+ " findfont "
+ "12 " (ly-number->string (cdr name-mag)) " mul "
+ "lilypondpaperoutputscale div scalefont setfont } bind def "
+ "\n"))
+
+(define (beam width slope thick)
+ (string-append
+ (numbers->string (list slope width thick)) " draw_beam" ))
+
+(define (comment s)
+ (string-append "% " s "\n"))
+
+(define (bracket arch_angle arch_width arch_height height arch_thick thick)
+ (string-append
+ (numbers->string (list arch_angle arch_width arch_height height arch_thick thick)) " draw_bracket" ))
+
+(define (char i)
+ (invoke-char " show" i))
+
+
+(define (hairpin thick width starth endh )
+ (string-append
+ (numbers->string (list width starth endh thick))
+ " draw_hairpin"))
+
+;; what the heck is this interface ?
+(define (dashed-slur thick dash l)
+ (string-append
+ (apply string-append (map control->string l))
+ (ly-number->string thick)
+ " [ "
+ (ly-number->string dash)
+ " "
+ (ly-number->string (* 10 thick)) ;UGH. 10 ?
+ " ] 0 draw_dashed_slur"))
+
+(define (dashed-line thick on off dx dy)
+ (string-append
+ (ly-number->string dx)
+ " "
+ (ly-number->string dy)
+ " "
+ (ly-number->string thick)
+ " [ "
+ (ly-number->string on)
+ " "
+ (ly-number->string off)
+ " ] 0 draw_dashed_line"))
+
+(define (repeat-slash wid slope thick)
+ (string-append (numbers->string (list wid slope thick))
+ " draw_repeat_slash"))
+
+(define (end-output)
+ "\nend-lilypond-output\n")
+
+(define (experimental-on) "")
+
+(define (filledbox breapth width depth height)
+ (string-append (numbers->string (list breapth width depth height))
+ " draw_box" ))
+
+;; obsolete?
+(define (font-def i s)
+ (string-append
+ "\n/" (font i) " {/"
+ (substring s 0 (- (string-length s) 4))
+ " findfont 12 scalefont setfont} bind def \n"))
+
+(define (font-switch i)
+ (string-append (font i) " "))
+
+(define (header-end)
+ (string-append
+ ;; URG: now we can't use scm output without Lily
+ (ly-gulp-file "lilyponddefs.ps")
+ " {exch pop //systemdict /run get exec} "
+ (ly-gulp-file "music-drawing-routines.ps")
+ "{ exch pop //systemdict /run get exec } "
+ (if (defined? 'ps-testing) "\n /testing true def" "")
+ ))
+
+(define (lily-def key val)
+
+ (if (string=? (substring key 0 (min (string-length "lilypondpaper") (string-length key))) "lilypondpaper")
+ (string-append "/" key " {" val "} bind def\n")
+ (string-append "/" key " (" val ") def\n")
+ )
+ )
+
+(define (header creator generate)
+ (string-append
+ "%!PS-Adobe-3.0\n"
+ "%%Creator: " creator generate "\n"))
+
+(define (invoke-char s i)
+ (string-append
+ "(\\" (inexact->string i 8) ") " s " " ))
+
+(define (invoke-dim1 s d)
+ (string-append
+ (ly-number->string (* d (/ 72.27 72))) " " s ))
+
+(define (placebox x y s)
+ (string-append
+ (ly-number->string x) " " (ly-number->string y) " {" s "} place-box\n"))
+
+(define (bezier-sandwich l thick)
+ (string-append
+ (apply string-append (map control->string l))
+ (ly-number->string thick)
+ " draw_bezier_sandwich"))
+
+ ; TODO: use HEIGHT argument
+(define (start-line height)
+ (string-append
+ "\n"
+ (ly-number->string height)
+ " start-line {