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 ILineMetric

interface ILineMetric
Extends com.amazon.apmf.IStandard Interface containing typographic metrics for a single line of text within a paragraph. ILineMetric provides detailed measurements used for text layout and rendering, including positional information (left edge, top edge, height, width), vertical metrics (descent, ascent), and font-specific measurements (cap height, x-height). These metrics are essential for precise text positioning, line spacing calculations, and custom text rendering.

Methods

getSize()

Size getSize()
The size of the line.

Returns

Size The size of the line.

getPoint()

Point getPoint()
The top left corner of the line.

Returns

Point The top left corner of the line.

getDescent()

double getDescent()
The descent of the line, representing the distance from the baseline to the bottom of the lowest descending glyph (e.g., ‘g’, ‘p’, ‘y’). Typically a positive value.

Returns

double The descent value of the line.

getCapHeight()

double getCapHeight()
The cap height of the font, representing the height of uppercase letters (e.g., ‘H’, ‘T’). Measured from the baseline, typically a negative value. Returns zero if unknown.

Returns

double The cap height of the font.

getAscent()

double getAscent()
The ascent of the line, representing the recommended distance from the baseline to the upper typographic boundary of the font. This value is defined by the font’s metrics (typically the typographic ascender) and provides enough space for glyphs that extend above the baseline, such as ascenders, capital letters, and accented characters.

Returns

double The ascent value of the line.

getXHeight()

double getXHeight()
The x-height of the font, representing the height of lowercase letters without ascenders or descenders (e.g., ‘x’, ‘a’, ‘e’). Measured from the baseline, typically a negative value. If it is zero, it means the xHeight is unknown.

Returns

double The x-height of the font.

getEndIndex()

u64 getEndIndex()
The index of the last character in text string (exclusive). Can be used to determine which characters belong to this line.

Returns

u64 The index of the text where the line ends.
Last modified on October 29, 2026