In This Article

ITextLayoutLine Interface

Provides the base requirements for a visual line of text within an ITextLayout.

public interface ITextLayoutLine

Properties

Baseline

The baseline distance.

double Baseline { get; }

Property Value

double

CharacterCount

The number of characters in the line, including any line terminator characters.

int CharacterCount { get; }

Property Value

int

HasHardLineBreak

Indicates whether the the line ends with a line terminator.

bool HasHardLineBreak { get; }

Property Value

bool:

true if the the line ends with a line terminator; otherwise, false.

See Also

Height

The height of the line.

double Height { get; }

Property Value

double

LineTerminator

The type of line terminator that ends the line, if any.

LineTerminator? LineTerminator { get; }

Property Value

LineTerminator?

See Also

LineTerminatorCharacterCount

The number of characters for the line terminator, which is either 0 (no line terminator) or 1 (any line terminator, even CRLF).

int LineTerminatorCharacterCount { get; }

Property Value

int

StartCharacterIndex

The index of the first character in this line, relative to the original ITextLayout text.

int StartCharacterIndex { get; }

Property Value

int

Width

The width of the line.

double Width { get; }

Property Value

double

Methods

GetCharacterBounds(int, bool)

Returns the ITextBounds of the specified character.

ITextBounds GetCharacterBounds(int characterIndex, bool allowVirtualSpace)
Parameter Type Description
characterIndex int

The character index, relative to the original ITextLayout text.

allowVirtualSpace bool

Whether to allow virtual space past the last character.

Returns

ITextBounds

GetNextCaretCharacterIndex(int)

Returns the character index of the next character after the specified character index, which is important for multi-byte characters.

int GetNextCaretCharacterIndex(int characterIndex)
Parameter Type Description
characterIndex int

The index of the character to examine.

Returns

int

GetTextBounds(int, int, bool)

Returns the collection of ITextBounds that encompass the specified character range.

IEnumerable<ITextBounds> GetTextBounds(int characterIndex, int characterCount, bool allowVirtualSpace)
Parameter Type Description
characterIndex int

The start character index, relative to the original ITextLayout text.

characterCount int

The character count.

allowVirtualSpace bool

Whether to allow virtual space past the last character.

Returns

IEnumerable<ITextBounds>

HitTest(Point)

Hit tests to determine the character index at the specified location.

int HitTest(Point location)
Parameter Type Description
location Point

The location to examine.

Returns

int:

The index of the character at the location, if any. Otherwise, -1 is returned.

Extension Methods