PeachDrawing.Text

PeachDrawing.Text.Layout.TextRuler

TextRuler.WidthOf(Typeface, double, string, Nullable<ShapeSettings>) Method

The distance the pen travels along text shaped in a face, in the units size is in.

public static double WidthOf(PeachDrawing.Text.Typeface typeface, double size, string text, System.Nullable<PeachDrawing.Text.Shaping.ShapeSettings> settings=null);

Parameters

typeface Typeface

The face.

size System.Double

The size of the em.

text System.String

The text.

settings System.Nullable<ShapeSettings>

What to ask of the shaper, or null for the defaults.

Returns

System.Double
The advance.

Exceptions

System.ArgumentNullException
typeface or text is null.

Remarks

The text is shaped as one run, left to right, with the script of its first character; use a Paragraph for text of mixed directions or scripts.