From: Han-Wen Nienhuys Date: Mon, 31 Jan 2005 11:23:03 +0000 (+0000) Subject: * scm/file-cache.scm (cached-file-contents): add file. Read each X-Git-Tag: release/2.5.14~186 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c021c6e22f7a49c4702b9a580427c0d11d5bacbe;p=lilypond.git * 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. * 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. --- diff --git a/ChangeLog b/ChangeLog index 02a4f5c968..c8792dafb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2005-01-31 Han-Wen Nienhuys + * 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. diff --git a/input/tutorial/GNUmakefile b/input/tutorial/GNUmakefile index 20ab9e088f..621b57756b 100644 --- a/input/tutorial/GNUmakefile +++ b/input/tutorial/GNUmakefile @@ -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 diff --git a/mf/GNUmakefile b/mf/GNUmakefile index 601f61b199..dbeb90b881 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -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) diff --git a/scm/encoding.scm b/scm/encoding.scm index c108066f78..eacb296431 100644 --- a/scm/encoding.scm +++ b/scm/encoding.scm @@ -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 index 0000000000..63996233bb --- /dev/null +++ b/scm/file-cache.scm @@ -0,0 +1,17 @@ +;;;; file-cache.scm -- +;;;; +;;;; source file of the GNU LilyPond music typesetter +;;;; +;;;; (c) 2005 Han-Wen Nienhuys + + +(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)) diff --git a/scm/font.scm b/scm/font.scm index 328397c9fd..ba06c70c25 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -324,10 +324,11 @@ (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))) diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index 6968c06e3e..a1acc277cf 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -180,7 +180,7 @@ ~a %%EndResource " - file-name (ly:gulp-file file-name)))) + file-name (cached-file-contents file-name)))) (define (setup paper) (string-append @@ -208,7 +208,7 @@ (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)) @@ -217,9 +217,9 @@ (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) diff --git a/scm/framework-svg.scm b/scm/framework-svg.scm index 0335a64917..1dea920c8d 100644 --- a/scm/framework-svg.scm +++ b/scm/framework-svg.scm @@ -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")))) diff --git a/scm/lily.scm b/scm/lily.scm index ac39758fdb..e76b830762 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -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"