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.
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.
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
depth = ..
STEPMAKE_TEMPLATES=metafont install install-out
+LOCAL_STEPMAKE_TEMPLATES=lilypond
include $(depth)/make/stepmake.make
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)
"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))
--- /dev/null
+;;;; 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))
(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)))
~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)
(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"))))
(for-each ly:load
;; load-from-path
'("lily-library.scm"
+ "file-cache.scm"
"define-music-types.scm"
"output-lib.scm"
"c++.scm"