0

I want to calculate the fit size for the string with font and string format settings, but i could not find any methods for calculating width with stringformat without any maximum width constraints.

graphics.MeasureString uses maximum width when calculating size based on string format. but i need to find size without providing max width in order to fit with the stringformat mentioned.

How can i achieve this?

Amal
  • 141
  • 1
  • 10
  • I believe you can take inputs from this [answer](https://stackoverflow.com/questions/19674743/dynamically-resizing-font-to-fit-space-while-using-graphics-drawstring) – Shankar May 31 '17 at 05:11
  • Simnply feed in a very large maxwidth number, like 30k! Unless your string needs to be printed onto multiple lines this will do just fine. (If you want muzltiple lines you need the line width anyway.) – TaW Jun 04 '17 at 07:50

0 Answers0