From peter at gigamonkeys.com Thu Jul 20 00:48:20 2006 From: peter at gigamonkeys.com (Peter Seibel) Date: Wed, 19 Jul 2006 17:48:20 -0700 Subject: [cl-typesetting-devel] How to make some text flush left and some flush right? Message-ID: Suppose I want to make a header that has a chapter name on the left and a page number on the right like this: +--------------------------------------------------------------+ | Chapter One p. 1 | | | | Normal text here blah blah blah. The quick brown fox | | jumps over the lazy dog ... | | | In the past I've built a table but that requires knowing the width of the page and computing the width of various pieces of text. It seems like there ought to be a simple way to say, make a box containing "Chapter One" that is sized to it's natural size, another box containing nothing that expands to fill available space, and a third containing "p. 1", also sized to it's natural size and then lay those three boxes out in a horizontal line to get the effect I want. Is there any easy way to do that? -Peter -- Peter Seibel * peter at gigamonkeys.com Gigamonkeys Consulting * http://www.gigamonkeys.com/ Practical Common Lisp * http://www.gigamonkeys.com/book/ From divanov at aha.ru Thu Jul 20 05:35:43 2006 From: divanov at aha.ru (Dmitriy Ivanov) Date: Thu, 20 Jul 2006 09:35:43 +0400 Subject: [cl-typesetting-devel] How to make some text flush left and someflush right? References: Message-ID: <000001c6abbe$5f7580f0$8100a8c0@digo> Hello Peter, | Suppose I want to make a header that has a chapter name on the left | and a page number on the right like this: | | +--------------------------------------------------------------+ |> Chapter One p. 1 | | | | |> Normal text here blah blah blah. The quick brown fox | |> jumps over the lazy dog ... | | | | | | In the past I've built a table but that requires knowing the width of | the page and computing the width of various pieces of text. It seems | like there ought to be a simple way to say, make a box containing | "Chapter One" that is sized to it's natural size, another box | containing nothing that expands to fill available space, and a third | containing "p. 1", also sized to it's natural size and then lay those | three boxes out in a horizontal line to get the effect I want. Is | there any easy way to do that? I would suggest using a function as the header argument of draw-pages. Here is an excerpt specifying the footer in such a way. (defun multi-page (&optional (file (lw:current-pathname "multi-page.pdf")) &aux content (margins '(72 72 72 50))) (with-document () (let* ((print-stamp (multiple-value-bind (second minute hour date month year) (get-decoded-time) (format nil "Printed on ~4D-~2,'0D-~2,'0D ~2,'0D:~2,'0D" year month date hour minute))) (header (typeset::compile-text () (typeset::paragraph (:h-align :centered :font "Helvetica-BoldOblique" :font-size 12) "Multi-page example document") (typeset:hrule :dy 1/2))) (footer (lambda (pdf:*page*) (typeset::compile-text (:font "Helvetica" :font-size 10) (typeset:hrule :dy 1/2) (typeset::hbox (:align :center :adjustable-p t) (typeset::verbatim print-stamp) :hfill (typeset::verbatim (format nil "Page ~d" pdf:*page-number*)))))) ) (setq content (typeset:compile-text () (typeset:paragraph (:font "Helvetica-Bold" :font-size 16 :top-margin 20) "1. First paragraph group") (typeset:hrule :dy 2) (dotimes (i 40) (typeset:paragraph (:font "Helvetica" :font-size (+ 6 (random 10))) (verbatim (format nil "1.~d. " (1+ i))) (dotimes (j (1+ (random 5))) (typeset:put-string "The quick brown fox jumps over the lazy dog. ")))))) (draw-pages content :margins margins :header header :footer footer :break :after) (pdf:write-document file)))) -- Sincerely, Dmitriy Ivanov lisp.ystok.ru From peter at gigamonkeys.com Thu Jul 20 16:02:39 2006 From: peter at gigamonkeys.com (Peter Seibel) Date: Thu, 20 Jul 2006 09:02:39 -0700 Subject: [cl-typesetting-devel] How to make some text flush left and someflush right? In-Reply-To: <000001c6abbe$5f7580f0$8100a8c0@digo> References: <000001c6abbe$5f7580f0$8100a8c0@digo> Message-ID: <961B9143-2EFA-4BAF-AE00-19F475C1F8E3@gigamonkeys.com> On Jul 19, 2006, at 10:35 PM, Dmitriy Ivanov wrote: > Hello Peter, > > | Suppose I want to make a header that has a chapter name on the left > | and a page number on the right like this: > | > | +--------------------------------------------------------------+ > |> Chapter One p. 1 | > | | | > |> Normal text here blah blah blah. The quick brown fox | > |> jumps over the lazy dog ... | > | | | > | > | In the past I've built a table but that requires knowing the > width of > | the page and computing the width of various pieces of text. It seems > | like there ought to be a simple way to say, make a box containing > | "Chapter One" that is sized to it's natural size, another box > | containing nothing that expands to fill available space, and a third > | containing "p. 1", also sized to it's natural size and then lay > those > | three boxes out in a horizontal line to get the effect I want. Is > | there any easy way to do that? > > I would suggest using a function as the header argument of draw- > pages. Here > is an excerpt specifying the footer in such a way. So using a function is what allows the header to differ a bit each time (i.e. the different page number) but isn't necessary for the layout part--for that I just needed :hfill which I didn't know about. However now I have a new puzzle. Here's my call to draw-pages: (draw-pages content :size :Letter :margins '(72 72 72 72) ; left top right bottom :header-top 36 :footer-bottom 36 :header (compile-text (:font "Times-Italic" :font-size 10) (hbox (:align :center :adjustable-p t) (put-string "Header") :hfill (put-string "Page number"))) :footer (compile-text () (paragraph (:h-align :left :font "Times-Italic" :font-size 10) (put-string "Footer"))))) This works fine except there's a lot of spacing between the letters in "Header" and "Page number" but not between the characters of "Footer". I assume that's due to some difference between the hbox used in the header and the paragraph used in the footer, but how do I get rid of the weird spacing. -Peter -- Peter Seibel * peter at gigamonkeys.com Gigamonkeys Consulting * http://www.gigamonkeys.com/ Practical Common Lisp * http://www.gigamonkeys.com/book/ From marc.battyani at fractalconcept.com Thu Jul 20 17:59:34 2006 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 20 Jul 2006 19:59:34 +0200 Subject: [cl-typesetting-devel] How to make some text flush left andsomeflush right? References: <000001c6abbe$5f7580f0$8100a8c0@digo> <961B9143-2EFA-4BAF-AE00-19F475C1F8E3@gigamonkeys.com> Message-ID: <0adb01c6ac26$42749870$1402a8c0@marcx2> "Peter Seibel" wrote: > On Jul 19, 2006, at 10:35 PM, Dmitriy Ivanov wrote: > > So using a function is what allows the header to differ a bit each time > (i.e. the different page number) but isn't necessary for the layout > part--for that I just needed :hfill which I didn't know about. However > now I have a new puzzle. Here's my call to draw-pages: > > (draw-pages content > :size :Letter > :margins '(72 72 72 72) ; left top right bottom > :header-top 36 > :footer-bottom 36 > :header (compile-text (:font "Times-Italic" :font-size 10) > (hbox (:align :center :adjustable-p t) > (put-string "Header") > :hfill > (put-string "Page number"))) > :footer (compile-text () > (paragraph > (:h-align :left :font "Times-Italic" :font-size 10) > (put-string "Footer"))))) > > This works fine except there's a lot of spacing between the letters in > "Header" and "Page number" but not between the characters of "Footer". I > assume that's due to some difference between the hbox used in the header > and the paragraph used in the footer, but how do I get rid of the weird > spacing. hbox is not normally not meant to be used at a user level so you should use a paragraph in the header too. You probably want to use :fill as h-align value in addition to the :hfill where you want the separation. ;; untested (paragraph (:h-align :fill) (put-string "Header") :hfill (put-string "Page number"))) Marc From peter at gigamonkeys.com Thu Jul 20 18:09:43 2006 From: peter at gigamonkeys.com (Peter Seibel) Date: Thu, 20 Jul 2006 11:09:43 -0700 Subject: [cl-typesetting-devel] How to make some text flush left andsomeflush right? In-Reply-To: <0adb01c6ac26$42749870$1402a8c0@marcx2> References: <000001c6abbe$5f7580f0$8100a8c0@digo> <961B9143-2EFA-4BAF-AE00-19F475C1F8E3@gigamonkeys.com> <0adb01c6ac26$42749870$1402a8c0@marcx2> Message-ID: On Jul 20, 2006, at 10:59 AM, Marc Battyani wrote: > hbox is not normally not meant to be used at a user level so you > should use a paragraph in the header too. > You probably want to use :fill as h-align value in addition to > the :hfill where you want the separation. Okay, almost there. Now I've got this: (draw-pages content :size :Letter :margins '(72 72 72 72) ; left top right bottom :header-top 36 :footer-bottom 36 :header #'(lambda (page) (declare (ignore page)) (compile-text (:font "Times-Italic" :font-size 10) (paragraph (:h-align :fill) (put-string (get-contextual-variable 'chapter-name)) :hfill (put-string (format nil "Page ~d of ~d" pdf:*page-number* (find-ref-point-page-number :the-end)))))) :footer (compile-text (:font "Times-Italic" :font-size 10) (paragraph (:h-align :fill) (put-string (format nil "Copyright ~c ~a" +copyright+ *copyright*)) :hfill (put-string (date-string))))) The only problem is that there are weird bits of inter-string space. (See attached PDF.) For instance the "Gigamonkeys Markup" on the left side of the header is rendered like "Gi ga monkeys Markup" and the date in the footer has an inordinate amount of space between the month and the year. Advice? -Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: docs.pdf Type: application/pdf Size: 12153 bytes Desc: not available URL: -------------- next part -------------- -- Peter Seibel * peter at gigamonkeys.com Gigamonkeys Consulting * http://www.gigamonkeys.com/ Practical Common Lisp * http://www.gigamonkeys.com/book/ From peter at gigamonkeys.com Thu Jul 20 18:23:12 2006 From: peter at gigamonkeys.com (Peter Seibel) Date: Thu, 20 Jul 2006 11:23:12 -0700 Subject: [cl-typesetting-devel] How to make some text flush left andsomeflush right? In-Reply-To: References: <000001c6abbe$5f7580f0$8100a8c0@digo> <961B9143-2EFA-4BAF-AE00-19F475C1F8E3@gigamonkeys.com> <0adb01c6ac26$42749870$1402a8c0@marcx2> Message-ID: On Jul 20, 2006, at 11:09 AM, Peter Seibel wrote: > > On Jul 20, 2006, at 10:59 AM, Marc Battyani wrote: > >> hbox is not normally not meant to be used at a user level so you >> should use a paragraph in the header too. >> You probably want to use :fill as h-align value in addition to >> the :hfill where you want the separation. > > Okay, almost there. Now I've got this: > > (draw-pages content > :size :Letter > :margins '(72 72 72 72) ; left top right bottom > :header-top 36 > :footer-bottom 36 > :header #'(lambda (page) > (declare (ignore page)) > (compile-text (:font "Times-Italic" :font-size 10) > (paragraph (:h-align :fill) > (put-string (get-contextual-variable 'chapter-name)) > :hfill > (put-string (format nil "Page ~d of ~d" > pdf:*page-number* > (find-ref-point-page-number :the-end)))))) > :footer (compile-text (:font "Times-Italic" :font-size 10) > (paragraph (:h-align :fill) > (put-string > (format nil "Copyright ~c ~a" +copyright+ *copyright*)) > :hfill > (put-string (date-string))))) > > The only problem is that there are weird bits of inter-string > space. (See attached PDF.) For instance the "Gigamonkeys Markup" on > the left side of the header is rendered like "Gi ga monkeys Markup" > and the date in the footer has an inordinate amount of space > between the month and the year. Advice? If I change the PUT-STRINGs to VERBATIMs then the weird inter-string spacing goes away but the strings that I was hoping to have flush right (the page number in the header and the date string in the footer) are about a half-inch in from the right margin. (Though I'm not sure they were exactly flush right even with PUT-STRING.) -Peter -- Peter Seibel * peter at gigamonkeys.com Gigamonkeys Consulting * http://www.gigamonkeys.com/ Practical Common Lisp * http://www.gigamonkeys.com/book/ From marc.battyani at fractalconcept.com Thu Jul 20 18:37:44 2006 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 20 Jul 2006 20:37:44 +0200 Subject: [cl-typesetting-devel] How to make some text flush leftandsomeflush right? References: <000001c6abbe$5f7580f0$8100a8c0@digo><961B9143-2EFA-4BAF-AE00-19F475C1F8E3@gigamonkeys.com><0adb01c6ac26$42749870$1402a8c0@marcx2> Message-ID: <0b4a01c6ac2b$972feef0$1402a8c0@marcx2> "Peter Seibel" wrote: > On Jul 20, 2006, at 10:59 AM, Marc Battyani wrote: > >> hbox is not normally not meant to be used at a user level so you should >> use a paragraph in the header too. >> You probably want to use :fill as h-align value in addition to the >> :hfill where you want the separation. > > Okay, almost there. Now I've got this: > > (draw-pages content > :size :Letter > :margins '(72 72 72 72) ; left top right bottom > :header-top 36 > :footer-bottom 36 > :header #'(lambda (page) > (declare (ignore page)) > (compile-text (:font "Times-Italic" :font-size 10) > (paragraph (:h-align :fill) > (put-string (get-contextual-variable 'chapter-name)) > :hfill > (put-string (format nil "Page ~d of ~d" > pdf:*page-number* > (find-ref-point-page-number :the-end)))))) > :footer (compile-text (:font "Times-Italic" :font-size 10) > (paragraph (:h-align :fill) > (put-string > (format nil "Copyright ~c ~a" +copyright+ *copyright*)) > :hfill > (put-string (date-string))))) > > The only problem is that there are weird bits of inter-string space. (See > attached PDF.) For instance the "Gigamonkeys Markup" on the left side of > the header is rendered like "Gi ga monkeys Markup" and the date in the > footer has an inordinate amount of space between the month and the year. > Advice? Weird. Maybe put 3 :hfill instead of just one ;-) Also can you disable the stream compression so that I can look inside the pdf. Marc From peter at gigamonkeys.com Thu Jul 20 18:43:32 2006 From: peter at gigamonkeys.com (Peter Seibel) Date: Thu, 20 Jul 2006 11:43:32 -0700 Subject: [cl-typesetting-devel] How to make some text flush leftandsomeflush right? In-Reply-To: <0b4a01c6ac2b$972feef0$1402a8c0@marcx2> References: <000001c6abbe$5f7580f0$8100a8c0@digo><961B9143-2EFA-4BAF-AE00-19F475C1F8E3@gigamonkeys.com><0adb01c6ac26$42749870$1402a8c0@marcx2> <0b4a01c6ac2b$972feef0$1402a8c0@marcx2> Message-ID: <42CF691D-1281-4ED9-A58E-1F9F0C5081A2@gigamonkeys.com> On Jul 20, 2006, at 11:37 AM, Marc Battyani wrote: > "Peter Seibel" wrote: >> On Jul 20, 2006, at 10:59 AM, Marc Battyani wrote: >> >>> hbox is not normally not meant to be used at a user level so you >>> should use a paragraph in the header too. >>> You probably want to use :fill as h-align value in addition to >>> the :hfill where you want the separation. >> >> Okay, almost there. Now I've got this: >> >> (draw-pages content >> :size :Letter >> :margins '(72 72 72 72) ; left top right bottom >> :header-top 36 >> :footer-bottom 36 >> :header #'(lambda (page) >> (declare (ignore page)) >> (compile-text (:font "Times-Italic" :font-size 10) >> (paragraph (:h-align :fill) >> (put-string (get-contextual-variable 'chapter-name)) >> :hfill >> (put-string (format nil "Page ~d of ~d" >> pdf:*page-number* >> (find-ref-point-page-number :the-end)))))) >> :footer (compile-text (:font "Times-Italic" :font-size 10) >> (paragraph (:h-align :fill) >> (put-string >> (format nil "Copyright ~c ~a" +copyright+ *copyright*)) >> :hfill >> (put-string (date-string))))) >> >> The only problem is that there are weird bits of inter-string >> space. (See attached PDF.) For instance the "Gigamonkeys Markup" >> on the left side of the header is rendered like "Gi ga monkeys >> Markup" and the date in the footer has an inordinate amount of >> space between the month and the year. Advice? > > Weird. Maybe put 3 :hfill instead of just one ;-) That's a joke, right. > Also can you disable the stream compression so that I can look > inside the pdf. How? -Peter -- Peter Seibel * peter at gigamonkeys.com Gigamonkeys Consulting * http://www.gigamonkeys.com/ Practical Common Lisp * http://www.gigamonkeys.com/book/ From marc.battyani at fractalconcept.com Thu Jul 20 18:50:50 2006 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Thu, 20 Jul 2006 20:50:50 +0200 Subject: [cl-typesetting-devel] How to make some text flush leftandsomeflush right? References: <000001c6abbe$5f7580f0$8100a8c0@digo><961B9143-2EFA-4BAF-AE00-19F475C1F8E3@gigamonkeys.com><0adb01c6ac26$42749870$1402a8c0@marcx2> <0b4a01c6ac2b$972feef0$1402a8c0@marcx2> <42CF691D-1281-4ED9-A58E-1F9F0C5081A2@gigamonkeys.com> Message-ID: <0b6201c6ac2d$6b9af120$1402a8c0@marcx2> "Peter Seibel" wrote: > On Jul 20, 2006, at 11:37 AM, Marc Battyani wrote: > >> "Peter Seibel" wrote: >>> On Jul 20, 2006, at 10:59 AM, Marc Battyani wrote: >> >> Weird. Maybe put 3 :hfill instead of just one ;-) > > That's a joke, right. Yes, but it can be interesting to try anyway as this will artificially increase the expandability of the hfill. >> Also can you disable the stream compression so that I can look inside >> the pdf. > > How? (setf *compress-streams* nil) or something like that. The generated pdf should be readable with emacs after that. Marc From peter at gigamonkeys.com Wed Jul 26 21:19:21 2006 From: peter at gigamonkeys.com (Peter Seibel) Date: Wed, 26 Jul 2006 14:19:21 -0700 Subject: [cl-typesetting-devel] How to make some text flush leftandsomeflush right? In-Reply-To: <0b6201c6ac2d$6b9af120$1402a8c0@marcx2> References: <000001c6abbe$5f7580f0$8100a8c0@digo><961B9143-2EFA-4BAF-AE00-19F475C1F8E3@gigamonkeys.com><0adb01c6ac26$42749870$1402a8c0@marcx2> <0b4a01c6ac2b$972feef0$1402a8c0@marcx2> <42CF691D-1281-4ED9-A58E-1F9F0C5081A2@gigamonkeys.com> <0b6201c6ac2d$6b9af120$1402a8c0@marcx2> Message-ID: <2D8978AF-3937-4F32-90C6-8E36817B1686@gigamonkeys.com> On Jul 20, 2006, at 11:50 AM, Marc Battyani wrote: > "Peter Seibel" wrote: >> On Jul 20, 2006, at 11:37 AM, Marc Battyani wrote: >> >>> "Peter Seibel" wrote: >>>> On Jul 20, 2006, at 10:59 AM, Marc Battyani wrote: >>> >>> Weird. Maybe put 3 :hfill instead of just one ;-) >> >> That's a joke, right. > > Yes, but it can be interesting to try anyway as this will > artificially increase the expandability of the hfill. > >>> Also can you disable the stream compression so that I can look >>> inside the pdf. >> >> How? > > (setf *compress-streams* nil) or something like that. The generated > pdf should be readable with emacs after that. Okay. Attached is a document generated with stream compression turned of. Here's the call to draw-pages: (draw-pages content :size :Letter :margins '(72 72 72 72) ; left top right bottom :header-top 36 :footer-bottom 36 :header #'(lambda (page) (declare (ignore page)) (compile-text (:font "Times-Italic" :font-size 10) (paragraph (:h-align :fill) ;; Not clear whether these should ;; be VERBATIM or PUT-STRING. Get ;; weird spacing with PUT-STRING. (put-string (get-contextual-variable 'chapter-name)) :hfill (put-string (format nil "Page ~d of ~d" pdf:*page-number* (find-ref-point-page-number :the-end)))))) :footer (compile-text (:font "Times-Italic" :font-size 10) (paragraph (:h-align :fill) (put-string (format nil "Copyright ~c ~a" +copyright+ *copyright*)) :hfill (put-string (date-string))))) There are two problems with the output. First, the weird interword spacing I mentioned before. That gets better if I use VERBATIM rather than PUT-STRING but then the stuff that's supposed to be flush right is even more to the left. The other problem, which I just noticed, is that not all the content is rendered. FWIW, the next thing that should appear is a table; dunno if that matters or not. -Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: docs.pdf Type: application/pdf Size: 36257 bytes Desc: not available URL: -------------- next part -------------- -- Peter Seibel * peter at gigamonkeys.com Gigamonkeys Consulting * http://www.gigamonkeys.com/ Practical Common Lisp * http://www.gigamonkeys.com/book/ From peter at gigamonkeys.com Thu Jul 27 22:12:23 2006 From: peter at gigamonkeys.com (Peter Seibel) Date: Thu, 27 Jul 2006 15:12:23 -0700 Subject: [cl-typesetting-devel] How to make some text flush leftandsomeflush right? In-Reply-To: <2D8978AF-3937-4F32-90C6-8E36817B1686@gigamonkeys.com> References: <000001c6abbe$5f7580f0$8100a8c0@digo><961B9143-2EFA-4BAF-AE00-19F475C1F8E3@gigamonkeys.com><0adb01c6ac26$42749870$1402a8c0@marcx2> <0b4a01c6ac2b$972feef0$1402a8c0@marcx2> <42CF691D-1281-4ED9-A58E-1F9F0C5081A2@gigamonkeys.com> <0b6201c6ac2d$6b9af120$1402a8c0@marcx2> <2D8978AF-3937-4F32-90C6-8E36817B1686@gigamonkeys.com> Message-ID: On Jul 26, 2006, at 2:19 PM, Peter Seibel wrote: > There are two problems with the output. > The other problem, which I just noticed, is that not all the > content is rendered. FWIW, the next thing that should appear is a > table; dunno if that matters or not. So, I'm seeing the same problem even without tables involved. Here's a stand-alone test that seems to show that draw-pages has problems emitting the last page. Attached is the PDF I get. -Peter (defparameter *text* '("Lorem ipsum mei ipsum senserit evertitur no. Vel noluisse adversarium ea, mei dicta evertitur te. Ipsum doctus interpretaris pro cu, graeco vocent te ius. Ad dicat accusam vim." "Velit quaestio eu pro. Te fierent principes voluptaria qui. Ad quis puto volutpat duo, vis vitae iisque sanctus id. Nam ne minimum qualisque, ius eu reque soleat nominavi. Vis ne periculis argumentum, ex usu placerat atomorum, ne nec modo accusamus." "Est et invenire eloquentiam concludaturque, mollis aeterno tritani ad qui, te mea graeci mandamus consulatu. Ad idque tollit his. Qui ad explicari argumentum, quis inani at eum, vis posse probatus accusamus an. Ex ceteros splendide appellantur eos. Debitis scriptorem vel ad, nam eu amet urbanitas vulputate. Ad per sensibus hendrerit liberavisse, iusto laudem dolorem eam at." "Vix deserunt prodesset ut, exerci possit et eos. Eu quod essent legendos eos, ad erant iuvaret dolorem quo. Adipiscing necessitatibus ut vix, eos eius mundi tempor ea, sea ei mandamus senserit. In est cibo malis patrioque." "Nec liber inermis ceteros ut, nam viris accusamus cotidieque ad. Quo cu utroque fuisset deserunt, ut mea laudem pertinax neglegentur. Ut sanctus consetetur percipitur qui, vim munere petentium at. Eu vim tollit aliquyam, dolor explicari no est." "Nec ad ceteros principes accommodare, vim ut populo dolorum, in quo audire ponderum. Ne dolorem conceptam sed. Qualisque moderatius consectetuer at vel, commodo nominavi repudiandae ea has. Quis prima his an. Eum ea omittam inciderint. Ei nam eius meis." "Has pertinax oportere cu. Id eos mutat dicit appareat. Natum propriae ei duo. Magna tollit ne eos, vim et natum reprehendunt, laoreet meliore aliquando no nam." "Pro ut commune theophrastus, vel an stet autem pertinax. Vero errem consul per ex, id paulo iisque consulatu his, vidit scripserit scribentur cu his. Ad sea audire mediocrem, deserunt persequeris at vis, eum at velit atomorum. At vim alia errem, te quando possit mea, sit temporibus mediocritatem necessitatibus ad. Sale dolor postulant et est, ad his semper appetere principes. Sea delenit accumsan ne, eum ne stet saperet euripidis." "Ad rebum doming omittantur nec. Usu rebum scriptorem ea, pro no albucius intellegam. Cum te posse fierent interpretaris, an vis iisque salutatus. Ei integre mediocrem sea, sea malis debitis et. Possim alienum no pri, vel et alii conceptam, et bonorum posidonium vim. Errem dolores in vim, pri appellantur intellegebat an." "No pro saepe impedit interpretaris, nostrud inimicus persequeris eu ius. Laudem voluptatum vix ei, puto lorem possim cu pro. Eum inani nostrum te, nec an noster scaevola. Mea labore omittam cu." "Tota tempor salutatus ad has, ea explicari comprehensam vis, wisi mazim suscipiantur eu sit. Id est illud consectetuer, id corpora mediocrem laboramus vim, dolores omnesque ex vim. Nusquam consulatu sententiae ex sea, eum scripta impedit adipisci ei. Vix aperiri oporteat at, vim audiam incorrupte eu." "Gloriatur mediocritatem usu ne, his utroque efficiantur in, in per nulla primis. Laudem integre te qui, nibh signiferumque in sea. Et meis quaeque disputationi ius, detraxit moderatius per in. Vel et etiam possit accommodare, erat adolescens ei nec, vel eu diam mucius placerat." "Fierent epicurei vivendum cu pro, nam cu adhuc fabellas. Ferri feugiat eam no. Ne vim appareat volutpat, eos ei solum quaestio philosophia. Vis quot quidam nominati an. Est no eruditi reprimique, eu ius option nostrum, qui postea aliquip id." "Ad dolor possim cum. No vide eloquentiam quo, mei cibo homero et. Te dolore feugiat qui, vim ei modus facer ridens. Viderer petentium mnesarchum nec ex, duo at elitr soluta aliquam. Vide salutandi qualisque eu sit, pro ei mucius hendrerit. Ex duo electram petentium." "At modus aperiam pro, eu solum tempor praesent vix. Ne aliquip invidunt honestatis duo, est minimum salutatus torquatos ne. Facer graeci id qui, in est labitur dissentiunt. Numquam copiosae te sea, prompta docendi offendit te mel. Ius prompta deseruisse complectitur ut, in falli comprehensam usu. Graeco inimicus his ex, illud tollit audire eum ne." "Oportere indoctum sed no. In cum tritani fabulas ullamcorper, lorem soluta posidonium cu vis. No has soluta deserunt. Vim ea melius timeam erroribus, usu ancillae intellegebat id. Mel alia saepe ea." "Eum duis periculis ne, nobis forensibus pri ex. Ne cetero voluptatum qui, qui te quando consul sanctus, sed te unum porro essent. Has magna oratio dicunt ut, at vix saperet labores accumsan. Pro veniam erroribus ei, graeci nusquam in ius." "Est ad equidem offendit, eam sonet ubique eu. Doctus partiendo sit id, no populo malorum inermis est. Duo id semper dolorum. Et velit eripuit quaerendum vel, ut duo puto brute abhorreant, ex voluptatum assueverit usu. Choro scriptorem vim in." "Eligendi recusabo voluptatum ea sea, ne definiebas deterruisset per. Sit eu alia erroribus, ne laoreet accusam vis, mea id malorum sensibus cotidieque. Eos id detracto menandri splendide. Pri ex tale kasd definitiones, duo nemore alienum consequuntur ei." "Aperiri concludaturque has an, in duo fugit persius ceteros, in nam legere melius appetere. Graecis voluptua persequeris vix ei. Ex choro deseruisse comprehensam est, zzril sanctus complectitur sit an, solum animal offendit eu mei. Ferri detracto postulant has no, at mei mutat iisque. Congue decore vel no, est no salutandi mnesarchum." "Erat noster intellegebat eos et, assum timeam ius et, vide offendit maiestatis an per. Ad ius paulo tincidunt, ei inermis efficiendi ius, eu has euismod aliquam. Kasd dignissim eum ut. Sit fabulas scripserit ne. Eu probo graeco dictas eum, cu oratio virtute voluptatibus sea, te pro ceteros fabellas reprimique." "Ne vix timeam apeirian, omnis legere ex eum. Ne ius takimata adipiscing. Cum eu takimata explicari. Vim labitur electram an, vim ad magna albucius inciderint. Ex duo assum nullam, ea mei conceptam inciderint." "Has id quando intellegat definitionem. Ad graeci dissentiunt has. Magna oblique gubergren eum ex. Te eos dolorum praesent, ceteros omnesque eos ut." "Vel et vitae commodo mediocrem, affert iracundia adolescens vim ad, inani saepe labitur no sed. His ne nibh ferri labore, aliquip splendide ex eum. Eos erant vidisse quaeque ei, vis ad tota affert luptatum. Erat scriptorem no his, kasd munere dissentiunt at vis. Sea prodesset vituperata cu. Pro id ignota latine intellegebat, ei sea vitae labore neglegentur, sed scribentur contentiones ea." "At partem commune sea, congue appetere ut mea. Cum ad vocibus posidonium, id mei solet dolore maiorum, porro erant iuvaret mel an. Vero molestiae eam eu. Eum et iriure aliquam. Vim paulo populo cu, ridens viderer omittantur ut pri, sit eu simul mollis. Pro te ipsum facilisis dissentias, omnesque deserunt necessitatibus ex vim." "Per et dicta ocurreret. Id eum cibo dicant omnium, eum delectus delicata deseruisse ne, te his ceteros sensibus. Sea no aeque iracundia voluptatum, ius ei choro singulis. Altera quidam delicata per ex, no ius magna tantas. Ad ius nusquam corrumpit molestiae, oblique saperet facilisi at sea. At has ornatus legimus eloquentiam, mel etiam torquatos ea." "Per tritani facilisis at, mei iusto causae expetenda at. Te tation dolorum mei. Possit menandri ad vis. Est an quas timeam eripuit. Duo et aliquam electram." "Duo paulo insolens ne, vis puto sanctus accommodare in. Dicunt volutpat philosophia per et. In possit percipit nec. Vivendo aliquyam percipitur mel ut. Ea augue partem vis, reque melius ad ius, mutat euismod recusabo vix ei. Sea rebum malis dicit cu, no sed aeterno sanctus, ea has rationibus disputationi." "Usu doctus iuvaret ex, liber consul sed et, no vim habeo saperet deleniti. An usu puto lobortis, pro nulla virtute an, sit homero veritus ut. Id alii tota choro sea, at duo agam quot signiferumque, ut vix sint disputationi definitionem. His ea augue nihil interpretaris. Mei augue dolorem petentium ea, usu deserunt expetendis ea. Cetero tibique nam at. Oportere convenire philosophia vel id, eu commodo ocurreret consequuntur nam." "Pri ei sale etiam, cu usu velit integre. Nostrud nominati ad mel, falli discere appareat eum ex. Wisi mentitum sapientem no duo, modo tation nullam at ius, modus erant eirmod sea ei. Eligendi consulatu rationibus mei ut, ea zzril tritani persius cum. Inani disputationi ut vel, ex eam torquatos quaerendum. Eam unum labore ne, ius ne ceteros percipitur. Duo nullam aliquam ne, et nostrum blandit vel, laudem ponderum pro at." "Sea sumo suscipiantur ei, ei errem laoreet sea. Mea tantas adversarium accommodare ex, at per falli error sanctus. Unum vidit magna et nam. No his omnesque invidunt, reque constituto consetetur at usu. Eam putent temporibus at, sea eu quodsi scaevola, mea aperiam viderer qualisque ne. No sed assum legere." "In vero petentium consequuntur mea, ex graeco convenire voluptatibus per, falli partiendo ne sed. Qui erat quaeque adipisci ne, ex mel quod ornatus civibus, per ei euismod phaedrum. At docendi partiendo vel. Discere necessitatibus an eos. Tation officiis nec ne, noster deseruisse te vel, mea civibus philosophia ea." "Vel id oblique iuvaret mediocrem, ignota laoreet deterruisset ei eum, oportere ullamcorper mel ne. At reque tempor omnium mea, usu an vocent expetenda. Id usu solum cetero integre. Ne brute impetus voluptaria eum, discere oporteat laboramus duo ut. Vim hinc commune temporibus te, inani euismod vituperatoribus ut sit, eius dicta mediocritatem pri ei." "Novum iusto et est, in qui nonumy offendit. Ex error delicatissimi sea. His te amet legimus antiopam, ut his vocent scripta, ea mel quas malorum platonem. Tempor option periculis te." "The End.")) (defun test-draw-pages (file) (with-document () (let ((content (compile-text () (loop for p in *text* do (paragraph (:h-align :left :font "Times-Roman" :font-size 12) (vspace 12) (put-string p)))))) (draw-pages content :size :Letter :margins '(72 72 72 72))) (pdf:write-document file)) (truename file)) -------------- next part -------------- A non-text attachment was scrubbed... Name: test.pdf Type: application/pdf Size: 56107 bytes Desc: not available URL: -------------- next part -------------- -- Peter Seibel * peter at gigamonkeys.com Gigamonkeys Consulting * http://www.gigamonkeys.com/ Practical Common Lisp * http://www.gigamonkeys.com/book/ From marc.battyani at fractalconcept.com Thu Jul 27 22:27:53 2006 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 28 Jul 2006 00:27:53 +0200 Subject: [cl-typesetting-devel] How to make some text flush leftandsomeflush right? References: <000001c6abbe$5f7580f0$8100a8c0@digo><961B9143-2EFA-4BAF-AE00-19F475C1F8E3@gigamonkeys.com><0adb01c6ac26$42749870$1402a8c0@marcx2> <0b4a01c6ac2b$972feef0$1402a8c0@marcx2> <42CF691D-1281-4ED9-A58E-1F9F0C5081A2@gigamonkeys.com> <0b6201c6ac2d$6b9af120$1402a8c0@marcx2> <2D8978AF-3937-4F32-90C6-8E36817B1686@gigamonkeys.com> Message-ID: <0f5401c6b1cb$e7137f90$1402a8c0@marcx2> "Peter Seibel" wrote: > On Jul 26, 2006, at 2:19 PM, Peter Seibel wrote: > >> There are two problems with the output. > >> The other problem, which I just noticed, is that not all the >> content is rendered. FWIW, the next thing that should appear is a >> table; dunno if that matters or not. > > So, I'm seeing the same problem even without tables involved. Here's > a stand-alone test that seems to show that draw-pages has problems > emitting the last page. Attached is the PDF I get. OK I will try to look at that and at your previous email in the plane to Vancouver. (I'm leaving in 6 hours and still packing the luggage) Marc From peter at gigamonkeys.com Thu Jul 27 23:09:33 2006 From: peter at gigamonkeys.com (Peter Seibel) Date: Thu, 27 Jul 2006 16:09:33 -0700 Subject: [cl-typesetting-devel] How to make some text flush leftandsomeflush right? In-Reply-To: <0f5401c6b1cb$e7137f90$1402a8c0@marcx2> References: <000001c6abbe$5f7580f0$8100a8c0@digo><961B9143-2EFA-4BAF-AE00-19F475C1F8E3@gigamonkeys.com><0adb01c6ac26$42749870$1402a8c0@marcx2> <0b4a01c6ac2b$972feef0$1402a8c0@marcx2> <42CF691D-1281-4ED9-A58E-1F9F0C5081A2@gigamonkeys.com> <0b6201c6ac2d$6b9af120$1402a8c0@marcx2> <2D8978AF-3937-4F32-90C6-8E36817B1686@gigamonkeys.com> <0f5401c6b1cb$e7137f90$1402a8c0@marcx2> Message-ID: <2500B532-8E19-4FEB-ACE1-A360043ECDA3@gigamonkeys.com> On Jul 27, 2006, at 3:27 PM, Marc Battyani wrote: > "Peter Seibel" wrote: > >> On Jul 26, 2006, at 2:19 PM, Peter Seibel wrote: >> >>> There are two problems with the output. >> >>> The other problem, which I just noticed, is that not all the >>> content is rendered. FWIW, the next thing that should appear is a >>> table; dunno if that matters or not. >> >> So, I'm seeing the same problem even without tables involved. Here's >> a stand-alone test that seems to show that draw-pages has problems >> emitting the last page. Attached is the PDF I get. > > OK I will try to look at that and at your previous email in the > plane to Vancouver. (I'm leaving in 6 hours and still packing the > luggage) Okay. Here's one more simple test that shows the problem with weird inter-word spacing. (*text* is the same as in the previous email). Attached is what I get. -Peter (defun test-header-&-footer (file) (with-document () (let* ((content (compile-text () (loop for p in *text* do (paragraph (:h-align :left :font "Times-Roman" :font-size 12) (vspace 12) (put-string p))))) (width (* 8.5 72)) (height (* 11 72)) (header-height 36) (footer-height 36) (left 72) (right 72) (top 36) (bottom 36) (x left) (y (- height top)) (content-width (- width left right)) (content-height (- height top bottom)) (main-height (- content-height header-height footer-height))) (loop while (boxes content) do (pdf:with-page (:bounds (vector 0 0 width height)) (pdf:with-saved-state (typeset::stroke (make-filled-vbox content content-width main-height :top) x (- y header-height)) (typeset::stroke (make-filled-vbox (compile-text (:font "Times-Italic" :font-size 10) (paragraph (:h-align :fill) (put-string "Gigamonkeys Transactions Foo") :hfill (put-string (format nil "Page ~d" pdf:*page-number*)))) content-width header-height :top) x y) (typeset::stroke (make-filled-vbox (compile-text (:font "Times-Italic" :font-size 10) (paragraph (:h-align :fill) (put-string (format nil "Copyright ~c ~a" +copyright+ *copyright*)) :hfill (put-string "27 July 2006, 3:58 pm"))) content-width footer-height :bottom) x (+ bottom footer-height)))))) (pdf:write-document file)) (truename file)) -------------- next part -------------- A non-text attachment was scrubbed... Name: header-footer-test.pdf Type: application/pdf Size: 64762 bytes Desc: not available URL: -------------- next part -------------- -- Peter Seibel * peter at gigamonkeys.com Gigamonkeys Consulting * http://www.gigamonkeys.com/ Practical Common Lisp * http://www.gigamonkeys.com/book/ From divanov at aha.ru Sun Jul 30 07:06:07 2006 From: divanov at aha.ru (Dmitriy Ivanov) Date: Sun, 30 Jul 2006 11:06:07 +0400 Subject: [cl-typesetting-devel] How to make some text flushleftandsomeflush right? References: <000001c6abbe$5f7580f0$8100a8c0@digo><961B9143-2EFA-4BAF-AE00-19F475C1F8E3@gigamonkeys.com><0adb01c6ac26$42749870$1402a8c0@marcx2><0b4a01c6ac2b$972feef0$1402a8c0@marcx2><42CF691D-1281-4ED9-A58E-1F9F0C5081A2@gigamonkeys.com><0b6201c6ac2d$6b9af120$1402a8c0@marcx2><2D8978AF-3937-4F32-90C6-8E36817B1686@gigamonkeys.com> Message-ID: <002f01c6b3a6$b3929930$8100a8c0@digo> Hello Peter, | On Jul 26, 2006, at 2:19 PM, Peter Seibel wrote: |> The other problem, which I just noticed, is that not all the |> content is rendered. FWIW, the next thing that should appear is a |> table; dunno if that matters or not. | | (defparameter *text* | '("Lorem ipsum mei ipsum senserit evertitur no. Vel noluisse | adversarium | ea, mei dicta evertitur te. Ipsum doctus interpretaris pro cu, graeco | vocent te ius. Ad dicat accusam vim." |...snip...| | "The End.")) | | (defun test-draw-pages (file) | (with-document () | (let ((content | (compile-text () | (loop for p in *text* do | (paragraph (:h-align :left :font "Times-Roman" :font-size 12) | (vspace 12) | (put-string p)))))) | (draw-pages content :size :Letter :margins '(72 72 72 72))) | (pdf:write-document file)) | (truename file)) To force rendering all the content, you could pass the argument :break :after to draw-pages. -- Sincerely, Dmitriy Ivanov lisp.ystok.ru