From: Jan Nieuwenhuizen Date: Mon, 1 Mar 2004 20:20:34 +0000 (+0000) Subject: * lily/paper-score.cc (process): Output titles using make-title. X-Git-Tag: release/2.1.29~31 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=af50d5125ec0a18dfeafc39ffdc36b83a0fd81c4;p=lilypond.git * lily/paper-score.cc (process): Output titles using make-title. * scm/output-ps.scm (output-stencil): Display directly instead of constructing string. (make-title): New function. --- diff --git a/ChangeLog b/ChangeLog index 0a6d206ac5..ca7659d090 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-03-01 Jan Nieuwenhuizen + + * lily/paper-score.cc (process): Output titles using make-title. + + * scm/output-ps.scm (output-stencil): Display directly instead of + constructing string. + (make-title): New function. + 2004-03-01 Mats Bengtsson * Documentation/user/lilypond-book.itely (Integrating LaTeX and diff --git a/lily/paper-score.cc b/lily/paper-score.cc index 79a8266930..8e24ecd5ec 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -102,25 +102,34 @@ Paper_score::process (String outname) SCM scopes = SCM_EOL; - /* - Last one first. - */ if (header_) scopes = scm_cons (header_, scopes); - if (global_input_file->header_ && global_input_file->header_ != header_) scopes = scm_cons (global_input_file->header_, scopes); outputter_->output_metadata (scopes, paper_); outputter_->output_music_output_def (paper_); - - SCM scm = scm_list_n (ly_symbol2scm ("header-end"), SCM_UNDEFINED); - outputter_->output_scheme (scm); + outputter_->output_scheme (scm_list_1 (ly_symbol2scm ("header-end"))); + + outputter_ + ->output_scheme (scm_list_2 (ly_symbol2scm ("define-fonts"), + ly_quote_scm (paper_->font_descriptions ()))); + +#if 0 + // huh? does not work, stack overflow + outputter_->output_scheme (scm_list_2 (ly_symbol2scm ("make-title"), + outputter_->file_)); +#else +#if 0 + // uhuh?? does not work, stack overflow + outputter_->output_scheme (scm_list_2 (ly_symbol2scm ("set-port"), + outputter_->file_)); +#endif + outputter_->output_scheme (scm_list_1 (ly_symbol2scm ("make-title"))); +#endif system_->output_lines (); - - scm = scm_list_n (ly_symbol2scm ("end-output"), SCM_UNDEFINED); - outputter_->output_scheme (scm); + outputter_->output_scheme (scm_list_1 (ly_symbol2scm ("end-output"))); progress_indication ("\n"); diff --git a/scm/output-ps.scm b/scm/output-ps.scm index 1a9aa98930..96f02c1202 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -135,8 +135,6 @@ (regexp-substitute/global #f "feta([a-z-]*)([0-9]+)" name 'pre "GNU-LilyPond-feta" 1 "-" 2 'post)) (else name))) - ;;(format (current-error-port) "DEFINE-FONTS: ~S\n" internal-external-name-mag-pairs) - (string-append "/" command " { /" @@ -301,14 +299,7 @@ "\n" (ly:number->string height) " start-system\n" "{\n" - "set-ps-scale-to-lily-scale\n" - - ;; URG - (if (pair? header-stencils) - (let ((s (output-stencils header-stencils))) - (set! header-stencils '()) - (string-append s (stop-system) (start-system width height))) - ""))) + "set-ps-scale-to-lily-scale\n")) (define (stem breapth width depth height) (string-append @@ -367,8 +358,7 @@ (define (output-scopes paper scopes fields basename) ;; FIXME: customise/generate these - (let ((props '((;;(linewidth . 120) - (font-family . roman) + (let ((props '(((font-family . roman) (word-space . 1) (baseline-skip . 2) (font-series . medium) @@ -384,10 +374,18 @@ (let ((val (variable-ref var)) (tex-key (symbol->string sym))) + (format (current-error-port) "SYM:~S\n" sym) + (if (memq sym fields) (header-to-file basename sym val)) (cond + ((eq? sym 'font) + BARF + (format (current-error-port) "PROPS:~S\n" val) + (set! props (cons val props)) + "") + ;; define strings, for /make-lilypond-title to pick up ((string? val) (ps-string-def "lilypond" sym val)) @@ -416,27 +414,37 @@ (define header-stencils '()) -(define (output-stencils lst) - (apply string-append - (map (lambda (x) (stencil->string x '(10 . -10))) lst))) +(define output-port (current-error-port)) +(define (set-port p) + (set! output-port p) + "") + +(define (make-title) + (if (pair? header-stencils) + (map (lambda (x) (output-stencil output-port x '(10 . -10))) + header-stencils)) + "") ;; hmm, looks like recursing call is always last statement, does guile ;; think so too? -(define (stencil->string expr o) +(define (output-stencil port expr offset) (if (pair? expr) (let ((head (car expr))) + (format (current-error-port) "head: ~S\n" head) + (force-output (current-error-port)) (cond ((ly:input-location? head) - (string-append (apply define-origin (ly:input-location head)) - (stencil->string (cadr expr) o))) + (display (apply define-origin (ly:input-location head)) port) + (output-stencil port (cadr expr) offset)) ((eq? head 'no-origin) - (string-append (expression->string head) - (stencil->string (cadr expr) o))) + (display (expression->string head) port) + (output-stencil port (cadr expr) offset)) ((eq? head 'translate-stencil) - (stencil->string (caddr expr) (offset-add o (cadr expr)))) + (output-stencil port (caddr expr) (offset-add offset (cadr expr)))) ((eq? head 'combine-stencil) - (string-append (stencil->string (cadr expr) o) - (stencil->string (caddr expr) o))) + (output-stencil port (cadr expr) offset) + (output-stencil port (caddr expr) offset)) (else - (placebox (car o) (cdr o) (expression->string expr))))) - "")) + (display (placebox (car offset) (cdr offset) + (expression->string expr)) port)))))) + diff --git a/scm/output-tex.scm b/scm/output-tex.scm index 7c7a104f25..6661e4e61b 100644 --- a/scm/output-tex.scm +++ b/scm/output-tex.scm @@ -352,4 +352,4 @@ (define-public (tex-output-expression expr port) (display (eval expr this-module) port )) - +(define (make-title) "")