Skip to content

IDrawContext.MeasureText Method

Definition

Namespace: Brine2D.Rendering

Overloads
MeasureText(string, TextRenderOptions) Measure the size of text with full layout options.
MeasureText(string, Nullable<float>) Measure the size of plain text.

IDrawContext.MeasureText(string, TextRenderOptions) Method

Measure the size of text with full layout options.

System.Numerics.Vector2 MeasureText(string text, Brine2D.Rendering.Text.TextRenderOptions options);

Parameters

text System.String

Text to measure

options TextRenderOptions

Layout options (wrapping, alignment, etc.)

Returns

System.Numerics.Vector2
Width and height in pixels

IDrawContext.MeasureText(string, Nullable\<float>) Method

Measure the size of plain text.

System.Numerics.Vector2 MeasureText(string text, System.Nullable<float> fontSize=null);

Parameters

text System.String

Text to measure (markup tags are NOT parsed)

fontSize System.Nullable<System.Single>

Font size in points (default uses current font size)

Returns

System.Numerics.Vector2
Width and height in pixels