Table of Contents

Class ShapedTextRun

Namespace
Avalonia.Media.TextFormatting
Assembly
Avalonia.Base.dll

A text run that holds shaped characters.

public sealed class ShapedTextRun : DrawableTextRun, IDisposable
Inheritance
ShapedTextRun
Implements
Inherited Members

Constructors

ShapedTextRun(ShapedBuffer, TextRunProperties)

public ShapedTextRun(ShapedBuffer shapedBuffer, TextRunProperties properties)

Parameters

shapedBuffer ShapedBuffer
properties TextRunProperties

Properties

Baseline

Run baseline in ratio relative to run height

public override double Baseline { get; }

Property Value

double

BidiLevel

public sbyte BidiLevel { get; }

Property Value

sbyte

GlyphRun

public GlyphRun GlyphRun { get; }

Property Value

GlyphRun

IsReversed

public bool IsReversed { get; }

Property Value

bool

Length

Gets the text source length.

public override int Length { get; }

Property Value

int

Properties

A set of properties shared by every characters in the run

public override TextRunProperties Properties { get; }

Property Value

TextRunProperties

ShapedBuffer

public ShapedBuffer ShapedBuffer { get; }

Property Value

ShapedBuffer

Size

Gets the size.

public override Size Size { get; }

Property Value

Size

Text

Gets the text run's text.

public override ReadOnlyMemory<char> Text { get; }

Property Value

ReadOnlyMemory<char>

TextMetrics

public TextMetrics TextMetrics { get; }

Property Value

TextMetrics

Methods

Dispose()

public void Dispose()

Draw(DrawingContext, Point)

Draws the DrawableTextRun at the given origin.

public override void Draw(DrawingContext drawingContext, Point origin)

Parameters

drawingContext DrawingContext

The drawing context.

origin Point

The origin.

TryMeasureCharacters(double, out int)

Measures the number of characters that fit into available width.

public bool TryMeasureCharacters(double availableWidth, out int length)

Parameters

availableWidth double

The available width.

length int

The count of fitting characters.

Returns

bool

true if characters fit into the available width; otherwise, false.