# Paragraph

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/Paragraph.+class:androidx.compose.ui.text.Paragraph) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  sealed interface Paragraph
  ```
- android

  ```
  interface Paragraph
  ```

*** ** * ** ***

Renders a single laid out paragraph of text.

Draw the paragraph onto a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas` using `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#paint(androidx.compose.ui.graphics.Canvas,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)`.

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#fillBoundingBoxes(androidx.compose.ui.text.TextRange,kotlin.FloatArray,kotlin.Int)( range: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange, array: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html, arrayStart: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Fills the bounding boxes for characters provided in the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#fillBoundingBoxes(androidx.compose.ui.text.TextRange,kotlin.FloatArray,kotlin.Int)` into `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#fillBoundingBoxes(androidx.compose.ui.text.TextRange,kotlin.FloatArray,kotlin.Int)`. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/ResolvedTextDirection` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getBidiRunDirection(kotlin.Int)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Get the text direction of the character at the given offset. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getBoundingBox(kotlin.Int)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the bounding box as Rect of the character for given character offset. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getCursorRect(kotlin.Int)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns rectangle of the cursor area. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#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)` Compute the horizontal position where a newly inserted character at `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getHorizontalPosition(kotlin.Int,kotlin.Boolean)` would be. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getLineBaseline(kotlin.Int)(lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the distance from the top of the paragraph to the alphabetic baseline of the given line. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#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 android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#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 android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#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 android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#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 android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getLineHeight(kotlin.Int)(lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the height of the given line. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#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 android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#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 android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#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 android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getLineTop(kotlin.Int)(lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the bottom y coordinate of the given line. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getLineWidth(kotlin.Int)(lineIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the width of the given line. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#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 android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/ResolvedTextDirection` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#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 android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Path` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#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 android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getRangeForRect(androidx.compose.ui.geometry.Rect,androidx.compose.ui.text.TextGranularity,androidx.compose.ui.text.TextInclusionStrategy)( rect: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect, granularity: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextGranularity, inclusionStrategy: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy )` Find the range of text which is inside the specified `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getRangeForRect(androidx.compose.ui.geometry.Rect,androidx.compose.ui.text.TextGranularity,androidx.compose.ui.text.TextInclusionStrategy)`. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getWordBoundary(kotlin.Int)(offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the TextRange of the word at the given character offset. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#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 android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#paint(androidx.compose.ui.graphics.Canvas,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration)( canvas: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas, color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, shadow: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shadow?, textDecoration: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration? )` | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#paint(androidx.compose.ui.graphics.Canvas,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)( canvas: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas, color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, shadow: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shadow?, textDecoration: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration?, drawStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawStyle?, blendMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode )` Draws this paragraph onto `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#paint(androidx.compose.ui.graphics.Canvas,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)` with optional style overrides. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#paint(androidx.compose.ui.graphics.Canvas,androidx.compose.ui.graphics.Brush,kotlin.Float,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)( canvas: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas, brush: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush, alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, shadow: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shadow?, textDecoration: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration?, drawStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawStyle?, blendMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode )` Draws this paragraph onto `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#paint(androidx.compose.ui.graphics.Canvas,androidx.compose.ui.graphics.Brush,kotlin.Float,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)` with optional style overrides. | Cmn android |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#didExceedMaxLines()` True if there is more vertical content, but the text was truncated, either because we reached `maxLines` lines of text or because the `maxLines` was null, `ellipsis` was not null, and one of the lines exceeded the width constraint. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#firstBaseline()` The distance from the top of the paragraph to the alphabetic baseline of the first line, in logical pixels. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#height()` The amount of vertical space this paragraph occupies. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#lastBaseline()` The distance from the top of the paragraph to the alphabetic baseline of the last line, in logical pixels. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#lineCount()` The total number of lines in the text. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#maxIntrinsicWidth()` Returns the smallest width beyond which increasing the width never decreases the height. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#minIntrinsicWidth()` The width for text if all soft wrap opportunities were taken. | Cmn android |
| `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/Paragraph#placeholderRects()` The bounding boxes reserved for the input placeholders in this Paragraphs. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#width()` The amount of horizontal space this paragraph occupies. | Cmn android |

