[cl-typesetting-devel] How to make some text flush leftandsomeflush right?
Peter Seibel
peter at gigamonkeys.com
Mon Aug 14 22:35:47 UTC 2006
Just wondering if anyone had any ideas on the spacing issue I've been
running into? Dimitry got me straightened out on getting draw-pages
to render all my content but I still can't get my headers and footers
to render quite right--the :hfill isn't actually pushing the
following text to the right marign.
-Peter
On Jul 26, 2006, at 2:19 PM, Peter Seibel wrote:
> On Jul 20, 2006, at 11:50 AM, Marc Battyani wrote:
>
>> "Peter Seibel" <peter at gigamonkeys.com> wrote:
>>> On Jul 20, 2006, at 11:37 AM, Marc Battyani wrote:
>>>
>>>> "Peter Seibel" <peter at gigamonkeys.com> 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
>
> <docs.pdf>
>
> --
> Peter Seibel * peter at gigamonkeys.com
> Gigamonkeys Consulting * http://www.gigamonkeys.com/
> Practical Common Lisp * http://www.gigamonkeys.com/book/
>
>
> _______________________________________________
> cl-typesetting-devel site list
> cl-typesetting-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/cl-typesetting-devel
--
Peter Seibel * peter at gigamonkeys.com
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/
More information about the cl-typesetting-devel
mailing list