[cl-typesetting-devel] Tables with variable column widths

Marc Battyani marc.battyani at fractalconcept.com
Sun Apr 10 07:58:57 UTC 2005



> [Trying to post via my cell phone - hope it works.]

Yes :)

> On Fri, 8 Apr 2005 18:55:47 +0200, "Marc Battyani"
<marc.battyani at fractalconcept.com> wrote:
>
> > Something like this will give you the width:
> > (compute-boxes-natural-size (content cell) #'dx)
>
> Thanks, this works fine if I use the default font.  However, the two
> following forms
>
>   (compute-boxes-natural-size
>    (boxes (compile-text (:font "Times-Bold") "foo")) #'dx)
>
>   (compute-boxes-natural-size
>    (boxes (compile-text (:font "Times-Roman") "foo")) #'dx)
>
> evaluate to the same result.  I would have expected the first one to
> return a larger width.  How can I compute the width if I want to take
> the font into account?

It's because you forgot a () and a with-style:

(compute-boxes-natural-size
 (boxes (compile-text ()
          (with-style (:font "Times-Bold") "foo"))) #'dx)
15.696000000000002

(compute-boxes-natural-size
 (boxes (compile-text ()
          (with-style (:font "Times-Roman") "foo"))) #'dx)
15.996

(compute-boxes-natural-size
 (boxes (compile-text ()
          (with-style (:font "Times-Roman" :font-size 16) "foo"))) #'dx)
21.328

Cheers,

Marc





More information about the cl-typesetting-devel mailing list