## Public functions

### fillBoundingBoxes

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

```
fun fillBoundingBoxes(
    range: TextRange,
    array: FloatArray,
    arrayStart: @IntRange(from = 0) Int
): Unit
```

Fills the bounding boxes for characters provided in the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#fillBoundingBoxes(androidx.compose.ui.text.TextRange,kotlin.FloatArray,kotlin.Int)` into `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#fillBoundingBoxes(androidx.compose.ui.text.TextRange,kotlin.FloatArray,kotlin.Int)`. The array is filled starting from `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#fillBoundingBoxes(androidx.compose.ui.text.TextRange,kotlin.FloatArray,kotlin.Int)` (inclusive). The coordinates are in local text layout coordinates.

The returned information consists of left/right of a character; line top and bottom for the same character.

For the grapheme consists of multiple code points, e.g. ligatures, combining marks, the first character has the total width and the remaining are returned as zero-width.

The array divided into segments of four where each index in that segment represents left, top, right, bottom of the character.

The size of the provided `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#fillBoundingBoxes(androidx.compose.ui.text.TextRange,kotlin.FloatArray,kotlin.Int)` should be greater or equal than the four times \* `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange` length.

The final order of characters in the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#fillBoundingBoxes(androidx.compose.ui.text.TextRange,kotlin.FloatArray,kotlin.Int)` is from `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#min()` to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#max()`.

| Parameters |
|---|---|
| `range: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange` representing the start and end indices in the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph`. |
| `array: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html` | the array to fill in the values. The array divided into segments of four where each index in that segment represents left, top, right, bottom of the character. |
| `arrayStart: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the inclusive start index in the array where the function will start filling in the values from |

### getBidiRunDirection

Cmn android 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 character at the given offset.

### getBoundingBox

Cmn android 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 as Rect of the character for given character offset. Rect includes the top, bottom, left and right of a character.

### getCursorRect

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

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

Returns rectangle of the cursor area.

### getHorizontalPosition

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

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

Compute the horizontal position where a newly inserted character at `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getHorizontalPosition(kotlin.Int,kotlin.Boolean)` would be.

If the inserted character at `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getHorizontalPosition(kotlin.Int,kotlin.Boolean)` is within a LTR/RTL run, the returned position will be the left(right) edge of the character.

```kotlin
For example:
    Paragraph's direction is LTR.
    Text in logic order:               L0 L1 L2 R3 R4 R5
    Text in visual order:              L0 L1 L2 R5 R4 R3
        position of the offset(2):          |
        position of the offset(4):                   |
```

However, when the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getHorizontalPosition(kotlin.Int,kotlin.Boolean)` is at the BiDi transition offset, there will be two possible visual positions, which depends on the direction of the inserted character.

```kotlin
For example:
    Paragraph's direction is LTR.
    Text in logic order:               L0 L1 L2 R3 R4 R5
    Text in visual order:              L0 L1 L2 R5 R4 R3
        position of the offset(3):             |           (The inserted character is LTR)
                                                        |  (The inserted character is RTL)
```

In this case, `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getHorizontalPosition(kotlin.Int,kotlin.Boolean)` will be used to resolve the ambiguity. If true, the inserted character's direction is assumed to be the same as Paragraph's direction. Otherwise, the inserted character's direction is assumed to be the opposite of the Paragraph's direction.

```kotlin
For example:
    Paragraph's direction is LTR.
    Text in logic order:               L0 L1 L2 R3 R4 R5
    Text in visual order:              L0 L1 L2 R5 R4 R3
        position of the offset(3):             |           (usePrimaryDirection is true)
                                                        |  (usePrimaryDirection is false)
