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
Methods
CreateSymbol(TextRun, FlowDirection)
Creates a shaped symbol.
public static ShapedTextRun CreateSymbol(TextRun textRun, FlowDirection flowDirection)
Parameters
textRun
TextRunThe symbol run to shape.
flowDirection
FlowDirectionThe 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
ITextSourceThe text source.
firstTextSourceIndex
intThe first character index to start the text line from.
paragraphWidth
doubleA double value that specifies the width of the paragraph that the line fills.
paragraphProperties
TextParagraphPropertiesA TextParagraphProperties value that represents paragraph properties, such as TextWrapping, TextAlignment, or TextStyle.
previousLineBreak
TextLineBreakA 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.