# TextLayoutResult

Artifact: [androidx.compose.ui:ui-text](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/TextLayoutResult.kt+class:androidx.compose.ui.text.TextLayoutResult) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  class TextLayoutResult
  ```

*** ** * ** ***

Holds the result of a text layout computation.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#TextLayoutResult(androidx.compose.ui.text.TextLayoutInput,androidx.compose.ui.text.MultiParagraph,androidx.compose.ui.unit.IntSize)( layoutInput: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput, multiParagraph: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraph, size: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize )` | Cmn |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#copy(androidx.compose.ui.text.TextLayoutInput,androidx.compose.ui.unit.IntSize)(layoutInput: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput, size: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize)` | Cmn |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/ResolvedTextDirection` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getBidiRunDirection(kotlin.Int)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Get the text direction of the resolved BiDi run that the character at the given offset associated with. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getBoundingBox(kotlin.Int)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the bounding box of the character for given character offset. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getCursorRect(kotlin.Int)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the rectangle of the cursor area | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getHorizontalPosition(kotlin.Int,kotlin.Boolean)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, usePrimaryDirection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Get the horizontal position for the specified text `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getHorizontalPosition(kotlin.Int,kotlin.Boolean)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getLineBaseline(kotlin.Int)(lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the distance in pixels from the top of the text layout to the alphabetic baseline of the line at index `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getLineBaseline(kotlin.Int)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getLineBottom(kotlin.Int)(lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the bottom y coordinate of the given line. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getLineEnd(kotlin.Int,kotlin.Boolean)(lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, visibleEnd: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Returns the end offset of the given line. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getLineForOffset(kotlin.Int)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the line number on which the specified text offset appears. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getLineForVerticalPosition(kotlin.Float)(vertical: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Returns line number closest to the given graphical vertical position. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getLineLeft(kotlin.Int)(lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the left x coordinate of the given line. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getLineRight(kotlin.Int)(lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the right x coordinate of the given line. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getLineStart(kotlin.Int)(lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the start offset of the given line, inclusive. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getLineTop(kotlin.Int)(lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the top y coordinate of the given line. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getOffsetForPosition(androidx.compose.ui.geometry.Offset)(position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset)` Returns the character offset closest to the given graphical position. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/ResolvedTextDirection` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getParagraphDirection(kotlin.Int)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Get the text direction of the paragraph containing the given offset. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Path` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getPathForRange(kotlin.Int,kotlin.Int)(start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, end: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns path that enclose the given text range. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getWordBoundary(kotlin.Int)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the text range of the word at the given character offset. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#hashCode()()` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#isLineEllipsized(kotlin.Int)(lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns true if the given line is ellipsized, otherwise returns false. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#didOverflowHeight()` True if the text height exceeds the layout boundaries. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#didOverflowWidth()` True if the text width exceeds the layout boundaries. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#firstBaseline()` The distance from the top to the alphabetic baseline of the first line. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#hasVisualOverflow()` True if the text overflows vertically or horizontally. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#lastBaseline()` The distance from the top to the alphabetic baseline of the last line. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#layoutInput()` The input parameters used for this layout. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#lineCount()` Returns a number of lines of this text layout | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraph` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#multiParagraph()` The computed `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraph` layout. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect?>` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#placeholderRects()` Returns a list of bounding boxes that is reserved for `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#placeholders()`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#size()` The width and height of this text layout. | Cmn |

## Public constructors

### TextLayoutResult

Cmn Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
TextLayoutResult(
    layoutInput: TextLayoutInput,
    multiParagraph: MultiParagraph,
    size: IntSize
)
```

## Public functions

### copy

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun copy(
    layoutInput: TextLayoutInput = this.layoutInput,
    size: IntSize = this.size
): TextLayoutResult
```

### equals

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
open operator fun equals(other: Any?): Boolean
```

### getBidiRunDirection

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getBidiRunDirection(offset: Int): ResolvedTextDirection
```

Get the text direction of the resolved BiDi run that the character at the given offset associated with.

| Parameters |
|---|---|
| `offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | a character offset |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/ResolvedTextDirection` | the direction of the BiDi run of the given character offset. |

### getBoundingBox

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getBoundingBox(offset: Int): Rect
```

Returns the bounding box of the character for given character offset.

| Parameters |
|---|---|
| `offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | a character offset |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | a bounding box for the character in pixels. |

### getCursorRect

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getCursorRect(offset: Int): Rect
```

Returns the rectangle of the cursor area

| Parameters |
|---|---|
| `offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | An character offset of the cursor |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | a rectangle of cursor region |

### getHorizontalPosition

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getHorizontalPosition(offset: Int, usePrimaryDirection: Boolean): Float
```

Get the horizontal position for the specified text `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getHorizontalPosition(kotlin.Int,kotlin.Boolean)`.

Returns the relative distance from the text starting offset. For example, if the paragraph direction is Left-to-Right, this function returns positive value as a distance from the left-most edge. If the paragraph direction is Right-to-Left, this function returns negative value as a distance from the right-most edge.

`https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getHorizontalPosition(kotlin.Int,kotlin.Boolean)` argument is taken into account only when the offset is in the BiDi directional transition point. `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getHorizontalPosition(kotlin.Int,kotlin.Boolean)` is true means use the primary direction run's coordinate, and use the secondary direction's run's coordinate if false.

| Parameters |
|---|---|
| `offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | a character offset |
| `usePrimaryDirection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true for using the primary run's coordinate if the given offset is in the BiDi directional transition point. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the relative distance from the text starting edge. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraph#getHorizontalPosition(kotlin.Int,kotlin.Boolean)` |   |

### getLineBaseline

Cmn Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0)

