How to pick up the size of font, that was a text fitted in an area?

  • Thread starter Thread starter Alexander Vasilevsky
  • Start date Start date
A

Alexander Vasilevsky

There is a certain text and certain rectangle. It is needed to pick up the
size of font all the same by appearance, that a text fully blended in a
rectangle.

http://www.alvas.net - Audio tools for C# and VB.Net developers
 
There is a certain text and certain rectangle. It is needed to pick up the
size of font all the same by appearance, that a text fully blended in a
rectangle.

http://www.alvas.net- Audio tools for C# and VB.Net developers

I'm not aware of any straightforward way to do it. It seems that you'd
have to use Graphics.MeasureString or TextRenderer.MeasureText
(whichever one you prefer for text output), make a guess at the
initial size, and then do a binary search from there. I doubt it would
be particularly fast, though still probably worth a try.
 
Back
Top