]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scripts/lilypond-book.py (process_snippets): add texstr support.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 29 Dec 2004 12:33:02 +0000 (12:33 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 29 Dec 2004 12:33:02 +0000 (12:33 +0000)
* scm/framework-texstr.scm (header): change extension to .textmetrics

* lily/lily-parser.cc (parse_file): do try_load_text_metrics for
-f tex.

* lily/text-metrics.cc: new file.
(try_load_text_metrics): new function

ChangeLog
VERSION
lily/text-metrics.cc
scm/framework-texstr.scm
scm/output-texstr.scm
scripts/lilypond-book.py

index 49a40f4bd3dec98f74a222c05c97b99d1a18dd23..9200ad6054cfb71ccf06d98c9ed3004e0c1df26c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2004-12-29  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * scripts/lilypond-book.py (process_snippets): add texstr support.
+
        * scm/framework-texstr.scm (header): change extension to .textmetrics
 
        * lily/lily-parser.cc (parse_file): do try_load_text_metrics for
diff --git a/VERSION b/VERSION
index 189da5b16f6f03efc73b3be62eeee7ba946ef95f..41483e3a70f07d70144a1af010b0b26dbe1c26eb 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=5
-PATCH_LEVEL=5
+PATCH_LEVEL=6
 MY_PATCH_LEVEL=
 
index c987579e400009818b0a99360ad33b7fab4300b6..604c7ef956d159f0506480c932d827ab351ea7e1 100644 (file)
 
 static SCM text_dimension_hash_tab;
 
-
 Box
-lookup_tex_text_dimension (Font_metric *font,
-                          SCM text)
+lookup_tex_text_dimension (Font_metric *font, SCM text)
 {
   Box b;
 
@@ -45,8 +43,6 @@ lookup_tex_text_dimension (Font_metric *font,
   return b; 
 }
 
-
-
 LY_DEFINE(ly_load_text_dimensions, "ly:load-text-dimensions",
          1, 0, 0,
          (SCM dimension_alist),
index 9931a81c45692e9cee493449c834c36fba967ffc..903cd19310c24bc0a17f2aadb6364f1e576048d2 100644 (file)
 ")
 
 
-(define-public (output-framework outputter book scopes fields basename )
+(define-public (output-classic-framework outputter book scopes fields basename)
+  (let* ((paper (ly:paper-book-paper book))
+        (lines (ly:paper-book-systems book))
+        )
+    (ly:outputter-dump-string outputter (header basename))
+    (for-each
+     (lambda (system)
+       (ly:outputter-dump-stencil outputter (ly:paper-system-stencil system)))
+     lines)
+    (ly:outputter-dump-string outputter (footer))))
+
+(define-public (output-framework outputter book scopes fields basename)
   (let* ((paper (ly:paper-book-paper book))
         (pages (ly:paper-book-pages book))
         )
index d9cc2e3b77dca548308b98b35414c6a15e1e2af6..7b285cf2baef1b1f9d56092d4de4194f086c2d9b 100644 (file)
@@ -11,7 +11,7 @@
  (guile)
  (ice-9 regex)
  (srfi srfi-13)
- (lily output-tex)
+ (scm framework-tex)
  (lily))
 
 (define (dummy . foo) #f)
index de067edc25dca0906a1669f6ef4a9054078c4da7..dc5a24cc1cabcaa23f4bb6588319b7a1fcfbe337 100644 (file)
@@ -891,7 +891,12 @@ class Lilypond_snippet (Snippet):
                        ok = ok and (os.path.exists (base + '.png')
                                     or glob.glob (base + '-page*.png'))
                return not ok
-
+       def texstr_is_outdated (self):
+               base = self.basename ()
+               ok = self.ly_is_outdated ()
+               ok = ok and (os.path.exists (base + '.texstr'))
+               return not ok
+       
        def filter_text (self):
                code = self.substring ('code')
                s = run_filter (code)
@@ -1124,20 +1129,33 @@ def is_derived_class (cl, baseclass):
                        return 1
        return 0
 
-def process_snippets (cmd, ly_snippets, png_snippets):
+def process_snippets (cmd, ly_snippets, texstr_snippets, png_snippets):
        ly_names = filter (lambda x: x,
                           map (Lilypond_snippet.basename, ly_snippets))
+       texstr_names = filter (lambda x: x,
+                          map (Lilypond_snippet.basename, texstr_snippets))
        png_names = filter (lambda x: x,
                            map (Lilypond_snippet.basename, png_snippets))
 
        status = 0
-       if ly_names:
-               status = ly.system (string.join ([cmd] + ly_names),
+       def my_system (cmd):
+               status = ly.system (cmd, 
                                    ignore_error = 1, progress_p = 1)
 
-       if status:
-               ly.error ('Process %s exited unsuccessfully.' % cmd)
-               raise Compile_error
+               if status:
+                       ly.error ('Process %s exited unsuccessfully.' % cmd)
+                       raise Compile_error
+
+       if texstr_names:
+               my_system (string.join ([cmd + ' -f texstr ' ] + texstr_names))
+               for l in texstr_names:
+                       my_system ('latex %s.texstr' % l)
+                                       
+
+       if ly_names:
+               my_system (string.join ([cmd] + ly_names))
+               
+
 
        if format == HTML or format == TEXINFO:
                for i in png_names:
@@ -1213,6 +1231,11 @@ def do_process_cmd (chunks):
                                              Lilypond_snippet)
                            and x.ly_is_outdated (),
                  chunks)
+       texstr_outdated = \
+         filter (lambda x: is_derived_class (x.__class__,
+                                             Lilypond_snippet)
+                           and x.texstr_is_outdated (),
+                 chunks)
        png_outdated = \
          filter (lambda x: is_derived_class (x.__class__,
                                              Lilypond_snippet)
@@ -1225,7 +1248,7 @@ def do_process_cmd (chunks):
 
        if ly_outdated:
                ly.progress (_ ("Processing...\n"))
-               process_snippets (process_cmd, ly_outdated, png_outdated)
+               process_snippets (process_cmd, ly_outdated, texstr_outdated, png_outdated)
        else:
                ly.progress (_ ("All snippets are up to date..."))
        ly.progress ('\n')
@@ -1414,7 +1437,7 @@ def main ():
        files = do_options ()
        global process_cmd
        if process_cmd == '':
-               process_cmd = lilypond_binary + ' -f tex'
+               process_cmd = lilypond_binary
 
        if process_cmd:
                process_cmd += string.join ([(' -I %s' % p)