ITextLayoutLine Interface
Provides the base requirements for a visual line of text within an ITextLayout.
public interface ITextLayoutLine
Properties
Baseline
The baseline distance.
CharacterCount
The number of characters in the line, including any line terminator characters.
HasHardLineBreak
Indicates whether the the line ends with a line terminator.
bool HasHardLineBreak { get; }
Property Value
- bool:
trueif the the line ends with a line terminator; otherwise,false.
See Also
Height
The height of the line.
LineTerminator
The type of line terminator that ends the line, if any.
LineTerminatorCharacterCount
The number of characters for the line terminator, which is either 0 (no line terminator) or 1 (any line terminator, even CRLF).
StartCharacterIndex
The index of the first character in this line, relative to the original ITextLayout text.
Width
The width of the line.
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
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
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
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,
-1is returned.