# TextInclusionStrategy

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

  ```
  fun interface TextInclusionStrategy
  ```

*** ** * ** ***

The text inclusion strategy used by `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)`, it specifies when a range of text is inside the given rect based on the geometric relation between the text range's bounding box and the given rect.

| See also |
|---|---|
| `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)` |   |

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy#AnyOverlap()` The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy` that includes the text range whose bounds has any overlap with the given rect. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy#ContainsAll()` The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy` that includes the text range whose bounds is completely contained by the given rect. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy#ContainsCenter()` The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy` that includes the text range whose bounds' center is contained by the given rect. | Cmn |

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy#isIncluded(androidx.compose.ui.geometry.Rect,androidx.compose.ui.geometry.Rect)(textBounds: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect, rect: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect)` Returns true if this `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy` considers the text range's `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy#isIncluded(androidx.compose.ui.geometry.Rect,androidx.compose.ui.geometry.Rect)` to be inside the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy#isIncluded(androidx.compose.ui.geometry.Rect,androidx.compose.ui.geometry.Rect)`. | Cmn |

## Public companion properties

### AnyOverlap

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

```
val AnyOverlap: TextInclusionStrategy
```

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy` that includes the text range whose bounds has any overlap with the given rect.

### ContainsAll

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

```
val ContainsAll: TextInclusionStrategy
```

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy` that includes the text range whose bounds is completely contained by the given rect.

### ContainsCenter

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

```
val ContainsCenter: TextInclusionStrategy
```

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy` that includes the text range whose bounds' center is contained by the given rect.

## Public functions

### isIncluded

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

```
fun isIncluded(textBounds: Rect, rect: Rect): Boolean
```

Returns true if this `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy` considers the text range's `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy#isIncluded(androidx.compose.ui.geometry.Rect,androidx.compose.ui.geometry.Rect)` to be inside the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextInclusionStrategy#isIncluded(androidx.compose.ui.geometry.Rect,androidx.compose.ui.geometry.Rect)`.

| Parameters |
|---|---|
| `textBounds: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | the bounding box of a range of the text. |
| `rect: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` | a rectangle area. |