From erik at nittin.net Mon Jun 7 19:28:50 2004 From: erik at nittin.net (Erik Enge) Date: Mon, 7 Jun 2004 15:28:50 -0400 Subject: [cl-typesetting-devel] v-align typeset:cell Message-ID: Can't seem to find any way of controlling vertical alignment on cells except for perhaps making a box inside the cell. I'd really like to just be able to say :v-align :top in the typeset:cell operator. Is that a reasonable request? Erik. From marc.battyani at fractalconcept.com Mon Jun 7 21:53:56 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Mon, 7 Jun 2004 23:53:56 +0200 Subject: [cl-typesetting-devel] v-align typeset:cell References: Message-ID: <05ad01c44cd9$eee62190$0a02a8c0@marcxp> > Can't seem to find any way of controlling vertical alignment on cells > except > for perhaps making a box inside the cell. I'd really like to just be > able to say > :v-align :top in the typeset:cell operator. Is that a reasonable > request? Yes, I added a :v-align initarg to cell: (cell (:v-align :bottom) ...) You can get it from the repository or tarball. Marc From divanov at aha.ru Tue Jun 8 12:20:26 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Tue, 8 Jun 2004 16:20:26 +0400 Subject: [cl-typesetting-devel] Weird code pieces Message-ID: <000001c44d60$1c069890$ef4302c3@digo> Hello, Just grabbed the latest files and have some questions. cl-pdf/defpackage.lisp --------------------------- ... #:font-name #:full-name #:family-name #:weight #:font-bbox #:versiondf #:notice #:encoding-scheme ... What is #:versiondf about? cl-pdf/pdf-base.lisp ----------------------- (defgeneric get-rgb (color) ... (:method ((color vector)) #+lispworks (case (aref color 0) ; convert from (color:make-rgb ...) or other model ((numberp (aref color 0)) (values (aref color 0)(aref color 1)(aref color 2))) ^^^^^^^^^^ (:RGB (values (aref color 1)(aref color 2)(aref color 3))) (:GRAY (values (aref color 1)(aref color 1)(aref color 1)))) #-lispworks (values (aref color 0)(aref color 1)(aref color 2))) What does (numberp ...) inside case mean? -- Sincerely, Dmitri Ivanov lisp.ystok.ru From Bill_Clementson at peoplesoft.com Tue Jun 8 17:22:45 2004 From: Bill_Clementson at peoplesoft.com (Bill_Clementson at peoplesoft.com) Date: Tue, 8 Jun 2004 11:22:45 -0600 Subject: [cl-typesetting-devel] Spaces at beginnings of lines following periods Message-ID: Neat - I didn't know you were using cl-typesetting to typeset your book. For purchasers of the book, will it be possible to get a cl-typesetting electronic version too? - Bill Clementson |---------+--------------------------------------------> | | "Peter Seibel" | | | | | | Sent by: | | | cl-typesetting-devel-bounces at comm| | | on-lisp.net | | | | | | | | | 05/26/2004 02:36 PM | | | | |---------+--------------------------------------------> >----------------------------------------------------------------------------------------------| | | | To: cl-typesetting | | cc: (bcc: Bill Clementson/PeopleSoft) | | Subject: [cl-typesetting-devel] Spaces at beginnings of lines following periods | >----------------------------------------------------------------------------------------------| In my typesetting of my book it seems that whenever I have a line break immediately after a period, the first character of the next line is indented a bit. I.e. it seems like the first character of the next line is in fact a space. I haven't tried to track this down or even reduce it to a simple test case because I'm hoping that someone will just know what the problem is. Any ideas? -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp _______________________________________________ cl-typesetting-devel site list cl-typesetting-devel at common-lisp.net http://common-lisp.net/mailman/listinfo/cl-typesetting-devel From peter at javamonkey.com Wed Jun 9 18:23:28 2004 From: peter at javamonkey.com (Peter Seibel) Date: Wed, 09 Jun 2004 11:23:28 -0700 Subject: [cl-typesetting-devel] Spaces at beginnings of lines following periods In-Reply-To: (Bill Clementson's message of "Tue, 8 Jun 2004 11:22:45 -0600") References: Message-ID: Bill_Clementson at peoplesoft.com writes: > Neat - I didn't know you were using cl-typesetting to typeset your > book. For purchasers of the book, will it be possible to get a > cl-typesetting electronic version too? Well, truth in advertising--*I'm* using cl-typesetting to generate PDFs as I work on the book. I rather doubt that the publisher is going to use cl-typesetting to generate the actual book since their production folks have their own tools that they are familiar with and I'm not a book designer. That said, it wouldn't be crazy to include my "source" version of the book on the CD along with Lisp code to generate HTML and PDFs. More likely is that I'll use the markup software I've written as the topic of an example chapter. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Fri Jun 11 20:52:02 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 11 Jun 2004 22:52:02 +0200 Subject: [cl-typesetting-devel] Weird code pieces References: <000001c44d60$1c069890$ef4302c3@digo> Message-ID: <000001c450ae$1f78ab70$1701a8c0@marcxp> Dmitri Ivanov wrote: > Hello, Hi Dmitri, > Just grabbed the latest files and have some questions. > > cl-pdf/defpackage.lisp > --------------------------- > ... > #:font-name #:full-name #:family-name #:weight #:font-bbox #:versiondf > #:notice #:encoding-scheme > ... > What is #:versiondf about? A typo probably. > cl-pdf/pdf-base.lisp > ----------------------- > (defgeneric get-rgb (color) > ... > (:method ((color vector)) > #+lispworks > (case (aref color 0) ; convert from (color:make-rgb ...) or other model > ((numberp (aref color 0)) (values (aref color 0)(aref color 1)(aref > color 2))) > ^^^^^^^^^^ > (:RGB (values (aref color 1)(aref color 2)(aref color 3))) > (:GRAY (values (aref color 1)(aref color 1)(aref color 1)))) > #-lispworks > (values (aref color 0)(aref color 1)(aref color 2))) > > What does (numberp ...) inside case mean? A bug ;-) Corrected Thanks, Marc [Posting this from an Oslo Internet caf? :)] From marc.battyani at fractalconcept.com Fri Jun 11 20:55:20 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 11 Jun 2004 22:55:20 +0200 Subject: [cl-typesetting-devel] Spaces at beginnings of lines followingperiods References: Message-ID: <000101c450ae$21e824d0$1701a8c0@marcxp> Peter Seibel wrote: > In my typesetting of my book it seems that whenever I have a line > break immediately after a period, the first character of the next line > is indented a bit. I.e. it seems like the first character of the next > line is in fact a space. I haven't tried to track this down or even > reduce it to a simple test case because I'm hoping that someone will > just know what the problem is. Any ideas? I will try to look at this. I'm almost on holydays for 4 days in Oslo for the Lisp workshop :) Marc [Posting this from an Oslo Internet caf? :)] From marc.battyani at fractalconcept.com Fri Jun 11 20:58:16 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 11 Jun 2004 22:58:16 +0200 Subject: [cl-typesetting-devel] Spaces at beginnings of lines followingperiods References: Message-ID: <000201c450ae$22b1dd70$1701a8c0@marcxp> Peter Seibel > That said, it wouldn't be crazy to include my "source" version of the > book on the CD along with Lisp code to generate HTML and PDFs. More > likely is that I'll use the markup software I've written as the topic > of an example chapter. Well any Lisp Book needs some recursive level isn't it ;-) Marc [Posting this from an Oslo Internet caf? :)] From marc.battyani at fractalconcept.com Sun Jun 13 08:30:18 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sun, 13 Jun 2004 10:30:18 +0200 Subject: [cl-typesetting-devel] Spaces at beginnings of lines followingperiods References: Message-ID: <000001c4513d$a000fa10$bf07749c@marcxp> Peter Seibel wrote: > In my typesetting of my book it seems that whenever I have a line > break immediately after a period, the first character of the next line > is indented a bit. I.e. it seems like the first character of the next > line is in fact a space. I haven't tried to track this down or even > reduce it to a simple test case because I'm hoping that someone will > just know what the problem is. Any ideas? Corrected. The extra spacing added after punctuation marks was not trimmable. Marc (from the Oslo workshop :) From peter at javamonkey.com Mon Jun 14 03:29:52 2004 From: peter at javamonkey.com (Peter Seibel) Date: Sun, 13 Jun 2004 20:29:52 -0700 Subject: [cl-typesetting-devel] Spaces at beginnings of lines followingperiods In-Reply-To: <000001c4513d$a000fa10$bf07749c@marcxp> (Marc Battyani's message of "Sun, 13 Jun 2004 10:30:18 +0200") References: <000001c4513d$a000fa10$bf07749c@marcxp> Message-ID: "Marc Battyani" writes: > Peter Seibel wrote: > >> In my typesetting of my book it seems that whenever I have a line >> break immediately after a period, the first character of the next line >> is indented a bit. I.e. it seems like the first character of the next >> line is in fact a space. I haven't tried to track this down or even >> reduce it to a simple test case because I'm hoping that someone will >> just know what the problem is. Any ideas? > > Corrected. > The extra spacing added after punctuation marks was not trimmable. Cool. Have fun in Oslo. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From divanov at aha.ru Mon Jun 14 09:13:27 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Mon, 14 Jun 2004 13:13:27 +0400 Subject: [cl-typesetting-devel] indirect-object with null content, e.g. outline Message-ID: <000101c451ef$fbbb5b90$6b4302c3@digo> Hello, Consider generating PDF without an outline. It seems that we cannot avoid creating the corresponding top-level indirect object, numbering it, and pushing into the cross-reference section. Because its content slot is null, we've got the following printout: 4 0 obj NILendobj I suggest the following amendment to the method on write-object (see pdf.lisp): (defmethod write-object ((obj indirect-object) &optional root-level) (if root-level (progn (vector-push-extend (format nil "~10,'0d ~5,'0d n " (file-position *pdf-stream*)(gen-number obj)) *xrefs*) (format *pdf-stream* "~d ~d obj~%" (obj-number obj)(gen-number obj)) (when (content obj) (write-object (content obj))) ; skip null content (write-string "endobj" *pdf-stream*) (write-char #\Newline *pdf-stream*)) (format *pdf-stream* "~d ~d R" (obj-number obj)(gen-number obj)))) Another solution could be providing an additional method for nulls, which does nothing: (defmethod write-object ((obj null) &optional root-level) (declare (ignorable obj root-level))) but it would be better reserved for something like printing the PDF "null" object. -- Sincerely, Dmitri Ivanov lisp.ystok.ru From divanov at aha.ru Mon Jun 14 18:38:30 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Mon, 14 Jun 2004 22:38:30 +0400 Subject: [cl-typesetting-devel] PDF document information dictionary - creator vs. producer Message-ID: <000201c45246$c2372a00$6b4302c3@digo> Hello, IMHO, "cl-pdf version x.x.x" should be specified with the "/Producer" key, not with "/Creator". According my understanding of the PDF Reference, "/Creator" is where the name of a top-level application using cl-pdf should be placed. Below is the patch. (defmethod initialize-instance :after ((doc document) &rest init-options &key empty creator author title subject keywords &allow-other-keys) (declare (ignore init-options)) (unless empty (let ((*document* doc)) (setf (objects doc) (make-array 10 :fill-pointer 0 :adjustable t)) (setf (catalog doc) (make-instance 'indirect-object)) (setf (docinfo doc) (make-instance 'indirect-object)) (setf (root-page doc) (make-instance 'page-node)) (setf (outline-root doc)(make-instance 'outline)) (setf (content (catalog doc)) (make-instance 'dictionary :dict-values `(("/Type" . "/Catalog") ("/Pages" . ,(root-page doc))))) (setf (content (docinfo doc)) (make-instance 'dictionary :dict-values `(("/Producer" . ,(format nil "(cl-pdf version ~A)" *version*)) ,@(when creator `(("/Creator" . ,(pdf-string creator)))) ,@(when author `(("/Author" . ,(pdf-string author)))) ,@(when title `(("/Title" . ,(pdf-string title)))) ,@(when subject `(("/Subject" . ,(pdf-string subject)))) ,@(when keywords `(("/Keywords" . ,(pdf-string keywords)))) ("/CreationDate" . ,(multiple-value-bind (second minute hour date month year) (get-decoded-time) (format nil "(D:~D~2,'0D~2,'0D~2,'0D~2,'0D~2,'0D)" year month date hour minute second))))))))) -- Sincerely, Dmitri Ivanov lisp.ystok.ru From peter at javamonkey.com Wed Jun 16 22:03:22 2004 From: peter at javamonkey.com (Peter Seibel) Date: Wed, 16 Jun 2004 15:03:22 -0700 Subject: [cl-typesetting-devel] Spaces at beginnings of lines followingperiods In-Reply-To: <000001c4513d$a000fa10$bf07749c@marcxp> (Marc Battyani's message of "Sun, 13 Jun 2004 10:30:18 +0200") References: <000001c4513d$a000fa10$bf07749c@marcxp> Message-ID: "Marc Battyani" writes: > Peter Seibel wrote: > >> In my typesetting of my book it seems that whenever I have a line >> break immediately after a period, the first character of the next line >> is indented a bit. I.e. it seems like the first character of the next >> line is in fact a space. I haven't tried to track this down or even >> reduce it to a simple test case because I'm hoping that someone will >> just know what the problem is. Any ideas? > > Corrected. > The extra spacing added after punctuation marks was not trimmable. So I'm pretty certain I've got the latest code loaded but I still seem to be seeing the same problem on lines following a colon, semicolon, or comma. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Wed Jun 16 22:26:53 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 17 Jun 2004 00:26:53 +0200 Subject: [cl-typesetting-devel] Spaces at beginnings of linesfollowingperiods References: <000001c4513d$a000fa10$bf07749c@marcxp> Message-ID: <074d01c453f1$080d2740$0a02a8c0@marcxp> Peter Seibel wrote: > "Marc Battyani" writes: > > > Peter Seibel wrote: > > > >> In my typesetting of my book it seems that whenever I have a line > >> break immediately after a period, the first character of the next line > >> is indented a bit. I.e. it seems like the first character of the next > >> line is in fact a space. I haven't tried to track this down or even > >> reduce it to a simple test case because I'm hoping that someone will > >> just know what the problem is. Any ideas? > > > > Corrected. > > The extra spacing added after punctuation marks was not trimmable. > > So I'm pretty certain I've got the latest code loaded but I still seem > to be seeing the same problem on lines following a colon, semicolon, > or comma. I've not commited the changes to the repository yet. I've also added Dmitri's fixes as well but I always want to check all that the test examples still work before I publish the changes. I will do that tomorow morning but you can change the following function with this version if you want to check that it fixes the problem. (defun make-punctuation-space-box (char) (let ((width (* (pdf:get-char-width char *font* *font-size*) *text-x-scale*)) (space-params (cdr (assoc char *punctuation-marks-extra-spacing-ratios* :test #'char=)))) (when space-params (destructuring-bind (w max-exp exp max-compr compr) space-params (make-instance 'white-char-box :dx (* width w) :trimmable-p t :max-expansion (* width max-exp) :expansibility (* width exp) :max-compression (* width max-compr) :compressibility (* width compr)))))) Marc From marc.battyani at fractalconcept.com Thu Jun 17 18:57:04 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 17 Jun 2004 20:57:04 +0200 Subject: [cl-typesetting-devel] Repository update References: <000001c4513d$a000fa10$bf07749c@marcxp> <074d01c453f1$080d2740$0a02a8c0@marcxp> Message-ID: <0af701c4549c$e22407e0$0a02a8c0@marcxp> I've commited the latest fixes to the cl-pdf and cl-typesetting repositories and tarballs. Rev 51:(cl-typesetting) Made punctation spaces trimmable Rev 50:(cl-pdf) Added a creator argument to document Fixed empty objects [Thanks to Dmitri Ivanov] I followed Dmitri's suggestion here to add a creator argument but I concatenate the cl-pdf version to the creator name instead of putting it in the producer field. (which is more for converters like distiller IMO) Now it will be like apache so you will have a creator field like "application foo (cl-pdf 2.10)" Marc From marc.battyani at fractalconcept.com Thu Jun 17 19:18:06 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 17 Jun 2004 21:18:06 +0200 Subject: [cl-typesetting-devel] Repository update References: <000001c4513d$a000fa10$bf07749c@marcxp><074d01c453f1$080d2740$0a02a8c0@marcxp> <0af701c4549c$e22407e0$0a02a8c0@marcxp> Message-ID: <0b1401c4549f$d26e8c50$0a02a8c0@marcxp> I wrote: > I've commited the latest fixes to the cl-pdf and cl-typesetting repositories > and tarballs. > > Rev 51:(cl-typesetting) > Made punctation spaces trimmable > > Rev 50:(cl-pdf) > Added a creator argument to document > Fixed empty objects > [Thanks to Dmitri Ivanov] > > I followed Dmitri's suggestion here to add a creator argument but I > concatenate the cl-pdf version to the creator name instead of putting it in > the producer field. (which is more for converters like distiller IMO) > Now it will be like apache so you will have a creator field like > "application foo (cl-pdf 2.10)" Oops, I forgot: Rev 52:(cl-pdf) Small fixes [Thanks to Dmitri Ivanov] Marc From marc.battyani at fractalconcept.com Sat Jun 19 20:37:50 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sat, 19 Jun 2004 22:37:50 +0200 Subject: [cl-typesetting-devel] Rewriting of the tables splitting Message-ID: <04d501c4563d$4a575e10$0a02a8c0@marcxp> Rev 53 has been commited to the repository and tarball: Rewriting of the tables splitting: -merging of splitted-multi-page-table into table -added a splitted-table -removal of multi-page-row -v-split is for v-mode boxes only -fit-lines replaces v-split for text-content I finally found some time to work on the splitting of the tables. :) Please reports bugs while it's still fresh. Marc From peter at javamonkey.com Sun Jun 20 04:37:02 2004 From: peter at javamonkey.com (Peter Seibel) Date: Sat, 19 Jun 2004 21:37:02 -0700 Subject: [cl-typesetting-devel] Rewriting of the tables splitting In-Reply-To: <04d501c4563d$4a575e10$0a02a8c0@marcxp> (Marc Battyani's message of "Sat, 19 Jun 2004 22:37:50 +0200") References: <04d501c4563d$4a575e10$0a02a8c0@marcxp> Message-ID: "Marc Battyani" writes: > Rev 53 has been commited to the repository and tarball: > > Rewriting of the tables splitting: > -merging of splitted-multi-page-table into table > -added a splitted-table FWIW, "splitted" is gramatically incorrect. Unfortunately the adjectival form, "split", is also a verb. I haven't looked at where that name is used to see whether that would be confusing or not. -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From marc.battyani at fractalconcept.com Sun Jun 20 07:19:15 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sun, 20 Jun 2004 09:19:15 +0200 Subject: [cl-typesetting-devel] Rewriting of the tables splitting References: <04d501c4563d$4a575e10$0a02a8c0@marcxp> Message-ID: <050201c45696$e7de3880$0a02a8c0@marcxp> "Peter Seibel" wrote: > "Marc Battyani" writes: > > > Rev 53 has been commited to the repository and tarball: > > > > Rewriting of the tables splitting: > > -merging of splitted-multi-page-table into table > > -added a splitted-table > > FWIW, "splitted" is gramatically incorrect. Unfortunately the > adjectival form, "split", is also a verb. I haven't looked at where > that name is used to see whether that would be confusing or not. OK I will correct this. Is "splittable" ok though ? Marc From marc.battyani at fractalconcept.com Sun Jun 20 09:43:26 2004 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sun, 20 Jun 2004 11:43:26 +0200 Subject: [cl-typesetting-devel] Repository update (rev 54) References: <000001c4513d$a000fa10$bf07749c@marcxp><074d01c453f1$080d2740$0a02a8c0@marcxp> <0af701c4549c$e22407e0$0a02a8c0@marcxp> Message-ID: <05de01c456ab$099bfa70$0a02a8c0@marcxp> The repository and tarball have been updated: Rev 54: Replaced splitted-table by split-table to be compliant with English. Marc From peter at javamonkey.com Sun Jun 20 17:51:58 2004 From: peter at javamonkey.com (Peter Seibel) Date: Sun, 20 Jun 2004 10:51:58 -0700 Subject: [cl-typesetting-devel] Rewriting of the tables splitting In-Reply-To: <050201c45696$e7de3880$0a02a8c0@marcxp> (Marc Battyani's message of "Sun, 20 Jun 2004 09:19:15 +0200") References: <04d501c4563d$4a575e10$0a02a8c0@marcxp> <050201c45696$e7de3880$0a02a8c0@marcxp> Message-ID: "Marc Battyani" writes: > "Peter Seibel" wrote: > >> "Marc Battyani" writes: >> >> > Rev 53 has been commited to the repository and tarball: >> > >> > Rewriting of the tables splitting: >> > -merging of splitted-multi-page-table into table >> > -added a splitted-table >> >> FWIW, "splitted" is gramatically incorrect. Unfortunately the >> adjectival form, "split", is also a verb. I haven't looked at where >> that name is used to see whether that would be confusing or not. > > OK I will correct this. Is "splittable" ok though ? Yes, assuming you mean "capable of being split". -Peter -- Peter Seibel peter at javamonkey.com Lisp is the red pill. -- John Fraser, comp.lang.lisp From divanov at aha.ru Thu Jun 24 07:45:13 2004 From: divanov at aha.ru (Dmitri Ivanov) Date: Thu, 24 Jun 2004 11:45:13 +0400 Subject: [cl-typesetting-devel] Rewriting of the tables splitting References: <04d501c4563d$4a575e10$0a02a8c0@marcxp> Message-ID: <000101c459bf$64a188b0$8a5702c3@digo> Hello Marc, | Rev 53 has been commited to the repository and tarball: | | Rewriting of the tables splitting: | -merging of splitted-multi-page-table into table | -added a splitted-table | -removal of multi-page-row | -v-split is for v-mode boxes only | -fit-lines replaces v-split for text-content | | I finally found some time to work on the splitting of the tables. :) | Please reports bugs while it's still fresh. Works fine except h-align. First, the h-align parameter seems to miss from the table macro. Second, even after the first was corrected, :h-align :center does not work for the entire table. Another fix is below. ======= boxes.lisp ========================== ;;;*** Warning in (METHOD TYPESET::V-SPLIT (T T T)): TYPESET::BOX assumed special According my understanding, it should be: (defgeneric v-split ((box v-mode-mixin) dx dy) ;;; Split a v-mode box vertically into two parts ;; Args: dx - area width, dy - area height ;; Values: box-fitted, box-left, dy-left (:method (box dx dy) ; <- typo (declare (ignore dx)) (if (> (dy box) dy) (values nil box dy) (values box nil (- dy (dy box)))))) It would be nice having other compiler warning eliminated from throughout the code :-) -- Sincerely, Dmitri Ivanov lisp.ystok.ru