Edit

Share via


SKFont.BreakText Method

Definition

Overloads

Name Description
BreakText(ReadOnlySpan<Char>, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

BreakText(String, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

BreakText(ReadOnlySpan<Byte>, SKTextEncoding, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

BreakText(ReadOnlySpan<Char>, Single, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

BreakText(String, Single, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

BreakText(IntPtr, Int32, SKTextEncoding, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

BreakText(ReadOnlySpan<Byte>, SKTextEncoding, Single, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

BreakText(IntPtr, Int32, SKTextEncoding, Single, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

BreakText(ReadOnlySpan<Char>, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

public int BreakText(ReadOnlySpan<char> text, float maxWidth, SkiaSharp.SKPaint paint = default);

Parameters

text
ReadOnlySpan<Char>

The text to measure.

maxWidth
Single

The maximum width constraint.

paint
SKPaint

An optional SKPaint for additional text effects.

Returns

The number of characters that fit within the maximum width.

Applies to

BreakText(String, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

public int BreakText(string text, float maxWidth, SkiaSharp.SKPaint paint = default);

Parameters

text
String

The text to measure.

maxWidth
Single

The maximum width constraint.

paint
SKPaint

An optional SKPaint for additional text effects.

Returns

The number of characters that fit within the maximum width.

Applies to

BreakText(ReadOnlySpan<Byte>, SKTextEncoding, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

public int BreakText(ReadOnlySpan<byte> text, SkiaSharp.SKTextEncoding encoding, float maxWidth, SkiaSharp.SKPaint paint = default);

Parameters

text
ReadOnlySpan<Byte>

The text to measure.

encoding
SKTextEncoding

The SKTextEncoding of the text.

maxWidth
Single

The maximum width constraint.

paint
SKPaint

An optional SKPaint for additional text effects.

Returns

The number of characters that fit within the maximum width.

Applies to

BreakText(ReadOnlySpan<Char>, Single, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

public int BreakText(ReadOnlySpan<char> text, float maxWidth, out float measuredWidth, SkiaSharp.SKPaint paint = default);

Parameters

text
ReadOnlySpan<Char>

The text to measure.

maxWidth
Single

The maximum width constraint.

measuredWidth
Single

When this method returns, contains the actual measured width of the text.

paint
SKPaint

An optional SKPaint for additional text effects.

Returns

The number of characters that fit within the maximum width.

Applies to

BreakText(String, Single, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

public int BreakText(string text, float maxWidth, out float measuredWidth, SkiaSharp.SKPaint paint = default);

Parameters

text
String

The text to measure.

maxWidth
Single

The maximum width constraint.

measuredWidth
Single

When this method returns, contains the actual measured width of the text.

paint
SKPaint

An optional SKPaint for additional text effects.

Returns

The number of characters that fit within the maximum width.

Applies to

BreakText(IntPtr, Int32, SKTextEncoding, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

public int BreakText(IntPtr text, int length, SkiaSharp.SKTextEncoding encoding, float maxWidth, SkiaSharp.SKPaint paint = default);

Parameters

text
IntPtr

A pointer to the text buffer.

length
Int32

The number of bytes in the text buffer.

encoding
SKTextEncoding

The SKTextEncoding of the text.

maxWidth
Single

The maximum width constraint.

paint
SKPaint

An optional SKPaint for additional text effects.

Returns

The number of characters that fit within the maximum width.

Applies to

BreakText(ReadOnlySpan<Byte>, SKTextEncoding, Single, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

public int BreakText(ReadOnlySpan<byte> text, SkiaSharp.SKTextEncoding encoding, float maxWidth, out float measuredWidth, SkiaSharp.SKPaint paint = default);

Parameters

text
ReadOnlySpan<Byte>

The text to measure.

encoding
SKTextEncoding

The SKTextEncoding of the text.

maxWidth
Single

The maximum width constraint.

measuredWidth
Single

When this method returns, contains the actual measured width of the text.

paint
SKPaint

An optional SKPaint for additional text effects.

Returns

The number of characters that fit within the maximum width.

Applies to

BreakText(IntPtr, Int32, SKTextEncoding, Single, Single, SKPaint)

Measures text, stopping when the maximum width is exceeded.

public int BreakText(IntPtr text, int length, SkiaSharp.SKTextEncoding encoding, float maxWidth, out float measuredWidth, SkiaSharp.SKPaint paint = default);

Parameters

text
IntPtr

A pointer to the text buffer.

length
Int32

The number of bytes in the text buffer.

encoding
SKTextEncoding

The SKTextEncoding of the text.

maxWidth
Single

The maximum width constraint.

measuredWidth
Single

When this method returns, contains the actual measured width of the text.

paint
SKPaint

An optional SKPaint for additional text effects.

Returns

The number of characters that fit within the maximum width.

Applies to