namespace Avalonia.Media.TextFormatting { /// /// Represents a base class for text formatting. /// public abstract class TextFormatter { /// /// Gets the current that is used for non complex text formatting. /// public static TextFormatter Current { get { var current = AvaloniaLocator.Current.GetService(); if (current != null) { return current; } current = new TextFormatterImpl(); AvaloniaLocator.CurrentMutable.Bind().ToConstant(current); return current; } } /// /// Formats a text line. /// /// The text source. /// The first character index to start the text line from. /// A value that specifies the width of the paragraph that the line fills. /// A value that represents paragraph properties, /// such as TextWrapping, TextAlignment, or TextStyle. /// A value that specifies the text formatter state, /// in terms of where the previous line in the paragraph was broken by the text formatting process. /// The formatted line. public abstract TextLine FormatLine(ITextSource textSource, int firstTextSourceIndex, double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak? previousLineBreak = null); } }