From fahree at gmail.com Thu Sep 1 19:50:25 2005 From: fahree at gmail.com (=?ISO-8859-1?Q?Far=E9?=) Date: Thu, 1 Sep 2005 15:50:25 -0400 Subject: [cl-typesetting-devel] Re: cl-pdf vs the fasl cache In-Reply-To: <653bea16050825234936084c5d@mail.gmail.com> References: <653bea16050825221261c16b57@mail.gmail.com> <653bea16050825234936084c5d@mail.gmail.com> Message-ID: <653bea1605090112506046b0b@mail.gmail.com> 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? From marc.battyani at fractalconcept.com Thu Sep 1 20:26:04 2005 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 1 Sep 2005 22:26:04 +0200 Subject: [cl-typesetting-devel] Re: cl-pdf vs the fasl cache References: <653bea16050825221261c16b57@mail.gmail.com><653bea16050825234936084c5d@mail.gmail.com> <653bea1605090112506046b0b@mail.gmail.com> Message-ID: <039f01c5af33$61471b10$0a02a8c0@marcxp> Far? wrote: >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*. [...] Thanks. I will put these new versions. Marc