RichTextKit v0.1

TextBlock Class

Assembly: Topten.RichTextKit.dll
Namespace: Topten.RichTextKit

Represents a block of formatted, laid out and measurable text

public class TextBlock

Inheritance

TextBlock → object

Constructors

TextBlock()

Constructor

Properties

Alignment

Sets the left, right or center alignment of the text block.

BaseDirection

The base directionality of this text block (whether text is laid out left to right, or right to left)

CaretIndicies

Retrieves a list of all valid caret positions

FontMapper

Gets or sets the font mapper to be used by this TextBlock instance

FontRuns

Get all font runs for this text block

Lines

Get all the lines for this text block

MaxHeight

The maximum height of the TextBlock after which lines will be truncated and the final line will be appended with an ellipsis (...) character.

MaxLines

The maximum number of lines after which lines will be truncated and the final line will be appended with an ellipsis (...) character.

MaxWidth

The max width property sets the maximum width of a line, after which the line will be wrapped onto the next line.

MeasuredHeight

The total height of all lines.

MeasuredOverhang

Gets the actual measured overhang in each direction based on the fonts used, and the supplied text.

MeasuredPadding

Gets the size of any unused space around the text.

MeasuredWidth

The width of the widest line of text.

StyleRuns

Get the text runs as added by AddText

Methods

AddText(string, IStyle)

Add text to this paragraph

AddText(Utils.Slice<int>, IStyle)

Add text to this paragraph

Clear()

Clear the content of this text block

FindFontRunForCodePointIndex(int)

Find the font run holding a code point index

GetCaretInfo(int)

Calculates useful information for displaying a caret

HitTest(float, float)

Hit test this block of text

Layout()

Lays out the provided text and returns paragraph

LookupCaretIndex(int)

Given a code point index, find the index in the CaretIndicies

Paint(SkiaSharp.SKCanvas, TextPaintOptions)

Paint this text block

Paint(SkiaSharp.SKCanvas, SkiaSharp.SKPoint, TextPaintOptions)

Paint this text block

ResetPooledMemory()

Resets and internal object and memory pools.