MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: are there any methods of figuring out how "large" a piece of typeset textual data will be?

A short addendum for those who may search for this in the future:

A Graphics object that just barely contains the box (or Cell) "form"
of an expression may be created. Creating a Cell without a border is
outside the scope of this post, but involves the options
CellFrameMargins & CellMargins.

anyway, assuming boxes is defined appropriately:



On 10/22/06, Carl Woll <carlw at> wrote:
> Chris Chiasson wrote:
> >... after the front end gets done formatting it?
> >
> >I was thinking about getting the front end to spit out an equivalent
> >EPS for the text and extracting the size from that, but I don't know
> >if I can do it properly. Is there an easy method? Perhaps via some
> >kind of API?
> >
> >The context for this question is that I am trying to generate "labels"
> >(expressions) for nodes in a graph. I am trying to diagram functions.
> >
> >
> There is an undocumented function that you may use to obtain this
> information, with the usual caveat that this functionality is subject to
> change. Here is an example of finding the size of the expression
> Expand[(1+x)^11]:
> In[6]:=
> FrontEndExecute[GetBoundingBoxSizePacket[BoxData[ToBoxes[Expand[(1 +
> x)^11]]]]]
> Out[6]=
> {{504., 13., 4.}}
> I believe the returned values are {{width, toptobaseline,
> baselinetobottom}} in points.
> Carl Woll
> Wolfram Research


  • Prev by Date: Re: Graphics--Need Help: How to show legends for graphics under Show Command?
  • Next by Date: Re: animation question
  • Previous by thread: Re: Question about Reduce
  • Next by thread: Re: are there any methods of figuring out how "large" a piece of typeset textual data will be?