```

This method is useful to compute cursor position.

| Parameters |
|---|---|
| `offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the offset of the character, in the range of 0, length. |
| `usePrimaryDirection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | whether the paragraph direction is respected when `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getHorizontalPosition(kotlin.Int,kotlin.Boolean)` points to a BiDi transition point. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | a float number representing the horizontal position in the unit of pixel. |

### getLineBaseline

Cmn android 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 from the top of the paragraph to the alphabetic baseline of the given line.

### getLineBottom

Cmn android 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.

### getLineEnd

Cmn android 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

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 verse.

| 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 android 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.

### getLineForVerticalPosition

Cmn android 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.

### getLineHeight

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

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

Returns the height of the given line.

### getLineLeft

Cmn android 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.

### getLineRight

Cmn android 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.

### getLineStart

Cmn android 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.

### getLineTop

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

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

Returns the bottom y coordinate of the given line.

### getLineWidth

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

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

Returns the width of the given line.

### getOffsetForPosition

Cmn android 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.

### getParagraphDirection

Cmn android 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.

### getPathForRange

Cmn android 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.

### getRangeForRect

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

```
fun getRangeForRect(
    rect: Rect,
    granularity: TextGranularity,
    inclusionStrategy: TextInclusionStrategy
): TextRange
```

Find the range of text which is inside the specified `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getRangeForRect(androidx.compose.ui.geometry.Rect,androidx.compose.ui.text.TextGranularity,androidx.compose.ui.text.TextInclusionStrategy)`. This method will break text into small text segments based on the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getRangeForRect(androidx.compose.ui.geometry.Rect,androidx.compose.ui.text.TextGranularity,androidx.compose.ui.text.TextInclusionStrategy)` such as character or word. It also support different `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getRangeForRect(androidx.compose.ui.geometry.Rect,androidx.compose.ui.text.TextGranularity,androidx.compose.ui.text.TextInclusionStrategy)`, which determines when a small text segments is considered as inside the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getRangeForRect(androidx.compose.ui.geometry.Rect,androidx.compose.ui.text.TextGranularity,androidx.compose.ui.text.TextInclusionStrategy)`. Note that the word/character breaking is both operating system and language dependent. In the certain cases, the text may be break into smaller segments than the specified the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getRangeForRect(androidx.compose.ui.geometry.Rect,androidx.compose.ui.text.TextGranularity,androidx.compose.ui.text.TextInclusionStrategy)`. If a text segment spans multiple lines or multiple directional runs (e.g. a hyphenated word), the text segment is divided into pieces at the line and run breaks, then the text segment is considered to be inside the area if any of its pieces are inside the area.

| Parameters |
|---|---|
| `rect: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | the rectangle area in which the text range will be found. |
| `granularity: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextGranularity` | the granularity of the text, it controls how text is segmented. |
| `inclusionStrategy: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy` | the strategy that determines whether a range of text's bounds is inside the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getRangeForRect(androidx.compose.ui.geometry.Rect,androidx.compose.ui.text.TextGranularity,androidx.compose.ui.text.TextInclusionStrategy)` or not. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange` that is inside the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#getRangeForRect(androidx.compose.ui.geometry.Rect,androidx.compose.ui.text.TextGranularity,androidx.compose.ui.text.TextInclusionStrategy)`, or `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#Zero()` if no text is found. |

### getWordBoundary

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

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

Returns the TextRange 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 TextRange(offset, offset). Word boundaries are defined more precisely in Unicode Standard Annex #29 http://www.unicode.org/reports/tr29/#Word_Boundaries

### isLineEllipsized

Cmn android 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 |

### paint

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

```
fun paint(
    canvas: Canvas,
    color: Color,
    shadow: Shadow?,
    textDecoration: TextDecoration?
): Unit
```

### paint

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

```
fun paint(
    canvas: Canvas,
    color: Color = Color.Unspecified,
    shadow: Shadow? = null,
    textDecoration: TextDecoration? = null,
    drawStyle: DrawStyle? = null,
    blendMode: BlendMode = DrawScope.DefaultBlendMode
): Unit
```

Draws this paragraph onto `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#paint(androidx.compose.ui.graphics.Canvas,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)` with optional style overrides.

Overriding parameters permanently changes the paragraph style, affecting subsequent `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#paint(androidx.compose.ui.graphics.Canvas,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)` calls.

