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

  • Thread starter Alexander Vasilevsky
  • 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
 
P

Pavel Minaev

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top