Table of Contents

Interface ITextMeasureContext

Namespace
Xui.Core.Canvas
Assembly
Core.dll

Provides functionality for measuring text and setting font properties. Mirrors the measurement behavior of the HTML5 Canvas 2D context, but returns a full TextMetrics structure for advanced layout.

public interface ITextMeasureContext

Methods

MeasureText(string)

Measures the layout and bounding box metrics of the specified text string using the current font.

TextMetrics MeasureText(string text)

Parameters

text string

The text string to measure.

Returns

TextMetrics

A TextMetrics structure containing both string-specific and font-wide metrics.

SetFont(Font)

Sets the font used for all subsequent text drawing and measurement operations.

void SetFont(Font font)

Parameters

font Font

The font definition to apply.