TextLayoutResult
class TextLayoutResult
kotlin.Any | |
↳ | androidx.compose.ui.text.TextLayoutResult |
The data class which holds text layout result.
Summary
Public constructors | |
---|---|
<init>(layoutInput: TextLayoutInput, multiParagraph: MultiParagraph, size: IntSize) The data class which holds text layout result. |
Public methods | |
---|---|
TextLayoutResult |
copy(layoutInput: TextLayoutInput = this.layoutInput, size: IntSize = this.size) |
operator Boolean | |
ResolvedTextDirection |
getBidiRunDirection(offset: Int) Get the text direction of the resolved BiDi run that the character at the given offset associated with. |
Rect |
getBoundingBox(offset: Int) Returns the bounding box of the character for given character offset. |
Rect |
getCursorRect(offset: Int) Returns the rectangle of the cursor area |
Float |
getHorizontalPosition(offset: Int, usePrimaryDirection: Boolean) Get the horizontal position for the specified text offset. |
Float |
getLineBottom(lineIndex: Int) Returns the bottom y coordinate of the given line. |
Int |
getLineEnd(lineIndex: Int, visibleEnd: Boolean = false) Returns the end offset of the given line |
Int |
getLineForOffset(offset: Int) Returns the line number on which the specified text offset appears. |
Int |
getLineForVerticalPosition(vertical: Float) Returns line number closest to the given graphical vertical position. |
Float |
getLineLeft(lineIndex: Int) Returns the left x coordinate of the given line. |
Float |
getLineRight(lineIndex: Int) Returns the right x coordinate of the given line. |
Int |
getLineStart(lineIndex: Int) Returns the end offset of the given line, inclusive. |
Float |
getLineTop(lineIndex: Int) Returns the top y coordinate of the given line. |
Int |
getOffsetForPosition(position: Offset) Returns the character offset closest to the given graphical position. |
ResolvedTextDirection |
getParagraphDirection(offset: Int) Get the text direction of the paragraph containing the given offset. |
Path |
getPathForRange(start: Int, end: Int) Returns path that enclose the given text range. |
TextRange |
getWordBoundary(offset: Int) Returns the text range of the word at the given character offset. |
Int |
hashCode() |
Boolean |
isLineEllipsized(lineIndex: Int) Returns true if ellipsis happens on the given line, otherwise returns false |
String |
toString() |
Properties | |
---|---|
Boolean |
Returns true if the text is too tall and couldn't fit with given height. |
Boolean |
Returns true if the text is too wide and couldn't fit with given width. |
Float |
The distance from the top to the alphabetic baseline of the first line. |
Boolean |
Returns true if either vertical overflow or horizontal overflow happens. |
Float |
The distance from the top to the alphabetic baseline of the last line. |
TextLayoutInput |
The parameters used for computing this text layout result. |
Int |
Returns a number of lines of this text layout |
MultiParagraph |
The multi paragraph object. |
List<Rect?> |
Returns a list of bounding boxes that is reserved for TextLayoutInput.placeholders. |
IntSize |
The amount of space required to paint this text in Int. |
Public constructors
<init>
TextLayoutResult(
&