Table of Contents

Class TextFormatter

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

Represents a base class for text formatting.

public abstract class TextFormatter
Inheritance
TextFormatter
Inherited Members

Constructors

TextFormatter()

protected TextFormatter()

Properties

Current

Gets the current TextFormatter that is used for non complex text formatting.

public static TextFormatter Current { get; }

Property Value

TextFormatter

Methods

CreateSymbol(TextRun, FlowDirection)

Creates a shaped symbol.

public static ShapedTextRun CreateSymbol(TextRun textRun, FlowDirection flowDirection)

Parameters

textRun TextRun

The symbol run to shape.

flowDirection FlowDirection

The flow direction.

Returns

ShapedTextRun

The shaped symbol.

FormatLine(ITextSource, int, double, TextParagraphProperties, TextLineBreak?)

Formats a text line.

public abstract TextLine? FormatLine(ITextSource textSource, int firstTextSourceIndex, double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak? previousLineBreak = null)

Parameters

textSource ITextSource

The text source.

firstTextSourceIndex int

The first character index to start the text line from.

paragraphWidth double

A double value that specifies the width of the paragraph that the line fills.

paragraphProperties TextParagraphProperties

A TextParagraphProperties value that represents paragraph properties, such as TextWrapping, TextAlignment, or TextStyle.

previousLineBreak TextLineBreak

A TextLineBreak value that specifies the text formatter state, in terms of where the previous line in the paragraph was broken by the text formatting process.

Returns

TextLine

The formatted line.