From 7f0e7a9adea61e4ee28491f814e0f8a881080cda Mon Sep 17 00:00:00 2001
From: Han-Wen Nienhuys <hanwen@xs4all.nl>
Date: Mon, 22 Aug 2005 21:20:12 +0000
Subject: [PATCH] * Documentation/topdocs/INSTALL.texi (Top): add GS bugfix
 requirement.

* scm/ps-to-png.scm: remove dir-re function.
(make-ps-images): generate page names, instead of globbing them.
This brings down LilyPond memory usage for make web by a factor
10. (backportme?)
---
 ChangeLog                          | 2 ++
 Documentation/topdocs/INSTALL.texi | 5 ++++-
 make/lilypond-vars.make            | 6 +-----
 scm/ps-to-png.scm                  | 9 ++++++++-
 4 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8d961e6582..30b4e86e79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2005-08-22  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+	* Documentation/topdocs/INSTALL.texi (Top): add GS bugfix requirement.
+
 	* input/regression/*.ly: formatting clean-up. Default layout
 	before music expression.
 
diff --git a/Documentation/topdocs/INSTALL.texi b/Documentation/topdocs/INSTALL.texi
index 4993a64702..6b3636b5da 100644
--- a/Documentation/topdocs/INSTALL.texi
+++ b/Documentation/topdocs/INSTALL.texi
@@ -113,7 +113,7 @@ software
 (version 1.6.5 or newer).
 @item @uref{http://www.python.org,Python} (version 2.1 or newer).
 @item @uref{http://www.ghostscript.com,Ghostscript} (version 8.15 or
-newer).
+newer)
 @end itemize
 
 @subsection Building documentation
@@ -135,6 +135,9 @@ Building the website requires some additional tools and packages
 @item ImageMagick
 @item International fonts (see input/regression/utf-8.ly for hints
 about which font packages are necessary for your platform)
+@item Ghostscript, 8.15 with the patch from
+@uref{http://bugs.ghostscript.com/show_bug.cgi?id=688154}
+
 @end itemize
 
 The HTML files can be installed into the standard documentation path
diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make
index 448515c619..bcec04b21f 100644
--- a/make/lilypond-vars.make
+++ b/make/lilypond-vars.make
@@ -7,18 +7,14 @@ export LILYPONDPREFIX:=$(build_lilypond_datadir)/$(TOPLEVEL_VERSION)
 export PYTHONPATH:=$(builddir)/python/$(outconfbase):$(PYTHONPATH)
 export DVIPSHEADERS:=$(builddir)/mf/out::
 
-
-
-
 the-script-dir=$(wildcard $(script-dir))
 
-
 ABC2LY = $(script-dir)/abc2ly.py
 CONVERT_LY = $(script-dir)/convert-ly.py
 LILYPOND = $(builddir)/lily/$(outconfbase)/lilypond
 LILYPOND_BOOK = $(script-dir)/lilypond-book.py
 LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(builddir)/mf/$(outconfbase)/  -I $(builddir)/mf/out/
-LILYPOND_BOOK_FLAGS = --process="$(LILYPOND) --backend=eps --formats=ps,png --header=texidoc -I $(srcdir)/input/test -dinternal-type-checking -danti-alias-factor=2 "
+LILYPOND_BOOK_FLAGS = --process="$(LILYPOND) --backend=eps --formats=ps,png --header=texidoc -I $(srcdir)/input/test -dinternal-type-checking -danti-alias-factor=2 -dgs-font-load"
 
 
 #texi-html for www only:
diff --git a/scm/ps-to-png.scm b/scm/ps-to-png.scm
index f43c3f19c3..44b32714b5 100644
--- a/scm/ps-to-png.scm
+++ b/scm/ps-to-png.scm
@@ -13,6 +13,7 @@
  (srfi srfi-1)
  (srfi srfi-13)
  (srfi srfi-14)
+ (lily)
  )
 
 ;; gettext wrapper for guile < 1.7.2
@@ -47,7 +48,13 @@
    str))
 
 (define (gulp-file nm len)
-  (gulp-port (open-file nm "r") len))
+
+  ;; string routines barf when strlen() != string-length,.
+  ;; which may happen as side effect of read-string!/partial.
+  
+;  (gulp-port (open-file nm "r") len))
+  (ly:gulp-file nm len))
+  
 
 ;;; ARGH - cuases memory usage to explode with GUILE cvs.  
 
-- 
2.39.5