]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/paper-score.cc (process): Output titles using make-title.
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 1 Mar 2004 20:20:34 +0000 (20:20 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 1 Mar 2004 20:20:34 +0000 (20:20 +0000)
* scm/output-ps.scm (output-stencil): Display directly instead of
constructing string.
(make-title): New function.

ChangeLog
lily/paper-score.cc
scm/output-ps.scm
scm/output-tex.scm

index 0a6d206ac525cad66907a0c0cbbae0698254f0d0..ca7659d090d064991a641133f0f70d0e67675171 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-03-01  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * 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  <mabe@drongo.s3.kth.se>
 
        * Documentation/user/lilypond-book.itely (Integrating LaTeX and
index 79a826693081d958f03944b3ba53c02d03cd940a..8e24ecd5ecaade3599ddba26ac749edb53c185fe 100644 (file)
@@ -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");
 
index 1a9aa9893065491daf9b99ebc5fdf38485e3f048..96f02c12021785750d02ff34d2e175d4bf9c1f5f 100644 (file)
        (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
      " { /"
    "\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
 (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)
          (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))
 
 
 (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))))))
+
index 7c7a104f25c255ca905e82dda529dc3a1b6dd678..6661e4e61b389682071ffa9c57784a1995cb4d62 100644 (file)
 (define-public (tex-output-expression expr port)
   (display (eval expr this-module) port ))
 
-
+(define (make-title) "")