]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/file-cache.scm (cached-file-contents): add file. Read each
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 31 Jan 2005 11:23:03 +0000 (11:23 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 31 Jan 2005 11:23:03 +0000 (11:23 +0000)
file only once.

* scm/font.scm (add-pango-fonts): change order. Medium weight is
now default.

* mf/GNUmakefile (INSTALLATION_OUT_FILES4): install cff.ps files.

* scm/framework-ps.scm (dump-stencil-as-EPS): robustness: ensure
that both X and Y extents of bbox are non-nil.

ChangeLog
input/tutorial/GNUmakefile
mf/GNUmakefile
scm/encoding.scm
scm/file-cache.scm [new file with mode: 0644]
scm/font.scm
scm/framework-ps.scm
scm/framework-svg.scm
scm/lily.scm

index 02a4f5c968480fc55f4ff7dc087cc452c79ad558..c8792dafb7340888933edaae7f8a697f65d59a6e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2005-01-31  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * scm/file-cache.scm (cached-file-contents): add file. Read each
+       file only once.
+
+       * scm/font.scm (add-pango-fonts): change order. Medium weight is
+       now default.
+
+       * VERSION: release 2.5.10
+       
        * mf/GNUmakefile (INSTALLATION_OUT_FILES4): install cff.ps files.
 
        * make/ly-rules.make ($(outdir)/%.texi): detect new EOF marker.
index 20ab9e088f47936d4ecdf3900c4a9ceb7eb2b052..621b57756bc8d89709ceb8b56fac9458532ce2e9 100644 (file)
@@ -2,7 +2,7 @@ depth = ../..
 
 LOCALSTEPMAKE_TEMPLATES=ly mutopia
 
-EXTRA_DIST_FILES=lilbook.tex lbook-texi-test.texi
+EXTRA_DIST_FILES= lbook-texi-test.texi  lbook-latex-test.tex
 
 include $(depth)/make/stepmake.make 
 
index 601f61b199af6fa1f489922f096de36b825cf014..dbeb90b8819a5fb522c68a1ad4e4bc96fc8dd568 100644 (file)
@@ -1,6 +1,7 @@
 depth = ..
 
 STEPMAKE_TEMPLATES=metafont install install-out
+LOCAL_STEPMAKE_TEMPLATES=lilypond
 
 include $(depth)/make/stepmake.make 
 
@@ -89,7 +90,7 @@ ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES)
 INSTALLATION_DIR=$(local_lilypond_datadir)/fonts/source
 INSTALLATION_FILES=$(MF_FILES) $(AF_FILES)
 
-INSTALLATION_OUT_SUFFIXES=1 2 3 45 6 7 8 9
+INSTALLATION_OUT_SUFFIXES=1 2 3 4 5 6 7 8 9
 
 INSTALLATION_OUT_DIR1=$(local_lilypond_datadir)/tex
 INSTALLATION_OUT_FILES1=$(TEXTABLES)
index c108066f789ad92eead52e4f72afa835beaf0e62..eacb29643162d3015f58f4138fca41d67e23c0be 100644 (file)
@@ -14,7 +14,7 @@
   "Read .enc file, return (COMMAND-NAME . VECTOR-OF-SYMBOLS)."
   (let* ((path (ly:kpathsea-find-file file-name))
         (unused (if (string? path) #t (ly:warn "can't find ~s" file-name)))
-        (raw (ly:gulp-file path))
+        (raw (cached-file-contents path))
         (string (regexp-substitute/global #f "%[^\n]*" raw 'pre "" 'post))
         (command (match:substring
                   (string-match "/([^ \t\n\r]*)[ \t\n\r]*[[]" string) 1))
diff --git a/scm/file-cache.scm b/scm/file-cache.scm
new file mode 100644 (file)
index 0000000..6399623
--- /dev/null
@@ -0,0 +1,17 @@
+;;;; file-cache.scm --
+;;;;
+;;;;  source file of the GNU LilyPond music typesetter
+;;;;
+;;;; (c)  2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+
+(define cache-hash-tab  (make-hash-table 11))
+(define-public (cached-file-contents filename)
+  (let*
+      ((contents (hash-ref cache-hash-tab filename #f)))
+
+    (if (not (string? contents))
+       (begin
+         (set! contents (ly:gulp-file filename))
+         (hash-set! cache-hash-tab filename contents)))
+    contents))
index 328397c9fd840c451f24cd95560b0b30fd410ab5..ba06c70c25cc8007eeff3fbc663df46ea75df582 100644 (file)
                          (font-shape . ,shape)))
                       (ly:pt 12)))))))
 
-  (add-node 'upright 'medium
+  (add-node 'upright 'normal
   (add-node 'upright 'bold) 
-  (add-node 'italic 'bold) 
-  (add-node 'italic 'medium))
+  (add-node 'italic 'normal)
+  (add-node 'italic 'bold)
+  )
 
 (define-public (make-cmr-tree factor)
   (let ((n (make-font-tree-node 'font-encoding 'fetaMusic)))
index 6968c06e3e180b6c19eb4f9c201ca08750741ad6..a1acc277cfe6bb4371936e7cf094c71b21a31707 100644 (file)
 ~a
 %%EndResource
 "
-    file-name (ly:gulp-file file-name))))
+    file-name (cached-file-contents file-name))))
 
 (define (setup paper)
   (string-append
           (pfas (map
                  (lambda (x)
                    (let* ((bare-file-name (ly:find-file x))
-                          (cffname (string-append x ".cff"))
+                          (cffname (string-append x ".cff.ps"))
                           (aname (string-append x ".pfa"))
                           (bname (string-append x ".pfb"))
                           (cff-file-name (ly:find-file cffname))
                      (cond
                       (bare-file-name (if (string-match "\\.pfb" bare-file-name)
                                           (ly:pfb->pfa bare-file-name)
-                                          (ly:gulp-file bare-file-name)))
-                      (cff-file-name (ps-embed-cff (ly:gulp-file cff-file-name) x 0))
-                      (a-file-name (ps-embed-pfa (ly:gulp-file a-file-name) x 0))
+                                          (cached-file-contents bare-file-name)))
+                      (cff-file-name  (cached-file-contents cff-file-name))
+                      (a-file-name (ps-embed-pfa (cached-file-contents a-file-name) x 0))
                       (b-file-name (ps-embed-pfa (ly:pfb->pfa b-file-name) x 0))
                       (else
                        (ly:warn "cannot find CFF/PFA/PFB font ~S" x)
index 0335a6491793da2e4d47d62de539c8476d8c1082..1dea920c8dda9a48f063a97bddbb3f327811408d 100644 (file)
@@ -84,7 +84,7 @@
         (svgs (map
                (lambda (x)
                  (let ((file-name (ly:find-file (string-append x ".svg"))))
-                   (if file-name (embed-font (ly:gulp-file file-name))
+                   (if file-name (embed-font (cached-file-contents file-name))
                        (begin (ly:warn "cannot find SVG font ~S" x) ""))))
                (filter string? font-names))))
     (entity 'defs (string-join svgs "\n"))))
index ac39758fdb4d96cfb906967edaedf8bc02902f59..e76b8307622029692ac55b18706e1ffff5c9c33b 100644 (file)
@@ -161,6 +161,7 @@ predicates. Print a message at LOCATION if any predicate failed."
 (for-each ly:load
          ;; load-from-path
          '("lily-library.scm"
+           "file-cache.scm"
            "define-music-types.scm"
            "output-lib.scm"
            "c++.scm"