<div class='type'>Interface</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>



```kotlin
interface TextAutoSize
```


Interface used by Text composables to override text size to automatically grow or shrink text to
fill the layout bounds.


## Functions



<h2 id="getfontsize-constraints-text">getFontSize</h2>

```kotlin
fun TextAutoSizeLayoutScope.getFontSize(
        constraints: Constraints,
        text: AnnotatedString,
    ): TextUnit
```


Calculates font size and provides access to `TextAutoSizeLayoutScope`, which offers
`TextAutoSizeLayoutScope.performLayout` to lay out the text and use the measured size.

#### Returns

| | |
| --- | --- |
|  | The derived optimal font size |





<hr class="docs-overload-divider">


<h2 id="equals-other">equals</h2>

```kotlin
override fun equals(other: Any?): Boolean
```


This type is used in performance-sensitive paths and requires providing equality guarantees.
Using a data class is sufficient. Singletons may implement this function with referential
equality (`this === other`). Instances with no properties may implement this function by
checking the type of the other object.

#### Returns

| | |
| --- | --- |
|  | true if both AutoSize instances are identical. |





<hr class="docs-overload-divider">


<h2 id="hashcode">hashCode</h2>

```kotlin
override fun hashCode(): Int
```


This type is used in performance-sensitive paths and requires providing identity guarantees.

#### Returns

| | |
| --- | --- |
|  | a unique hashcode for this AutoSize instance. |