Interface ITextLayout3
interface ITextLayout3
Extends ITextLayout2
This interface extends ITextLayout2 with additional functionalities to retrieve
ellipsis-related information for lines with text truncation.
Methods
getEllipsisStart()
Gets the UTF-16 character index where truncation begins for a given line:u64getEllipsisStart(u64lineNumber)
- Where ellipsis is inserted (for tail, head, and middle modes)
- Where clipping occurs (for clip mode, without ellipsis character)
ITextLayout3::getEllipsisCount to check if a line is ellipsized/clipped (non-zero value indicates truncation).
Parameters
lineNumber
u64 — Required
The 0-based line index to query.
Use ITextLayout2::getLineMetrics to get the total number of lines laid out.
Returns
u64
The UTF-16 character index where ellipsis/clipping begins in the full line text.
Note: It is recommended to always check ITextLayout3::getEllipsisCount to determine if ellipsis/clipping is present before using this method.
Throws
InvalidOperationError— when:- Ellipsis was not successfully placed for tail, head, or middle modes
- Text fits within constraints without truncation
- Marquee ellipsis mode is used
InvalidArgumentError— when:- The line number is greater than the number of lines laid out
getEllipsisCount()
Gets the count of UTF-16 characters for a given line:u64getEllipsisCount(u64lineNumber)
- Replaced by ellipsis (for tail, head, and middle modes)
- Clipped (for clip mode, without ellipsis character)
ITextLayout3::getEllipsisStart, you can determine
the exact range of hidden text: [start, start + count).
Parameters
lineNumber
u64 — Required
The 0-based line index to query.
Use ITextLayout2::getLineMetrics to get the total number of lines.
Returns
u64
The count of UTF-16 characters hidden.
Returns 0 if:
- Ellipsis was not successfully placed for tail, head, or middle modes
- No clipping occurred for clip mode
- Text fits within constraints without truncation
- The line number is greater than the number of lines laid out
- Marquee ellipsis mode is used
- For tail, head, and middle modes: Ellipsis character was inserted and text was replaced
- For clip mode: Text was clipped even though no ellipsis character is displayed

