From: janneke Date: Tue, 24 Feb 2004 21:59:24 +0000 (+0000) Subject: * scm/output-ps.scm: Resurrect. X-Git-Tag: release/2.1.27~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6985375ce6d1fd0cbff0a74a5107ec5eb3ef7523;p=lilypond.git * scm/output-ps.scm: Resurrect. * scm/output-tex.scm: Minimal cleanups. * scm/paper.scm (paper-set-staff-size): Add lineheight. --- diff --git a/ChangeLog b/ChangeLog index d3f55a571b..c9a4c5eb84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2004-02-24 Jan Nieuwenhuizen + * 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. diff --git a/scm/output-ps.scm b/scm/output-ps.scm index dd9dba0ddb..4bf3f57866 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -233,6 +233,7 @@ (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 @@ -295,3 +296,62 @@ (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)) ) + diff --git a/scm/output-tex.scm b/scm/output-tex.scm index 94f1739dcb..ff3ecebcea 100644 --- a/scm/output-tex.scm +++ b/scm/output-tex.scm @@ -69,30 +69,28 @@ (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) @@ -100,31 +98,25 @@ 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* @@ -153,6 +145,7 @@ (string-append "\\" (cddr c))))) +;; top-of-file, wtf? ugh: tagline? (define (top-of-file) (string-append "% generated by LilyPond " diff --git a/scm/paper.scm b/scm/paper.scm index bb802bb17b..7267c08773 100644 --- a/scm/paper.scm +++ b/scm/paper.scm @@ -26,7 +26,7 @@ (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."