Method MeasureText

Namespace
SoftZenPdf
Assembly
SoftZenPdf.dll

MeasureText(string, double)

Measures the width of a single line of text as it is drawn, including kerning and, for TrueType fonts, ligatures. Use it to align, centre, wrap or underline text.

public double MeasureText(string text, double fontSize)

Parameters

text string

The text to measure.

fontSize double

The font size, in points.

Returns

double

The width, in points.

Exceptions

ArgumentException

The font cannot show a character of text.