Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

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()

u64 getEllipsisStart(u64 lineNumber)
Gets the UTF-16 character index where truncation begins for a given line:
  • Where ellipsis is inserted (for tail, head, and middle modes)
  • Where clipping occurs (for clip mode, without ellipsis character)
For multi-line layouts, each line’s indices start from 0. Supports ellipsis modes: tail, head, middle, clip. Use 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()

u64 getEllipsisCount(u64 lineNumber)
Gets the count of UTF-16 characters for a given line:
  • Replaced by ellipsis (for tail, head, and middle modes)
  • Clipped (for clip mode, without ellipsis character)
This value represents the number of characters from the full line text that are hidden by the ellipsis/clipped. Combined with 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
Returns non-zero when ellipsis is successfully applied:
  • 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

Last modified on October 29, 2026