MathGroup Archive 2010

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

Search the Archive

Re: how to scale text to a bounding rectangle?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110401] Re: how to scale text to a bounding rectangle?
  • From: Alexei Boulbitch <alexei.boulbitch at iee.lu>
  • Date: Wed, 16 Jun 2010 05:41:20 -0400 (EDT)

Hi, Michael,

try this:

Manipulate[

 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 
error:

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


Thanks,

Michael


-- 
Alexei Boulbitch, Dr. habil.
Senior Scientist
Material Development

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 CONTERN
Luxembourg

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

e-mail: alexei.boulbitch at iee.lu

www.iee.lu

--

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?