Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

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?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70691] Re: [mg70660] are there any methods of figuring out how "large" a piece of typeset textual data will be?
  • From: Carl Woll <carlw at wolfram.com>
  • Date: Mon, 23 Oct 2006 02:50:44 -0400 (EDT)
  • References: <200610220520.BAA04787@smc.vnet.net>

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: Programming style: postfix/prefix vs. functional
  • Next by Date: RE: Using "=" vs ":="
  • Previous by thread: are there any methods of figuring out how "large" a piece of typeset textual data will be?
  • Next by thread: Using "=" vs ":="