[cl-typesetting-devel] Re: cl-pdf vs the fasl cache

Faré fahree at gmail.com
Thu Sep 1 19:50:25 UTC 2005


It appears that because the files may be compiled from the REPL
instead of loaded or compiled from a loaded file, it's better and
safer to use (or #-gcl *compile-file-truename* *load-truename*)
instead of *load-truename*. Hence, we should have:

* In cl-typesetting/hyphenation-fp.lisp
(defvar *cl-typesetting-base-directory*
   (make-pathname :name nil :type nil :version nil
     :defaults #.(or #-gcl *compile-file-truename* *load-truename*))
   "The base directory for cl-typesetting source and auxiliary data")

* In cl-pdf/config.lisp:
(defvar *cl-pdf-base-directory*
   (make-pathname :name nil :type nil :version nil
     :defaults #.(or #-gcl *compile-file-truename* *load-truename*))
   "The base directory for cl-pdf source and auxiliary data")

(defparameter *afm-files-directories*
   (list (merge-pathnames #P"afm/*.afm" *cl-pdf-base-directory*))
   "The directory containing the Adobe Font Metrics files for the 14
predefined fonts")

Don't forget to use defconstant* with +paper-sizes+ (in
cl-typesetting/top-level.lisp) so as to compile correctly with SBCL.
Here is defconstant* to put in cl-typesetting/specials.lisp:
(defmacro defconstant* (name value &optional doc)
 "This variant of DEFCONSTANT avoids problems with being evaluated multiple
times with an expression that doesn't yield EQ values across evaluations."
 `(defconstant ,name
    (if (boundp ',name) (symbol-value ',name) ,value)
    ,@(when doc (list doc))))

And finally, since the API to cl-launch has changed a bit so as to
make fasl caching global, here's what to use to compile the things and
run examples:
    http://www.cliki.net/cl-launch

cd /home/fare/src/cl-pdf/
cl-launch.sh -o cl-pdf.sh -a cl-pdf -i '
(progn
(setf *default-pathname-defaults*
(merge-pathnames #p"examples/" *default-pathname-defaults*))
(load "examples.lisp")
(example1)
(example2)
(example3)
(example4)
(example5 40 40)
(example6)
(example7)
(example8))
'
./cl-pdf.sh
for i in /tmp/*.pdf ; do xpdf  $i ; done

cd /home/fare/src/cl-typesetting/
cl-launch.sh -o cl-typesetting-test.sh -a cl-typesetting-test -i '
(progn
(typeset::hello "hello.pdf")
(typeset::multi-page-hello "multi-page-hello.pdf")
(typeset::multi-page-example "/tmp/multi-page.pdf")
(pdf:load-t1-font "./files-for-example/cmex10.afm"
"./files-for-example/cmex10.pfb")
(pdf:load-t1-font "./files-for-example/cmti10.afm"
"./files-for-example/cmti10.pfb")
(typeset::full-example "ex.pdf" "./files-for-example/banner.jpg"
"./files-for-example/fractal.jpg"))
'
./cl-typesetting-test.sh

Cheers!

[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ]
Is eating the flesh around one's nails to be considered as anthropophagy,
and does it qualify one for eternal damnation to burn in hell?



More information about the cl-typesetting-devel mailing list