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
ShapedBufferproperties
TextRunProperties
Properties
Baseline
Run baseline in ratio relative to run height
public override double Baseline { get; }
Property Value
BidiLevel
public sbyte BidiLevel { get; }
Property Value
GlyphRun
public GlyphRun GlyphRun { get; }
Property Value
IsReversed
public bool IsReversed { get; }
Property Value
Length
Gets the text source length.
public override int Length { get; }
Property Value
Properties
A set of properties shared by every characters in the run
public override TextRunProperties Properties { get; }
Property Value
ShapedBuffer
public ShapedBuffer ShapedBuffer { get; }
Property Value
Size
Gets the size.
public override Size Size { get; }
Property Value
Text
Gets the text run's text.
public override ReadOnlyMemory<char> Text { get; }
Property Value
TextMetrics
public TextMetrics TextMetrics { get; }
Property Value
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
DrawingContextThe drawing context.
origin
PointThe origin.
TryMeasureCharacters(double, out int)
Measures the number of characters that fit into available width.
public bool TryMeasureCharacters(double availableWidth, out int length)
Parameters
Returns
- bool
true
if characters fit into the available width; otherwise,false
.