| Parameters |
|---|---|
| `canvas: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas` | canvas to draw on |
| `color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | overrides the default text color but does not override `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle#color()` or `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle#brush()` spans. `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color#Unspecified()` keeps the current color |
| `shadow: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shadow? = null` | overrides the default text shadow but does not override `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle#shadow()` spans. `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shadow#None()` removes the shadow, while null keeps the current shadow |
| `textDecoration: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration? = null` | overrides the default text decoration but does not override `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle#textDecoration()` spans. `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#None()` removes the decoration, while null keeps the current decoration |
| `drawStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawStyle? = null` | overrides the default draw style but does not override `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle#drawStyle()` spans. null keeps the current draw style |
| `blendMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode = DrawScope.DefaultBlendMode` | blend mode to apply during painting |

### paint

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

```
fun paint(
    canvas: Canvas,
    brush: Brush,
    alpha: Float = Float.NaN,
    shadow: Shadow? = null,
    textDecoration: TextDecoration? = null,
    drawStyle: DrawStyle? = null,
    blendMode: BlendMode = DrawScope.DefaultBlendMode
): Unit
```

Draws this paragraph onto `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#paint(androidx.compose.ui.graphics.Canvas,androidx.compose.ui.graphics.Brush,kotlin.Float,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)` with optional style overrides.

Overriding parameters permanently changes the paragraph style, affecting subsequent `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#paint(androidx.compose.ui.graphics.Canvas,androidx.compose.ui.graphics.Brush,kotlin.Float,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)` calls.

| Parameters |
|---|---|
| `canvas: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas` | canvas to draw on |
| `brush: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush` | overrides the default text brush but does not override `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle#color()` or `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle#brush()` spans. `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#paint(androidx.compose.ui.graphics.Canvas,androidx.compose.ui.graphics.Brush,kotlin.Float,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)` sets the opacity of `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/SolidColor`. Creates the shader using layout size for `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ShaderBrush` |
| `alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Float.NaN` | opacity for `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#paint(androidx.compose.ui.graphics.Canvas,androidx.compose.ui.graphics.Brush,kotlin.Float,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)` (0.0 to 1.0), or `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/-companion/-na-n.html` to keep the current alpha |
| `shadow: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shadow? = null` | overrides the default text shadow but does not override `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle#shadow()` spans. `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shadow#None()` removes the shadow, while null keeps the current shadow |
| `textDecoration: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration? = null` | overrides the default text decoration but does not override `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle#textDecoration()` spans. `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration#None()` removes the decoration, while null keeps the current decoration |
| `drawStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawStyle? = null` | overrides the default draw style but does not override `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle#drawStyle()` spans. null keeps the current draw style |
| `blendMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode = DrawScope.DefaultBlendMode` | blend mode to apply during painting |

## Public properties

### didExceedMaxLines

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

```
val didExceedMaxLines: Boolean
```

True if there is more vertical content, but the text was truncated, either because we reached `maxLines` lines of text or because the `maxLines` was null, `ellipsis` was not null, and one of the lines exceeded the width constraint.

See the discussion of the `maxLines` and `ellipsis` arguments at `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle`.

### firstBaseline

Cmn android 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 of the paragraph to the alphabetic baseline of the first line, in logical pixels.

### height

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

```
val height: Float
```

The amount of vertical space this paragraph occupies.

### lastBaseline

Cmn android 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 of the paragraph to the alphabetic baseline of the last line, in logical pixels.

### lineCount

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

```
val lineCount: Int
```

The total number of lines in the text.

### maxIntrinsicWidth

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

```
val maxIntrinsicWidth: Float
```

Returns the smallest width beyond which increasing the width never decreases the height.

### minIntrinsicWidth

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

```
val minIntrinsicWidth: Float
```

The width for text if all soft wrap opportunities were taken.

### placeholderRects

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

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

The bounding boxes reserved for the input placeholders in this Paragraphs. Their locations are relative to this Paragraph's coordinate. The order of this list corresponds to that of input placeholders. Notice that `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` in `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph#placeholderRects()` is nullable. When `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` is null, it indicates that the corresponding `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder` is ellipsized.

### width

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

```
val width: Float
```

The amount of horizontal space this paragraph occupies.