MathGroup Archive 2010

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

Search the Archive

Re: how to scale text to a bounding rectangle?

Hi, Michael,

try this:


 Framed@Pane[Graphics[Text[Style["ABcdEG", n]]], {m1, m2}, 
   Alignment -> Center],

 {n, 10, 30}, {m1, 50, 200}, {m2, 20, 200}]

and play with parameters to chose those fitting your needs.
Have fun, Alexei

How can I automatically scale Text[] to fit into a bounding rectangle of 
a size that I specify?

For instance, I can get a pretty close result here, but it is not 
perfect (the text doesn't touch the bottom edge of the rectangle), and 
"36", {0,0}, and {-1,-1} are all numbers I had to find through trial and 

   FaceForm[], EdgeForm[Black],
   Rectangle[{0, 0}, {100, 10}],
   Text[Style["Hello", 36], {0, 0}, {-1, -1}]



Alexei Boulbitch, Dr. habil.
Senior Scientist
Material Development

ZAE Weiergewan
11, rue Edmond Reuter

Tel: +352 2454 2566
Fax: +352 2454 3566
Mobile: +49 (0) 151 52 40 66 44

e-mail: alexei.boulbitch at


This e-mail may contain trade secrets or privileged, undisclosed or
otherwise confidential information. If you are not the intended
recipient and have received this e-mail in error, you are hereby
notified that any review, copying or distribution of it is strictly
prohibited. Please inform us immediately and destroy the original
transmittal from your system. Thank you for your co-operation.

  • Prev by Date: Using Mathematica for Electrophysiology Data Analysis
  • Next by Date: Re: Reading Binary Data from SQL Request
  • Previous by thread: Re: how to scale text to a bounding rectangle?
  • Next by thread: Re: how to scale text to a bounding rectangle?