```
fun getLineBaseline(lineIndex: Int): Float
```

Returns the distance in pixels from the top of the text layout to the alphabetic baseline of the line at index `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#getLineBaseline(kotlin.Int)`.

### getLineBottom

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getLineBottom(lineIndex: Int): Float
```

Returns the bottom y coordinate of the given line.

| Parameters |
|---|---|
| `lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the line number |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the line bottom y coordinate |

### getLineEnd

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getLineEnd(lineIndex: Int, visibleEnd: Boolean = false): Int
```

Returns the end offset of the given line.

The end offset represents a position in text after the last character in the given line. For example, `getLineEnd(0)` will return 4 for the text below

```
┌────┐
│abcd│
│efg │
└────┘
```

Characters being ellipsized are treated as invisible characters. So that if visibleEnd is false, it will return line end including the ellipsized characters and vice versa.

| Parameters |
|---|---|
| `lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the line number |
| `visibleEnd: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | if true, the returned line end will not count trailing whitespaces or linefeed characters. Otherwise, this function will return the logical line end. By default it's false. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | an exclusive end offset of the line. |

### getLineForOffset

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getLineForOffset(offset: Int): Int
```

Returns the line number on which the specified text offset appears.

If you ask for a position before 0, you get 0; if you ask for a position beyond the end of the text, you get the last line.

| Parameters |
|---|---|
| `offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | a character offset |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the 0 origin line number. |

### getLineForVerticalPosition

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getLineForVerticalPosition(vertical: Float): Int
```

Returns line number closest to the given graphical vertical position.

If you ask for a vertical position before 0, you get 0; if you ask for a vertical position beyond the last line, you get the last line.

| Parameters |
|---|---|
| `vertical: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the vertical position |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the 0 origin line number. |

### getLineLeft

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getLineLeft(lineIndex: Int): Float
```

Returns the left x coordinate of the given line.

| Parameters |
|---|---|
| `lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the line number |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the line left x coordinate |

### getLineRight

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getLineRight(lineIndex: Int): Float
```

Returns the right x coordinate of the given line.

| Parameters |
|---|---|
| `lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the line number |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the line right x coordinate |

### getLineStart

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getLineStart(lineIndex: Int): Int
```

Returns the start offset of the given line, inclusive.

The start offset represents a position in text before the first character in the given line. For example, `getLineStart(1)` will return 4 for the text below

```
┌────┐
│abcd│
│efg │
└────┘
```

| Parameters |
|---|---|
| `lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the line number |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the start offset of the line |

### getLineTop

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getLineTop(lineIndex: Int): Float
```

Returns the top y coordinate of the given line.

| Parameters |
|---|---|
| `lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the line number |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the line top y coordinate |

### getOffsetForPosition

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun getOffsetForPosition(position: Offset): Int
```

Returns the character offset closest to the given graphical position.

| Parameters |
|---|---|
| `position: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset` | a graphical position in this text layout |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | a character offset that is closest to the given graphical position. |

### getParagraphDirection

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getParagraphDirection(offset: Int): ResolvedTextDirection
```

Get the text direction of the paragraph containing the given offset.

| Parameters |
|---|---|
| `offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | a character offset |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/ResolvedTextDirection` | the paragraph direction |

### getPathForRange

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getPathForRange(start: Int, end: Int): Path
```

Returns path that enclose the given text range.

| Parameters |
|---|---|
| `start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | an inclusive start character offset |
| `end: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | an exclusive end character offset |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Path` | a drawing path |

### getWordBoundary

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun getWordBoundary(offset: Int): TextRange
```

Returns the text range of the word at the given character offset.

Characters not part of a word, such as spaces, symbols, and punctuation, have word breaks on both sides. In such cases, this method will return a text range that contains the given character offset.

Word boundaries are defined more precisely in Unicode Standard Annex #29 <http://www.unicode.org/reports/tr29/#Word_Boundaries>.

### hashCode

Cmn

```
open fun hashCode(): Int
```

### isLineEllipsized

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun isLineEllipsized(lineIndex: Int): Boolean
```

Returns true if the given line is ellipsized, otherwise returns false.

| Parameters |
|---|---|
| `lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | a 0 based line index |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if the given line is ellipsized, otherwise false |

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### didOverflowHeight

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val didOverflowHeight: Boolean
```

True if the text height exceeds the layout boundaries.

### didOverflowWidth

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val didOverflowWidth: Boolean
```

True if the text width exceeds the layout boundaries.

### firstBaseline

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val firstBaseline: Float
```

The distance from the top to the alphabetic baseline of the first line.

### hasVisualOverflow

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val hasVisualOverflow: Boolean
```

True if the text overflows vertically or horizontally.

### lastBaseline

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val lastBaseline: Float
```

The distance from the top to the alphabetic baseline of the last line.

### layoutInput

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val layoutInput: TextLayoutInput
```

The input parameters used for this layout.

### lineCount

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val lineCount: Int
```

Returns a number of lines of this text layout

### multiParagraph

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val multiParagraph: MultiParagraph
```

The computed `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraph` layout.

### placeholderRects

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val placeholderRects: List<Rect?>
```

Returns a list of bounding boxes that is reserved for `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#placeholders()`. Each `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` in this list corresponds to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder` passed to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#placeholders()` and it will have the height and width specified in the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder`. It's guaranteed that `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#placeholders()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#placeholderRects()` will have same length and order.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput#placeholders()` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder` |   |

### size

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val size: IntSize
```

The width and height of this text layout.

Unlike `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult#(androidx.compose.ui.text.TextLayoutInput,androidx.compose.ui.text.MultiParagraph,androidx.compose.ui.unit.IntSize)` dimensions, this size respects the input constraints.