From jcm at SDF.ORG Wed Jan 11 23:37:22 2012 From: jcm at SDF.ORG (jcm at SDF.ORG) Date: Wed, 11 Jan 2012 23:37:22 -0000 Subject: [cl-typesetting-devel] Understanding text layout functions Message-ID: I'm trying to draw a title page, with some colored bars and images, and text as well. What is the purpose of in-text-mode and draw-text versus the paragraph function? Why do some strings appear correctly in the pdf when they are in a paragraph, but others need to be inserted with format-string? I have more questions, but I'll start with these. From jcm at SDF.ORG Thu Jan 12 01:31:17 2012 From: jcm at SDF.ORG (jcm at SDF.ORG) Date: Thu, 12 Jan 2012 01:31:17 -0000 Subject: [cl-typesetting-devel] More questions Message-ID: <9cea9b0e625c181695630da964b8bf23.squirrel@wm.sdf.org> 1. What does with-saved-state do? I've tried changing color inside this expression, and expecting it to go back to what it was before after the expression ends. Is this how it works? 2. I tried changing the fill and stroke colors for text on one line, and then a different color on the next line. But all text on the page ends up the last color I use. How can I have different color text? 3. What are the uses for in-text-mode and move-text ? I tried move-text while inside in-text-mode, and it seems to have no effect on the text location. move-to does not either. But vspace does. From jcm at SDF.ORG Sun Jan 15 14:08:58 2012 From: jcm at SDF.ORG (jcm at SDF.ORG) Date: Sun, 15 Jan 2012 14:08:58 -0000 Subject: [cl-typesetting-devel] Multicolor text in paragraph Message-ID: <05a4a8c170fc03f5436a8f73d516a798.squirrel@wm.sdf.org> Can PARAGRAPH be used to show different styles/colors of text in the same line? From amalawi at gmail.com Sun Jan 15 19:20:20 2012 From: amalawi at gmail.com (Ala'a Mohammad) Date: Sun, 15 Jan 2012 11:20:20 -0800 Subject: [cl-typesetting-devel] Multicolor text in paragraph In-Reply-To: <05a4a8c170fc03f5436a8f73d516a798.squirrel@wm.sdf.org> References: <05a4a8c170fc03f5436a8f73d516a798.squirrel@wm.sdf.org> Message-ID: check http://www.fractalconcept.com/ex.pdf http://www.fractalconcept.com:8000/public/open-source/cl-typesetting/test.lisp On Sun, Jan 15, 2012 at 6:08 AM, wrote: > Can PARAGRAPH be used to show different styles/colors of text in the same > line? > > > > _______________________________________________ > cl-typesetting-devel site list > cl-typesetting-devel at common-lisp.net > http://common-lisp.net/mailman/listinfo/cl-typesetting-devel From ystok-systema at rambler.ru Mon Jan 16 04:54:57 2012 From: ystok-systema at rambler.ru (Dmitriy Ivanov) Date: Mon, 16 Jan 2012 08:54:57 +0400 Subject: [cl-typesetting-devel] [cl-pdf-devel] Multicolor text in paragraph References: <05a4a8c170fc03f5436a8f73d516a798.squirrel@wm.sdf.org> Message-ID: <000101ccd40b$05956f70$8100a8c0@digo> jcm at SDF.ORG wrote on Sun, 15 Jan 2012 14:08:58 -0000 18:08: | Can PARAGRAPH be used to show different styles/colors of text in the | same line? Please take a look at the :pre-decoration and :post-decoration attrubutes of a style. They can be specified in tt:with-style for example. -- Sincerely, Dmitriy Ivanov lisp.ystok.ru From jcm at SDF.ORG Tue Jan 17 12:46:20 2012 From: jcm at SDF.ORG (jcm at SDF.ORG) Date: Tue, 17 Jan 2012 12:46:20 -0000 Subject: [cl-typesetting-devel] Adding arrow heads to lines Message-ID: <3272736413d53fbf5c807ea8f85e0d82.squirrel@wm.sdf.org> Is there a way to add arrow heads without trying to rotate and draw them manuall? From jcm at SDF.ORG Tue Jan 17 12:48:03 2012 From: jcm at SDF.ORG (jcm at SDF.ORG) Date: Tue, 17 Jan 2012 12:48:03 -0000 Subject: [cl-typesetting-devel] Importing Cambria font Message-ID: I'm running SBCL on OS X. How could I import a Cambria font for use in PDFs? From jcm at SDF.ORG Wed Jan 18 18:12:04 2012 From: jcm at SDF.ORG (jcm at SDF.ORG) Date: Wed, 18 Jan 2012 18:12:04 -0000 Subject: [cl-typesetting-devel] Text to left and right of user drawn box Message-ID: <39c7be96e53ce40667decb56b6c8ffe9.squirrel@wm.sdf.org> I'm drawing a chart that needs text to the left and the right. However, I'm not sure which text methods are correct within the context of WITH-DOCUMENT to place text where I need them to go. Using the regular CL-PDF methods causes an error, because *page* is not set. From jcm at SDF.ORG Wed Jan 18 18:28:33 2012 From: jcm at SDF.ORG (jcm at SDF.ORG) Date: Wed, 18 Jan 2012 18:28:33 -0000 Subject: [cl-typesetting-devel] Need help with layout Message-ID: <7ed4ac07181cc41a00f44a6ac9f47986.squirrel@wm.sdf.org> I'm having some issues getting my layout working, and I'm running out of time, so if anyone can help, I'd appreciate it. How can I have a line of text, a user drawn box, and another line of text, with the text lined up pretty much with the center of the box? I have a 100 point high user draw box, so I need label text on the left and right about 50 points from the top or bottom of the box. Can anyone help? From marc.battyani at fractalconcept.com Wed Jan 18 18:40:16 2012 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Wed, 18 Jan 2012 13:40:16 -0500 Subject: [cl-typesetting-devel] Need help with layout In-Reply-To: <7ed4ac07181cc41a00f44a6ac9f47986.squirrel@wm.sdf.org> References: <7ed4ac07181cc41a00f44a6ac9f47986.squirrel@wm.sdf.org> Message-ID: <4F171210.503@fractalconcept.com> On 1/18/2012 1:28 PM, jcm at SDF.ORG wrote: > I'm having some issues getting my layout working, and I'm running out of > time, so if anyone can help, I'd appreciate it. > > How can I have a line of text, a user drawn box, and another line of text, > with the text lined up pretty much with the center of the box? I have a > 100 point high user draw box, so I need label text on the left and right > about 50 points from the top or bottom of the box. What you want to do exactly is not clear. Why don't you draw those labels in the drawing function of your user-drown-box? The best way for you to get real practical help would be to post a small simple and self contained example showing your problem. Marc From jcm at SDF.ORG Wed Jan 18 20:32:45 2012 From: jcm at SDF.ORG (jcm at SDF.ORG) Date: Wed, 18 Jan 2012 20:32:45 -0000 Subject: [cl-typesetting-devel] Need help with layout In-Reply-To: <4F171210.503@fractalconcept.com> References: <7ed4ac07181cc41a00f44a6ac9f47986.squirrel@wm.sdf.org> <4F171210.503@fractalconcept.com> Message-ID: <6da0416d37c068cd54be597062cae766.squirrel@wm.sdf.org> > What you want to do exactly is not clear. Why don't you draw those > labels in the drawing function of your user-drown-box? > The best way for you to get real practical help would be to post a small > simple and self contained example showing your problem. I found the best solution here is a table, and that is working very well. But now I trying to get footers to appear on a landscape style document. Here's a trimmed down but functional snippet: (with-document () (let* ((header (lambda (pdf:*page*) (pdf:translate 0 580) (pdf:set-rgb-fill 0.55 0.17 0.08) (pdf:set-rgb-stroke 0.55 0.17 0.08) (pdf:basic-rect 0 0 841 15) (pdf:fill-and-stroke) (pdf:set-rgb-fill 0.70 0.22 0.11) (pdf:set-rgb-stroke 0.70 0.22 0.11) (pdf:basic-rect 0 3 841 9) (pdf:fill-and-stroke) (pdf:set-rgb-fill 0.78 0.24 0.12) (pdf:set-rgb-stroke 0.78 0.24 0.12) (pdf:basic-rect 0 6 841 3) (pdf:fill-and-stroke) (compile-text ()))) (footer (lambda (pdf:*page*) (compile-text (:font *font* :font-size 10) (paragraph (:h-align :left :color '(1 0 0)) "Company name") (paragraph (:h-align :center :color '(0 0 0)) (verbatim (format nil "~D" pdf:*page-number*)))))) (content (compile-text (:top-margin 20 :font *font* :font-size *font-size*) (paragraph (:h-align :left :font "Times-Roman" :font-size 36 :color '(0.8 0.25 0.12)) "Report")))) (draw-pages content :orientation :landscape :margins '(72 36 72 36) :header header :footer footer :break :always ) (pdf:write-document filename))) Thanks for your help! From marc.battyani at fractalconcept.com Sat Jan 21 02:54:24 2012 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Fri, 20 Jan 2012 21:54:24 -0500 Subject: [cl-typesetting-devel] Need help with layout In-Reply-To: <6da0416d37c068cd54be597062cae766.squirrel@wm.sdf.org> References: <7ed4ac07181cc41a00f44a6ac9f47986.squirrel@wm.sdf.org> <4F171210.503@fractalconcept.com> <6da0416d37c068cd54be597062cae766.squirrel@wm.sdf.org> Message-ID: <4F1A28E0.4080605@fractalconcept.com> On 1/18/2012 3:32 PM, jcm at SDF.ORG wrote: >> What you want to do exactly is not clear. Why don't you draw those >> labels in the drawing function of your user-drown-box? >> The best way for you to get real practical help would be to post a small >> simple and self contained example showing your problem. > I found the best solution here is a table, and that is working very well. > > But now I trying to get footers to appear on a landscape style document. > > Here's a trimmed down but functional snippet: Having a real example makes it much easier to fix so here is the corrected version. (with-document () (let* ((header (lambda (pdf:*page*) (pdf:with-saved-state ;<= *** you need to save the graphic state if you use direct pdf functions (pdf:translate 0 580) (pdf:set-rgb-fill 0.55 0.17 0.08) (pdf:set-rgb-stroke 0.55 0.17 0.08) (pdf:basic-rect 0 0 841 15) (pdf:fill-and-stroke) (pdf:set-rgb-fill 0.70 0.22 0.11) (pdf:set-rgb-stroke 0.70 0.22 0.11) (pdf:basic-rect 0 3 841 9) (pdf:fill-and-stroke) (pdf:set-rgb-fill 0.78 0.24 0.12) (pdf:set-rgb-stroke 0.78 0.24 0.12) (pdf:basic-rect 0 6 841 3) (pdf:fill-and-stroke) (compile-text ()) ))) (footer (lambda (pdf:*page*) (compile-text (:font *font* :font-size 10) (paragraph (:h-align :left :color '(1 0 0)) "Company name") (paragraph (:h-align :center :color '(0 0 0)) (verbatim (format nil "~D" pdf:*page-number*)))))) (content (compile-text (:top-margin 20 :font *font* :font-size *font-size*) (paragraph (:h-align :left :font "Times-Roman" :font-size 36 :color '(0.8 0.25 0.12)) "Report")))) (draw-pages content :orientation :landscape :margins '(72 36 72 36) :header header :footer footer :header-top 6 ; <= *** with a margin of 36 and a default space of 30 above/below the header/footer this leaves only 6 for them which is way too small :footer-bottom 6 :break :always) (pdf:write-document "c:/tmp/clpdf.pdf"))) Marc > > (with-document () > (let* ((header > (lambda (pdf:*page*) > (pdf:translate 0 580) > > (pdf:set-rgb-fill 0.55 0.17 0.08) > (pdf:set-rgb-stroke 0.55 0.17 0.08) > (pdf:basic-rect 0 0 841 15) > (pdf:fill-and-stroke) > > (pdf:set-rgb-fill 0.70 0.22 0.11) > (pdf:set-rgb-stroke 0.70 0.22 0.11) > (pdf:basic-rect 0 3 841 9) > (pdf:fill-and-stroke) > > (pdf:set-rgb-fill 0.78 0.24 0.12) > (pdf:set-rgb-stroke 0.78 0.24 0.12) > (pdf:basic-rect 0 6 841 3) > (pdf:fill-and-stroke) > > (compile-text ()))) > (footer > (lambda (pdf:*page*) > (compile-text (:font *font* :font-size 10) > (paragraph (:h-align :left :color '(1 0 0)) > "Company name") > (paragraph (:h-align :center :color '(0 0 0)) > (verbatim (format nil "~D" pdf:*page-number*)))))) > (content > (compile-text (:top-margin 20 :font *font* :font-size > *font-size*) > (paragraph > (:h-align :left :font "Times-Roman" :font-size 36 > :color '(0.8 0.25 0.12)) > "Report")))) > (draw-pages content > :orientation :landscape > :margins '(72 36 72 36) > :header header > :footer footer > :break :always > ) > (pdf:write-document filename))) > > Thanks for your help! > > From jcm at SDF.ORG Sat Jan 21 15:03:09 2012 From: jcm at SDF.ORG (jcm at SDF.ORG) Date: Sat, 21 Jan 2012 15:03:09 -0000 Subject: [cl-typesetting-devel] Need help with layout In-Reply-To: <4F1A28E0.4080605@fractalconcept.com> References: <7ed4ac07181cc41a00f44a6ac9f47986.squirrel@wm.sdf.org> <4F171210.503@fractalconcept.com> <6da0416d37c068cd54be597062cae766.squirrel@wm.sdf.org> <4F1A28E0.4080605@fractalconcept.com> Message-ID: Ah, I see, thanks. Now, if I want to draw a horizontal line above the footer text, how do I need to adjust the margins and/or footer-bottom to make sure it is visible? > :header-top 6 ; <= *** with a margin of 36 and a > default space of 30 above/below the header/footer this leaves only 6 for > them which is way too small > :footer-bottom 6 From marc.battyani at fractalconcept.com Sun Jan 22 01:58:47 2012 From: marc.battyani at fractalconcept.com (Marc Battyani) Date: Sat, 21 Jan 2012 20:58:47 -0500 Subject: [cl-typesetting-devel] Need help with layout In-Reply-To: References: <7ed4ac07181cc41a00f44a6ac9f47986.squirrel@wm.sdf.org> <4F171210.503@fractalconcept.com> <6da0416d37c068cd54be597062cae766.squirrel@wm.sdf.org> <4F1A28E0.4080605@fractalconcept.com> Message-ID: <4F1B6D57.60806@fractalconcept.com> On 1/21/2012 10:03 AM, jcm at SDF.ORG wrote: > Ah, I see, thanks. Now, if I want to draw a horizontal line above the > footer text, how do I need to adjust the margins and/or footer-bottom to > make sure it is visible? You can reserve some space at the top of the footer with #'vspace and draw whatever you want there. You can also put directly horizontal lines in the footer with hrule. (footer (lambda (pdf:*page*) (compile-text (:font *font* :font-size 10) (hrule :dy 2) (vspace 4) (hrule :dy 1/2) (paragraph (:h-align :left :color '(1 0 0)) "Company name") (paragraph (:h-align :center :color '(0 0 0)) (verbatim (format nil "~D" pdf:*page-number*)))))) Marc > >> :header-top 6 ; <= *** with a margin of 36 and a >> default space of 30 above/below the header/footer this leaves only 6 for >> them which is way too small >> :footer-bottom 6 > > >