Method MeasureText
MeasureText(ReadOnlySpan<char>, Font)
Measures the specified string when drawn with the specified Font. Calls internally GetTextExtent(ReadOnlySpan<char>, Font).
SizeD MeasureText(ReadOnlySpan<char> text, Font font)
Parameters
textReadOnlySpan<char>String to measure.
fontFontFont that defines the text format of the string.