Method GetFormattedTextSize
GetFormattedTextSize(Font?)
Calculates the size of the formatted text based on the specified font.
public virtual SizeD GetFormattedTextSize(Font? font = null)
Parameters
fontFontThe font to use for measuring the text. If null, the default label font for the normal visual state is used.
Returns
Remarks
This method measures the size of the text after applying any formatting. If no font is provided, the default font for the normal visual state is used.