[plt-scheme] determining sizes of pict

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Mon Oct 10 17:28:51 EDT 2005

David Richards wrote:
> Given:
> (require (lib "mrpict.ss" "texpict"))
> (define dc (new bitmap-dc% (bitmap #f)))
> (dc-for-text-size dc)
> (define p (text "Hello World" null 24))
> How would we determine the height, width, ascent, descent of the  
> #<struct:pict> ?

The docs for Texpict collections says that

     A pict is an instance of the `pict' structure type:

     > struct:pict :: (struct pict (draw width height ascent descent
     children panbox))

so you can use pict-width, pict-height, pict-ascent and pict-descent.

Jens Axel Søgaard

Posted on the users mailing list.