Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*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 2001

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

Search the Archive

How To Predict Absolute Width of Text String?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg30351] How To Predict Absolute Width of Text String?
  • From: rml27 at cornell.edu (Ronnen Levinson)
  • Date: Sat, 11 Aug 2001 03:40:16 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi.

Is there any easy way in Mathematica 4 to determine the absolute width (in,
say, points) of a text string in a given variable-width font and point
size? In other words, I'd like to know the dimensions of the text's
bounding box.

The idea here is that I have some frame labels that need to be no
longer than, say, 3", and I'd like to automatically adjust the point
size to make them fit. I don't have enough space to use a mono-width
font like Courier.

I can make a rough guess that the width of the bounding box is a * p *
n, where p = point size, n = StringLength, and 0< a < 1, but I don't
know how to calculate a without working out the width of each
character in the string, which is more work than I'd looking for.

Yours truly,

Ronnen Levinson.


  • Prev by Date: RE: Inserting Text into Multifunction Graphs
  • Next by Date: Hiding parts of a graph
  • Previous by thread: RE: using findroot for multiple functions
  • Next by thread: Hiding parts of a graph