* scm/output-tex.scm: Minimal cleanups.
* scm/paper.scm (paper-set-staff-size): Add lineheight.
2004-02-24 Jan Nieuwenhuizen <janneke@gnu.org>
+ * scm/output-ps.scm: Resurrect.
+
+ * scm/output-tex.scm: Minimal cleanups.
+
+ * scm/paper.scm (paper-set-staff-size): Add lineheight.
+
* make/ly-rules.make: Remove any broken lily-*.tex files before
lilypond-book run.
(string-append
"%!PS-Adobe-3.0\n"
"%%Creator: " creator generate "\n"))
+
(define (header-end)
(string-append
;; URG: now we can't use scm output without Lily
(define (unknown)
"\n unknown\n")
+;; top-of-file, wtf?
+(define (top-of-file)
+ (header (string-append "GNU LilyPond (" (lilypond-version) "), ")
+ (strftime "%c" (localtime (current-time)))))
+
+(define (output-paper-def pd)
+ (apply
+ string-append
+ (module-map
+ (lambda (sym var)
+ (let ((val (variable-ref var))
+ (key (symbol->string sym)))
+
+ (cond
+ ((string? val)
+ (ps-string-def "lilypondpaper" sym val))
+ ((number? val)
+ (ps-number-def "lilypondpaper" sym
+ (if (integer? val)
+ (number->string val)
+ (number->string (exact->inexact val)))))
+ (else ""))))
+
+ (ly:output-def-scope pd))))
+
+
+(define (ps-string-def a b c)
+ (string-append "/" a (symbol->string b) " (" c ") def\n"))
+
+(define (ps-number-def a b c)
+ (string-append "/" a (symbol->string b) " " c " def\n"))
+
+(define (output-scopes scopes fields basename)
+ (define (output-scope scope)
+ (apply
+ string-append
+ (module-map
+ (lambda (sym var)
+ (let ((val (variable-ref var))
+ (tex-key (symbol->string sym)))
+
+ (if (memq sym fields)
+ (header-to-file basename sym val))
+
+ (cond
+ ((string? val)
+ (ps-string-def "lilypond" sym val))
+
+ ((number? val)
+ (ps-number-def "lilypond" sym
+ (if (integer? val)
+ (number->string val)
+ (number->string (exact->inexact val)))))
+ (else ""))))
+ scope)))
+
+ (apply string-append
+ (map output-scope scopes)) )
+
(string-append "\\def\\" prefix (symbol->tex-key key) "{" (output-tex-string str) "}%\n")
))
+(define (tex-number-def prefix key number)
+ (string-append "\\def\\" prefix (symbol->tex-key key) "{" number "}%\n"))
+
(define (output-paper-def pd)
(apply
string-append
(module-map
(lambda (sym var)
- (let
- ((val (variable-ref var))
- (key (symbol->tex-key sym))
- )
+ (let ((val (variable-ref var))
+ (key (symbol->tex-key sym)))
(cond
((string? val)
(tex-string-def "lilypondpaper" sym val))
((number? val)
- (string-append "\\def\\lilypondpaper" key "{"
- (if (integer? val)
- (number->string val)
- (number->string (exact->inexact val)))
- "}%\n"))
- (else ""))
- ))
+ (tex-number-def "lilypondpaper" sym
+ (if (integer? val)
+ (number->string val)
+ (number->string (exact->inexact val)))))
+ (else ""))))
- (ly:output-def-scope pd))
- ))
+ (ly:output-def-scope pd))))
(define (output-scopes scopes fields basename)
(define (output-scope scope)
string-append
(module-map
(lambda (sym var)
- (let
- ((val (variable-ref var))
- (tex-key (symbol->string sym))
- )
+ (let ((val (variable-ref var))
+ (tex-key (symbol->string sym)))
+
(if (memq sym fields)
(header-to-file basename sym val))
(cond
((string? val)
- (tex-string-def "lilypond" sym val) )
+ (tex-string-def "lilypond" sym val))
((number? val)
- (string-append "\\def\\" tex-key "{"
- (if (integer? val)
- (number->string val)
- (number->string (exact->inexact val)))
- "}"))
- (else "") )
-
- ))
- scope)
- ))
+ (tex-number-def "lilypond" sym
+ (if (integer? val)
+ (number->string val)
+ (number->string (exact->inexact val)))))
+ (else ""))))
+ scope)))
(apply string-append
- (map output-scope scopes)) )
-
+ (map output-scope scopes)))
(define (select-font name-mag-pair)
(let*
(string-append "\\" (cddr c)))))
+;; top-of-file, wtf? ugh: tagline?
(define (top-of-file)
(string-append
"% generated by LilyPond "
(module-define! m 'ledgerlinethickness (+ (* 0.5 pt) (/ ss 10)))
(module-define! m 'blotdiameter (* 0.35 pt))
(module-define! m 'interscoreline (* 4 mm))
- ))
+ (module-define! m 'lineheight (* 14 ss))))
(define-public (set-global-staff-size sz)
"Set the default staff size, where SZ is thought to be in PT."