Skip to content

HeadlessRenderer.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.

HeadlessRenderer.MeasureText\(string, TextRenderOptions\) Method

Measure the size of text with full layout options.

C#
public 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\.\)

Implements MeasureText\(string, TextRenderOptions\)

Returns

System.Numerics.Vector2
Width and height in pixels

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

Measure the size of plain text.

C#
public 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\)

Implements MeasureText\(string, Nullable<float>\)

Returns

System.Numerics.Vector2
Width and height in pixels