Declaration
public static float GetMaximumFontSize(
this Graphics graphics,
SizeF maximumSize,
FontFamily fontFamily,
string text,
FontStyle style = Regular,
bool allowWordWrapping = false
)Summary
Determines the largest font size at which the specified text fits into the specified maximum size in the
specified font.
Parameters
| this Graphics | graphics |
Specifies the Graphics object to use when measuring the font size. |
| SizeF | maximumSize |
Maximum size (in pixels) the text should have. |
| FontFamily | fontFamily |
The font to measure. |
| string | text |
The text whose size mustn't exceed maximumSize. |
| FontStyle | style |
Font style to apply. |
| bool | allowWordWrapping |
True if the text is allowed to word-wrap within the specified bounds. |