ITextLayoutLine Interface
Provides the base requirements for a visual line of text within an ITextLayout.
public interface ITextLayoutLine
Properties
Baseline
Gets the baseline distance.
CharacterCount
Gets the number of characters in the line.
HasHardLineBreak
Gets whether the the line ends with a hard line break.
bool HasHardLineBreak { get; }
Property Value
- bool:
true
if the the line ends with a hard line break; otherwise,false
.
Height
Gets the height of the line.
StartCharacterIndex
Gets the index of the first character in this line, relative to the original ITextLayout text.
int StartCharacterIndex { get; }
Property Value
- int:
The index of the first character in this line, relative to the original ITextLayout text.
Width
Gets the width of the line.
Methods
GetCharacterBounds(int, bool)
Gets 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:
The ITextBounds of the specified character.
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:
The character index of the next character after the specified character index.
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>:
The collection of ITextBounds that encompass the specified character range.
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.