# androidx.compose.ui.text

Common/AllAndroid/JVM

In this page, you'll find documentation for types, properties, and functions available in the `androidx.compose.ui.text` package such as `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).toUpperCase(androidx.compose.ui.text.intl.LocaleList)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#buildAnnotatedString(kotlin.Function1)`, and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.CharSequence).substring(androidx.compose.ui.text.TextRange)`.

If you're looking for guidance instead, check out the [Text in Compose guide](https://developer.android.com/jetpack/compose/text).

## Interfaces

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Annotation` | Defines annotations that specify additional information to apply to ranges of text within the given AnnotatedString. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkInteractionListener` | An interface triggered when a user interacts with a link in the text | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph` | Renders a single laid out paragraph of text. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` | Calculates and presents the intrinsic width and height of text. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/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. | Cmn |

## Classes

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | Text with multiple styles. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder` | Builds an `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` incrementally. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.BulletScope` | Scope for a bullet list | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range` | The information attached on the text such as a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Bullet` | Draws a bullet point next to a paragraph. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/EmojiSupportMatch` | When to replace emoji with support emoji using androidx.emoji2. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkAnnotation` | An annotation that represents a clickable part of the text. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkAnnotation.Clickable` | An annotation that contains a clickable marked with `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkAnnotation.Clickable#tag()`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkAnnotation.Url` | An annotation that contains a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkAnnotation.Url#url()` string. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraph` | Lays out and renders multiple paragraphs at once. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/MultiParagraphIntrinsics` | Calculates and provides the intrinsic width and height of text that contains `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle` | Paragraph styling configuration. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder` | A placeholder is a rectangle box inserted into text, which tells the text processor to leave an empty space. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlaceholderVerticalAlign` | The settings used to specify how a placeholder is vertically aligned within a text line. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformParagraphStyle` | Provides platform specific `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle` configuration options for styling and compatibility. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformSpanStyle` | Provides platform specific `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle` configuration options for styling and compatibility. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle` | Provides platform specific `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` configuration options for styling and compatibility. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle` | Styling configuration that applies at the character level. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/StringAnnotation` | An `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Annotation` class which holds a String `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/StringAnnotation#value()`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextGranularity` | 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)`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutInput` | Holds parameters used to compute text layout. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult` | Holds the result of a text layout computation. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLinkStyles` | Represents the styles of the links in the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` in different states | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer` | Measures text to prepare it for drawing. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange` | An immutable text range class, represents a text range from `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#start()` (inclusive) to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#end()` (exclusive). | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` | Styling configuration for text. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TtsAnnotation` | An annotation that contains the metadata intended for text-to-speech engine. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation` | **This class is deprecated.** Use LinkAnnotatation.Url(url) instead | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/VerbatimTtsAnnotation` | The text associated with this annotation is a series of characters that have to be read verbatim. | Cmn |

## Objects

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AndroidComposeUiTextFlags` | This is a collection of flags which are used to guard against regressions in some of the "riskier" refactors or new feature support that is added to this module. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Companion` |   | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextPainter` |   | Cmn |

## Annotations

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ExperimentalTextApi` |   | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/InternalTextApi` |   | Cmn |

## Composables

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/rememberTextMeasurer.composable` | Creates and remembers a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer`. | Cmn |

## Top-level functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#AnnotatedString(kotlin.String,androidx.compose.ui.text.ParagraphStyle)(text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, paragraphStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle)` Create an AnnotatedString with a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#AnnotatedString(kotlin.String,androidx.compose.ui.text.ParagraphStyle)` that will apply to the whole text. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#AnnotatedString(kotlin.String,androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.ParagraphStyle)( text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, spanStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle, paragraphStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle? )` Create an AnnotatedString with a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#AnnotatedString(kotlin.String,androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.ParagraphStyle)` that will apply to the whole text. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(androidx.compose.ui.text.ParagraphIntrinsics,androidx.compose.ui.unit.Constraints,kotlin.Int,androidx.compose.ui.text.style.TextOverflow)( paragraphIntrinsics: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics, constraints: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow )` Lays out the text in `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` with the given constraints. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph` | `[Paragraph](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(androidx.compose.ui.text.ParagraphIntrinsics,kotlin.Int,kotlin.Boolean,kotlin.Float))( paragraphIntrinsics: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, ellipsis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` **This function is deprecated.** Paragraph that takes maximum allowed width is deprecated, pass constraints instead. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph` | `[Paragraph](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,androidx.compose.ui.unit.Constraints,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.collections.List,kotlin.Int,androidx.compose.ui.text.style.TextOverflow))( text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, constraints: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver, spanStyles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle>>, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow )` **This function is deprecated.** Paragraph that doesn't take a default locale list is deprecated, pass a LocaleList instead | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph` | `[Paragraph](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.collections.List,kotlin.Int,kotlin.Boolean,kotlin.Float,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.Font.ResourceLoader))( text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, spanStyles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle>>, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, ellipsis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, resourceLoader: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font.ResourceLoader )` **This function is deprecated.** Font.ResourceLoader is deprecated, instead pass FontFamily.Resolver | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph` | `[Paragraph](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.Float,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.collections.List,kotlin.Int,kotlin.Boolean))( text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver, spanStyles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle>>, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, ellipsis: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` **This function is deprecated.** Paragraph that takes maximum allowed width is deprecated, pass constraints instead. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Paragraph` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,androidx.compose.ui.unit.Constraints,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,androidx.compose.ui.text.intl.LocaleList,kotlin.collections.List,kotlin.collections.List,kotlin.Int,androidx.compose.ui.text.style.TextOverflow)( text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, constraints: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver, defaultLocaleList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList, spanStyles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle>>, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow )` Lays out a given `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,androidx.compose.ui.unit.Constraints,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,androidx.compose.ui.text.intl.LocaleList,kotlin.collections.List,kotlin.collections.List,kotlin.Int,androidx.compose.ui.text.style.TextOverflow)` with the given constraints. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` | `[ParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List))( text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, annotations: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Annotation>>, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>> )` **This function is deprecated.** Use an override with \`softWrap\` | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` | `[ParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver))( text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, spanStyles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle>>, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver )` **This function is deprecated.** Use an overload that takes \`annotations\` instead | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` | `[ParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.Font.ResourceLoader))( text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, spanStyles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle>>, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, resourceLoader: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/Font.ResourceLoader )` **This function is deprecated.** Font.ResourceLoader is deprecated, instead use FontFamily.Resolver | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` | `[ParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.Boolean))( text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, annotations: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Annotation>>, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` **This function is deprecated.** Use an override with \`defaultLocaleList\` | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.Boolean,androidx.compose.ui.text.intl.LocaleList)( text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, annotations: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Annotation>>, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density, fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, defaultLocaleList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList )` Factory method to create a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.Boolean,androidx.compose.ui.text.intl.LocaleList)`. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#TextRange(kotlin.Int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#TextRange(kotlin.Int)` where start is equal to end, and the value of those are `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#TextRange(kotlin.Int)`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#TextRange(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)` An immutable text range class, represents a text range from `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#TextRange(kotlin.Int,kotlin.Int)` (inclusive) to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#TextRange(kotlin.Int,kotlin.Int)` (exclusive). | Cmn |
| `inline https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#buildAnnotatedString(kotlin.Function1)(builder: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Build a new AnnotatedString by populating newly created `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder` provided by `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#buildAnnotatedString(kotlin.Function1)`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.ParagraphStyle,androidx.compose.ui.text.ParagraphStyle,kotlin.Float)(start: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle, stop: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle, fraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Interpolate between two `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle`s. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformParagraphStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformParagraphStyle,androidx.compose.ui.text.PlatformParagraphStyle,kotlin.Float)( start: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformParagraphStyle, stop: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformParagraphStyle, fraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Interpolate between two PlatformParagraphStyle's. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformSpanStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformSpanStyle,kotlin.Float)(start: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformSpanStyle, stop: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformSpanStyle, fraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Interpolate between two PlatformSpanStyle's. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.SpanStyle,kotlin.Float)(start: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle, stop: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle, fraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Interpolate between two span styles. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.TextStyle,kotlin.Float)(start: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, stop: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, fraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Interpolate between two text styles. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#resolveDefaults(androidx.compose.ui.text.TextStyle,androidx.compose.ui.unit.LayoutDirection)(style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, direction: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection)` Fills missing values in TextStyle with default values and resolve `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDirection`. | Cmn |

## Extension functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.[capitalize](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).capitalize(androidx.compose.ui.text.intl.LocaleList))(localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList)` **This function is deprecated.** This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html.[capitalize](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.String).capitalize(androidx.compose.ui.text.intl.LocaleList))(localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList)` **This function is deprecated.** This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).capitalize(androidx.compose.ui.text.intl.Locale)(locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale)` Create capitalized `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.String).capitalize(androidx.compose.ui.text.intl.Locale)(locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale)` Returns capitalized String. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.TextRange).coerceIn(kotlin.Int,kotlin.Int)(minimumValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, maximumValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Ensures that `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#start()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#end()` values lies in the specified range `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.TextRange).coerceIn(kotlin.Int,kotlin.Int)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.TextRange).coerceIn(kotlin.Int,kotlin.Int)`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.[decapitalize](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).decapitalize(androidx.compose.ui.text.intl.LocaleList))(localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList)` **This function is deprecated.** This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html.[decapitalize](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.String).decapitalize(androidx.compose.ui.text.intl.LocaleList))(localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList)` **This function is deprecated.** This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).decapitalize(androidx.compose.ui.text.intl.Locale)(locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale)` Create decapitalized `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.String).decapitalize(androidx.compose.ui.text.intl.Locale)(locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale)` Returns decapitalized String. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextLayoutResult,androidx.compose.ui.graphics.Brush,androidx.compose.ui.geometry.Offset,kotlin.Float,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)( textLayoutResult: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult, brush: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush, topLeft: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, 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 )` Draw an existing text layout as produced by `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextLayoutResult,androidx.compose.ui.graphics.Color,androidx.compose.ui.geometry.Offset,kotlin.Float,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)( textLayoutResult: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult, color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, topLeft: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, 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 )` Draw an existing text layout as produced by `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,kotlin.String,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)( textMeasurer: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer, text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, topLeft: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow, softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, size: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size, blendMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode )` Draw text using a TextMeasurer. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,kotlin.collections.List,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)( textMeasurer: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer, text: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString, topLeft: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset, style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow, softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>, size: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size, blendMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode )` Draw styled text using a TextMeasurer. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Companion.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Companion).fromHtml(kotlin.String,androidx.compose.ui.text.TextLinkStyles,androidx.compose.ui.text.LinkInteractionListener)( htmlString: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, linkStyles: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLinkStyles?, linkInteractionListener: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkInteractionListener? )` Converts a string with HTML tags into `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.CharSequence).substring(androidx.compose.ui.text.TextRange)(range: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange)` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.[toLowerCase](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).toLowerCase(androidx.compose.ui.text.intl.LocaleList))(localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList)` **This function is deprecated.** This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html.[toLowerCase](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.String).toLowerCase(androidx.compose.ui.text.intl.LocaleList))(localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList)` **This function is deprecated.** This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).toLowerCase(androidx.compose.ui.text.intl.Locale)(locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale)` Create lower case transformed `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.String).toLowerCase(androidx.compose.ui.text.intl.Locale)(locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale)` Returns lowercase transformed String. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.[toUpperCase](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).toUpperCase(androidx.compose.ui.text.intl.LocaleList))(localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList)` **This function is deprecated.** This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html.[toUpperCase](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.String).toUpperCase(androidx.compose.ui.text.intl.LocaleList))(localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList)` **This function is deprecated.** This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).toUpperCase(androidx.compose.ui.text.intl.Locale)(locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale)` Create upper case transformed `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.String).toUpperCase(androidx.compose.ui.text.intl.Locale)(locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale)` Returns uppercase transformed String. | Cmn |
| `inline R` | `<R : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withAnnotation(androidx.compose.ui.text.TtsAnnotation,kotlin.Function1)( ttsAnnotation: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TtsAnnotation, crossinline block: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> R )` Pushes an `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TtsAnnotation` to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder`, executes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withAnnotation(androidx.compose.ui.text.TtsAnnotation,kotlin.Function1)` and then pops the annotation. | Cmn |
| `inline R` | `@https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ExperimentalTextApi <R : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.[withAnnotation](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withAnnotation(androidx.compose.ui.text.UrlAnnotation,kotlin.Function1))( urlAnnotation: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation, crossinline block: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> R )` **This function is deprecated.** Use LinkAnnotation API for links instead | Cmn |
| `inline R` | `<R : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withAnnotation(kotlin.String,kotlin.String,kotlin.Function1)( tag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, annotation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, crossinline block: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> R )` Pushes an annotation to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder`, executes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withAnnotation(kotlin.String,kotlin.String,kotlin.Function1)` and then pops the annotation. | Cmn |
| `inline R` | `<R : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withLink(androidx.compose.ui.text.LinkAnnotation,kotlin.Function1)( link: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkAnnotation, block: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> R )` Pushes a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkAnnotation` to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder`, executes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withLink(androidx.compose.ui.text.LinkAnnotation,kotlin.Function1)` and then pops the annotation. | Cmn |
| `inline R` | `<R : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.ParagraphStyle,kotlin.Function1)( style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle, crossinline block: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> R )` Pushes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.ParagraphStyle,kotlin.Function1)` to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder`, executes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.ParagraphStyle,kotlin.Function1)` and then pops the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.ParagraphStyle,kotlin.Function1)`. | Cmn |
| `inline R` | `<R : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.SpanStyle,kotlin.Function1)(style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle, block: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> R)` Pushes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.SpanStyle,kotlin.Function1)` to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder`, executes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.SpanStyle,kotlin.Function1)` and then pops the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.SpanStyle,kotlin.Function1)`. | Cmn |

## Top-level functions

### AnnotatedString

Cmn 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/AnnotatedString.kt+function:AnnotatedString) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun AnnotatedString(text: String, paragraphStyle: ParagraphStyle): AnnotatedString
```

Create an AnnotatedString with a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#AnnotatedString(kotlin.String,androidx.compose.ui.text.ParagraphStyle)` that will apply to the whole text.

| Parameters |
|---|---|
| `text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the text to be styled |
| `paragraphStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle` to be applied to whole text |

### AnnotatedString

Cmn 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/AnnotatedString.kt+function:AnnotatedString) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun AnnotatedString(
    text: String,
    spanStyle: SpanStyle,
    paragraphStyle: ParagraphStyle? = null
): AnnotatedString
```

Create an AnnotatedString with a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#AnnotatedString(kotlin.String,androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.ParagraphStyle)` that will apply to the whole text.

| Parameters |
|---|---|
| `text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the text to be styled |
| `spanStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle` to be applied to whole text |
| `paragraphStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle? = null` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle` to be applied to whole text |

### Paragraph

Cmn android 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.+function:Paragraph) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun Paragraph(
    paragraphIntrinsics: ParagraphIntrinsics,
    constraints: Constraints,
    maxLines: Int = DefaultMaxLines,
    overflow: TextOverflow = TextOverflow.Clip
): Paragraph
```

Lays out the text in `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` with the given constraints. A paragraph is a text that has a single `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle`.

| Parameters |
|---|---|
| `paragraphIntrinsics: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphIntrinsics` instance |
| `constraints: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints` | how wide and tall the text is allowed to be. `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints#maxWidth()` will define the width of the Paragraph. `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints#maxHeight()` helps defining the number of lines that fit with ellipsis is true. Minimum components of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints` object are no-op. |
| `maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = DefaultMaxLines` | the maximum number of lines that the text can have |
| `overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow = TextOverflow.Clip` | specifies how visual overflow should be handled |

### Paragraph

Cmn android 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.+function:Paragraph) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
fun [Paragraph](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(androidx.compose.ui.text.ParagraphIntrinsics,kotlin.Int,kotlin.Boolean,kotlin.Float))(
    paragraphIntrinsics: ParagraphIntrinsics,
    maxLines: Int = DefaultMaxLines,
    ellipsis: Boolean = false,
    width: Float
): Paragraph
```

> [!CAUTION]
> **This function is deprecated.**   
> Paragraph that takes maximum allowed width is deprecated, pass constraints instead, use this instead:
>
> ```kotlin
> Paragraph(paragraphIntrinsics, Constraints(maxWidth = ceil(width).toInt()), maxLines, if (ellipsis) TextOverflow.Ellipsis else TextOverflow.Clip)
> ```

### Paragraph

Cmn android 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.+function:Paragraph) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0) Deprecated in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun [Paragraph](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,androidx.compose.ui.unit.Constraints,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.collections.List,kotlin.Int,androidx.compose.ui.text.style.TextOverflow))(
    text: String,
    style: TextStyle,
    constraints: Constraints,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
    placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
    maxLines: Int = DefaultMaxLines,
    overflow: TextOverflow = TextOverflow.Clip
): Paragraph
```

> [!CAUTION]
> **This function is deprecated.**   
> Paragraph that doesn't take a default locale list is deprecated, pass a LocaleList instead

Lays out a given `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,androidx.compose.ui.unit.Constraints,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.collections.List,kotlin.Int,androidx.compose.ui.text.style.TextOverflow)` with the given constraints. A paragraph is a text that has a single `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle`.

If the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,androidx.compose.ui.unit.Constraints,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.collections.List,kotlin.Int,androidx.compose.ui.text.style.TextOverflow)` does not contain any `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDirection`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDirection#Content()` is used as the default value.

| Parameters |
|---|---|
| `text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the text to be laid out |
| `style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` to be applied to the whole text |
| `constraints: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints` | how wide and tall the text is allowed to be. `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints#maxWidth()` will define the width of the Paragraph. `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints#maxHeight()` helps defining the number of lines that fit with ellipsis is true. Minimum components of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints` object are no-op. |
| `density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density` | density of the device |
| `fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` to be used to load the font given in `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle`s |
| `spanStyles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle>> = listOf()` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle`s to be applied to parts of text |
| `placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>> = listOf()` | a list of placeholder metrics which tells `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,androidx.compose.ui.unit.Constraints,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.collections.List,kotlin.Int,androidx.compose.ui.text.style.TextOverflow)` where should be left blank to leave space for inline elements. |
| `maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = DefaultMaxLines` | the maximum number of lines that the text can have |
| `overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow = TextOverflow.Clip` | specifies how visual overflow should be handled |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle#textDirection()` is not set |

### Paragraph

Cmn android 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.+function:Paragraph) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
fun [Paragraph](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.collections.List,kotlin.Int,kotlin.Boolean,kotlin.Float,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.Font.ResourceLoader))(
    text: String,
    style: TextStyle,
    spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
    placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
    maxLines: Int = DefaultMaxLines,
    ellipsis: Boolean = false,
    width: Float,
    density: Density,
    resourceLoader: Font.ResourceLoader
): Paragraph
```

> [!CAUTION]
> **This function is deprecated.**   
> Font.ResourceLoader is deprecated, instead pass FontFamily.Resolver, use this instead:
>
> ```kotlin
> Paragraph(text, style, Constraints(maxWidth = ceil(width).toInt()), density, createFontFamilyResolver(resourceLoader), spanStyles, placeholders, maxLines, if (ellipsis) TextOverflow.Ellipsis else TextOverflow.Clip)
> ```

### Paragraph

Cmn android 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.+function:Paragraph) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
fun [Paragraph](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.Float,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.collections.List,kotlin.Int,kotlin.Boolean))(
    text: String,
    style: TextStyle,
    width: Float,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
    placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
    maxLines: Int = DefaultMaxLines,
    ellipsis: Boolean = false
): Paragraph
```

> [!CAUTION]
> **This function is deprecated.**   
> Paragraph that takes maximum allowed width is deprecated, pass constraints instead, use this instead:
>
> ```kotlin
> Paragraph(text, style, Constraints(maxWidth = ceil(width).toInt()), density, fontFamilyResolver, spanStyles, placeholders, maxLines, if (ellipsis) TextOverflow.Ellipsis else TextOverflow.Clip)
> ```

### Paragraph

Cmn android 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.+function:Paragraph) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun Paragraph(
    text: String,
    style: TextStyle,
    constraints: Constraints,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    defaultLocaleList: LocaleList,
    spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
    placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
    maxLines: Int = DefaultMaxLines,
    overflow: TextOverflow = TextOverflow.Clip
): Paragraph
```

Lays out a given `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,androidx.compose.ui.unit.Constraints,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,androidx.compose.ui.text.intl.LocaleList,kotlin.collections.List,kotlin.collections.List,kotlin.Int,androidx.compose.ui.text.style.TextOverflow)` with the given constraints. A paragraph is a text that has a single `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle`.

If the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,androidx.compose.ui.unit.Constraints,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,androidx.compose.ui.text.intl.LocaleList,kotlin.collections.List,kotlin.collections.List,kotlin.Int,androidx.compose.ui.text.style.TextOverflow)` does not contain any `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDirection`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDirection#Content()` is used as the default value.

| Parameters |
|---|---|
| `text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the text to be laid out |
| `style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` to be applied to the whole text |
| `constraints: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints` | how wide and tall the text is allowed to be. `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints#maxWidth()` will define the width of the Paragraph. `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints#maxHeight()` helps defining the number of lines that fit with ellipsis is true. Minimum components of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Constraints` object are no-op. |
| `density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density` | density of the device |
| `fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` to be used to load the font given in `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle`s |
| `defaultLocaleList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList` | The default `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList` to be used to measure the text |
| `spanStyles: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle>> = listOf()` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle`s to be applied to parts of text |
| `placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>> = listOf()` | a list of placeholder metrics which tells `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#Paragraph(kotlin.String,androidx.compose.ui.text.TextStyle,androidx.compose.ui.unit.Constraints,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,androidx.compose.ui.text.intl.LocaleList,kotlin.collections.List,kotlin.collections.List,kotlin.Int,androidx.compose.ui.text.style.TextOverflow)` where should be left blank to leave space for inline elements. |
| `maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = DefaultMaxLines` | the maximum number of lines that the text can have |
| `overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow = TextOverflow.Clip` | specifies how visual overflow should be handled |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle#textDirection()` is not set |

### ParagraphIntrinsics

Cmn android 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/ParagraphIntrinsics.+function:ParagraphIntrinsics)

```
fun [ParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List))(
    text: String,
    style: TextStyle,
    annotations: List<AnnotatedString.Range<AnnotatedString.Annotation>>,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    placeholders: List<AnnotatedString.Range<Placeholder>> = listOf()
): ParagraphIntrinsics
```

> [!CAUTION]
> **This function is deprecated.**   
> Use an override with \`softWrap\`, use this instead:
>
> ```kotlin
> ParagraphIntrinsics(text, style, annotations, density, fontFamilyResolver, placeholders, true, LocaleList.current)
> ```

Factory method to create a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List)`.

If the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List)` does not contain any `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDirection`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDirection#Content()` is used as the default value.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List)` |   |

### ParagraphIntrinsics

Cmn android 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/ParagraphIntrinsics.+function:ParagraphIntrinsics) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
fun [ParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver))(
    text: String,
    style: TextStyle,
    spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
    placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
    density: Density,
    fontFamilyResolver: FontFamily.Resolver
): ParagraphIntrinsics
```

> [!CAUTION]
> **This function is deprecated.**   
> Use an overload that takes \`annotations\` instead, use this instead:
>
> ```kotlin
> ParagraphIntrinsics(text, style, spanStyles, density, fontFamilyResolver, placeholders, softWrap, Locale.current)
> ```

### ParagraphIntrinsics

Cmn android 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/ParagraphIntrinsics.+function:ParagraphIntrinsics) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
fun [ParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.Font.ResourceLoader))(
    text: String,
    style: TextStyle,
    spanStyles: List<AnnotatedString.Range<SpanStyle>> = listOf(),
    placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
    density: Density,
    resourceLoader: Font.ResourceLoader
): ParagraphIntrinsics
```

> [!CAUTION]
> **This function is deprecated.**   
> Font.ResourceLoader is deprecated, instead use FontFamily.Resolver, use this instead:
>
> ```kotlin
> ParagraphIntrinsics(text, style, spanStyles, density, createFontFamilyResolver(resourceLoader), placeholders, true, Locale.current)
> ```

Factory method to create a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.Font.ResourceLoader)`.

If the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.Font.ResourceLoader)` does not contain any `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDirection`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDirection#Content()` is used as the default value.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.Font.ResourceLoader)` |   |

### ParagraphIntrinsics

Cmn android 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/ParagraphIntrinsics.+function:ParagraphIntrinsics)

```
fun [ParagraphIntrinsics](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.Boolean))(
    text: String,
    style: TextStyle,
    annotations: List<AnnotatedString.Range<AnnotatedString.Annotation>>,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    softWrap: Boolean
): ParagraphIntrinsics
```

> [!CAUTION]
> **This function is deprecated.**   
> Use an override with \`defaultLocaleList\`, use this instead:
>
> ```kotlin
> ParagraphIntrinsics(text, style, annotations, density, fontFamilyResolver, placeholders, softWrap, LocaleList.current)
> ```

Factory method to create a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.Boolean)`.

| Parameters |
|---|---|
| `text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The text to be measured. |
| `style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` to apply to the text. |
| `annotations: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Annotation>>` | The annotations to apply to the text. |
| `density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density` of the display environment. |
| `fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` to resolve fonts. |
| `placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>` | The list of `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder` to be used in the text. |
| `softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the text should break at soft line breaks. When the intention is to lay out text as a single line, setting `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.Boolean)` to false enables optimizations that avoid certain expensive calculations. |

### ParagraphIntrinsics

Cmn android 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/ParagraphIntrinsics.+function:ParagraphIntrinsics)

```
fun ParagraphIntrinsics(
    text: String,
    style: TextStyle,
    annotations: List<AnnotatedString.Range<AnnotatedString.Annotation>>,
    density: Density,
    fontFamilyResolver: FontFamily.Resolver,
    placeholders: List<AnnotatedString.Range<Placeholder>>,
    softWrap: Boolean,
    defaultLocaleList: LocaleList
): ParagraphIntrinsics
```

Factory method to create a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.Boolean,androidx.compose.ui.text.intl.LocaleList)`.

| Parameters |
|---|---|
| `text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The text to be measured. |
| `style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` to apply to the text. |
| `annotations: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Annotation>>` | The annotations to apply to the text. |
| `density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density` of the display environment. |
| `fontFamilyResolver: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontFamily.Resolver` to resolve fonts. |
| `placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>>` | The list of `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder` to be used in the text. |
| `softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the text should break at soft line breaks. When the intention is to lay out text as a single line, setting `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#ParagraphIntrinsics(kotlin.String,androidx.compose.ui.text.TextStyle,kotlin.collections.List,androidx.compose.ui.unit.Density,androidx.compose.ui.text.font.FontFamily.Resolver,kotlin.collections.List,kotlin.Boolean,androidx.compose.ui.text.intl.LocaleList)` to false enables optimizations that avoid certain expensive calculations. |
| `defaultLocaleList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList` | The default `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList` to use to measure the text. |

### TextRange

Cmn 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/TextRange.kt+function:TextRange) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun TextRange(index: Int): TextRange
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#TextRange(kotlin.Int)` where start is equal to end, and the value of those are `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#TextRange(kotlin.Int)`.

### TextRange

Cmn 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/TextRange.kt+function:TextRange) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun TextRange(start: Int, end: Int): TextRange
```

An immutable text range class, represents a text range from `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#TextRange(kotlin.Int,kotlin.Int)` (inclusive) to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#TextRange(kotlin.Int,kotlin.Int)` (exclusive). `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#TextRange(kotlin.Int,kotlin.Int)` can be smaller than `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#TextRange(kotlin.Int,kotlin.Int)` and in those cases `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.math/index.html` and `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.math/index.html` can be used in order to fetch the values.

| Parameters |
|---|---|
| `start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the inclusive start offset of the range. Must be non-negative, otherwise an exception will be thrown. |
| `end: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the exclusive end offset of the range. Must be non-negative, otherwise an exception will be thrown. |

### buildAnnotatedString

Cmn 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/AnnotatedString.kt+function:buildAnnotatedString) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
inline fun buildAnnotatedString(builder: AnnotatedString.Builder.() -> Unit): AnnotatedString
```

Build a new AnnotatedString by populating newly created `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder` provided by `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#buildAnnotatedString(kotlin.Function1)`.

```kotlin
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.withStyle

// create an AnnotatedString using the lambda builder
buildAnnotatedString {
    // append "Hello" with red text color
    withStyle(SpanStyle(color = Color.Red)) { append("Hello") }
    append(" ")
    // append "Hello" with blue text color
    withStyle(SpanStyle(color = Color.Blue)) { append("World!") }
}
```

| Parameters |
|---|---|
| `builder: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | lambda to modify `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder` |

### lerp

Cmn 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/ParagraphStyle.kt+function:lerp) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun lerp(start: ParagraphStyle, stop: ParagraphStyle, fraction: Float): ParagraphStyle
```

Interpolate between two `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle`s.

This will not work well if the styles don't set the same fields.

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.ParagraphStyle,androidx.compose.ui.text.ParagraphStyle,kotlin.Float)` argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.ParagraphStyle,androidx.compose.ui.text.ParagraphStyle,kotlin.Float)` (or something equivalent to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.ParagraphStyle,androidx.compose.ui.text.ParagraphStyle,kotlin.Float)`), 1.0 meaning that the interpolation has finished, returning `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.ParagraphStyle,androidx.compose.ui.text.ParagraphStyle,kotlin.Float)` (or something equivalent to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.ParagraphStyle,androidx.compose.ui.text.ParagraphStyle,kotlin.Float)`), and values in between meaning that the interpolation is at the relevant point on the timeline between `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.ParagraphStyle,androidx.compose.ui.text.ParagraphStyle,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.ParagraphStyle,androidx.compose.ui.text.ParagraphStyle,kotlin.Float)`. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid.

### lerp

Cmn android 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/+function:lerp)

```
fun lerp(
    start: PlatformParagraphStyle,
    stop: PlatformParagraphStyle,
    fraction: Float
): PlatformParagraphStyle
```

Interpolate between two PlatformParagraphStyle's.

This will not work well if the styles don't set the same fields.

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformParagraphStyle,androidx.compose.ui.text.PlatformParagraphStyle,kotlin.Float)` argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformParagraphStyle,androidx.compose.ui.text.PlatformParagraphStyle,kotlin.Float)` (or something equivalent to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformParagraphStyle,androidx.compose.ui.text.PlatformParagraphStyle,kotlin.Float)`), 1.0 meaning that the interpolation has finished, returning `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformParagraphStyle,androidx.compose.ui.text.PlatformParagraphStyle,kotlin.Float)` (or something equivalent to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformParagraphStyle,androidx.compose.ui.text.PlatformParagraphStyle,kotlin.Float)`), and values in between meaning that the interpolation is at the relevant point on the timeline between `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformParagraphStyle,androidx.compose.ui.text.PlatformParagraphStyle,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformParagraphStyle,androidx.compose.ui.text.PlatformParagraphStyle,kotlin.Float)`. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid.

### lerp

Cmn android 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/+function:lerp)

```
fun lerp(start: PlatformSpanStyle, stop: PlatformSpanStyle, fraction: Float): PlatformSpanStyle
```

Interpolate between two PlatformSpanStyle's.

This will not work well if the styles don't set the same fields.

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformSpanStyle,kotlin.Float)` argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformSpanStyle,kotlin.Float)` (or something equivalent to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformSpanStyle,kotlin.Float)`), 1.0 meaning that the interpolation has finished, returning `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformSpanStyle,kotlin.Float)` (or something equivalent to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformSpanStyle,kotlin.Float)`), and values in between meaning that the interpolation is at the relevant point on the timeline between `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformSpanStyle,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformSpanStyle,kotlin.Float)`. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid.

### lerp

Cmn 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/SpanStyle.kt+function:lerp) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun lerp(start: SpanStyle, stop: SpanStyle, fraction: Float): SpanStyle
```

Interpolate between two span styles.

This will not work well if the styles don't set the same fields.

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.SpanStyle,kotlin.Float)` argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.SpanStyle,kotlin.Float)` (or something equivalent to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.SpanStyle,kotlin.Float)`), 1.0 meaning that the interpolation has finished, returning `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.SpanStyle,kotlin.Float)` (or something equivalent to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.SpanStyle,kotlin.Float)`), and values in between meaning that the interpolation is at the relevant point on the timeline between `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.SpanStyle,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.SpanStyle,androidx.compose.ui.text.SpanStyle,kotlin.Float)`. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid.

### lerp

Cmn 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/TextStyle.kt+function:lerp) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun lerp(start: TextStyle, stop: TextStyle, fraction: Float): TextStyle
```

Interpolate between two text styles.

This will not work well if the styles don't set the same fields.

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.TextStyle,kotlin.Float)` argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.TextStyle,kotlin.Float)` (or something equivalent to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.TextStyle,kotlin.Float)`), 1.0 meaning that the interpolation has finished, returning `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.TextStyle,kotlin.Float)` (or something equivalent to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.TextStyle,kotlin.Float)`), and values in between meaning that the interpolation is at the relevant point on the timeline between `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.TextStyle,kotlin.Float)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#lerp(androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.TextStyle,kotlin.Float)`. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid.

### resolveDefaults

Cmn 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/TextStyle.kt+function:resolveDefaults) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun resolveDefaults(style: TextStyle, direction: LayoutDirection): TextStyle
```

Fills missing values in TextStyle with default values and resolve `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDirection`.

This function will fill all null or `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit#Unspecified()` field with actual values.

| Parameters |
|---|---|
| `style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` | a text style to be resolved |
| `direction: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` | a layout direction to be used for resolving text layout direction algorithm |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` | resolved text style. |

## Extension functions

### AnnotatedString.capitalize

Cmn 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/AnnotatedString.kt+function:capitalize) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun AnnotatedString.[capitalize](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).capitalize(androidx.compose.ui.text.intl.LocaleList))(localeList: LocaleList = LocaleList.current): AnnotatedString
```

> [!CAUTION]
> **This function is deprecated.**   
> This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. Call capitalize with an explicit locale instead. If you have a non-empty locale list, the correct thing to do is use the first locale in the list.

Create capitalized `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`

The capitalization sometimes maps different number of characters. This function adjusts the text style and paragraph style ranges to transformed offset.

Note, if the style's offset is middle of the capitalization context, this function won't transform the character, e.g. style starts from between base alphabet character and accent character.

| Parameters |
|---|---|
| `localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList = LocaleList.current` | A locale list used for capitalize mapping. Only the first locale is effective. If empty locale list is passed, use the current locale instead. Note that, this locale is currently ignored since underlying Kotlin method is experimental. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | A capitalized string. |

### String.capitalize

Cmn 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/String.kt+function:capitalize) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun String.[capitalize](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.String).capitalize(androidx.compose.ui.text.intl.LocaleList))(localeList: LocaleList): String
```

> [!CAUTION]
> **This function is deprecated.**   
> This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. Call capitalize with an explicit locale instead. If you have a non-empty locale list, the correct thing to do is use the first locale in the list.

Returns capitalized String.

| Parameters |
|---|---|
| `localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList` | a locale list object. If empty locale list object is passed, use current locale instead. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | a transformed text |

### AnnotatedString.capitalize

Cmn 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/AnnotatedString.kt+function:capitalize) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun AnnotatedString.capitalize(locale: Locale): AnnotatedString
```

Create capitalized `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`

The capitalization sometimes maps different number of characters. This function adjusts the text style and paragraph style ranges to transformed offset.

Note, if the style's offset is middle of the capitalization context, this function won't transform the character, e.g. style starts from between base alphabet character and accent character.

| Parameters |
|---|---|
| `locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale` | The locale used for capitalize mapping. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | A capitalized `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`. |

### String.capitalize

Cmn 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/String.kt+function:capitalize) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun String.capitalize(locale: Locale): String
```

Returns capitalized String.

| Parameters |
|---|---|
| `locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale` | a locale object |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | a transformed text |

### TextRange.coerceIn

Cmn 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/TextRange.kt+function:coerceIn) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun TextRange.coerceIn(minimumValue: Int, maximumValue: Int): TextRange
```

Ensures that `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#start()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#end()` values lies in the specified range `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.TextRange).coerceIn(kotlin.Int,kotlin.Int)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.TextRange).coerceIn(kotlin.Int,kotlin.Int)`. For each `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#start()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#end()` values:

- if value is smaller than `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.TextRange).coerceIn(kotlin.Int,kotlin.Int)`, value is replaced by `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.TextRange).coerceIn(kotlin.Int,kotlin.Int)`

- if value is greater than `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.TextRange).coerceIn(kotlin.Int,kotlin.Int)`, value is replaced by `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.TextRange).coerceIn(kotlin.Int,kotlin.Int)`

| Parameters |
|---|---|
| `minimumValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the minimum value that `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#start()` or `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#end()` can be. |
| `maximumValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the exclusive maximum value that `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#start()` or `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextRange#end()` can be. |

### AnnotatedString.decapitalize

Cmn 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/AnnotatedString.kt+function:decapitalize) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun AnnotatedString.[decapitalize](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).decapitalize(androidx.compose.ui.text.intl.LocaleList))(localeList: LocaleList = LocaleList.current): AnnotatedString
```

> [!CAUTION]
> **This function is deprecated.**   
> This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. Call decapitalize with an explicit locale instead. If you have a non-empty locale list, the correct thing to do is use the first locale in the list.

Create decapitalized `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`

The decapitalization sometimes maps different number of characters. This function adjusts the text style and paragraph style ranges to transformed offset.

Note, if the style's offset is middle of the decapitalization context, this function won't transform the character, e.g. style starts from between base alphabet character and accent character.

| Parameters |
|---|---|
| `localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList = LocaleList.current` | A locale list used for decapitalize mapping. Only the first locale is effective. If empty locale list is passed, use the current locale instead. Note that, this locale is currently ignored since underlying Kotlin method is experimental. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | A decapitalized `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`. |

### String.decapitalize

Cmn 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/String.kt+function:decapitalize) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun String.[decapitalize](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.String).decapitalize(androidx.compose.ui.text.intl.LocaleList))(localeList: LocaleList): String
```

> [!CAUTION]
> **This function is deprecated.**   
> This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. Call decapitalize with an explicit locale instead. If you have a non-empty locale list, the correct thing to do is use the first locale in the list.

Returns decapitalized String.

| Parameters |
|---|---|
| `localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList` | a locale list object. If empty locale list object is passed, use current locale instead. |

### AnnotatedString.decapitalize

Cmn 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/AnnotatedString.kt+function:decapitalize) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun AnnotatedString.decapitalize(locale: Locale): AnnotatedString
```

Create decapitalized `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`

The decapitalization sometimes maps different number of characters. This function adjusts the text style and paragraph style ranges to transformed offset.

Note, if the style's offset is middle of the decapitalization context, this function won't transform the character, e.g. style starts from between base alphabet character and accent character.

| Parameters |
|---|---|
| `locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale` | The locale used for decapitalize mapping. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | A decapitalized `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`. |

### String.decapitalize

Cmn 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/String.kt+function:decapitalize) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun String.decapitalize(locale: Locale): String
```

Returns decapitalized String.

| Parameters |
|---|---|
| `locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale` | a locale object |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | a transformed text |

### DrawScope.drawText

Cmn 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/TextPainter.kt+function:drawText) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun DrawScope.drawText(
    textLayoutResult: TextLayoutResult,
    brush: Brush,
    topLeft: Offset = Offset.Zero,
    alpha: Float = Float.NaN,
    shadow: Shadow? = null,
    textDecoration: TextDecoration? = null,
    drawStyle: DrawStyle? = null,
    blendMode: BlendMode = DrawScope.DefaultBlendMode
): Unit
```

Draw an existing text layout as produced by `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer`.

This draw function cannot relayout when async font loading resolves. If using async fonts or other dynamic text layout, you are responsible for invalidating layout on changes.

| Parameters |
|---|---|
| `textLayoutResult: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult` | Text Layout to be drawn |
| `brush: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush` | The brush to use when drawing the text. |
| `topLeft: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset = Offset.Zero` | Offsets the text from top left point of the current coordinate system. |
| `alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Float.NaN` | Opacity to be applied to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextLayoutResult,androidx.compose.ui.graphics.Brush,androidx.compose.ui.geometry.Offset,kotlin.Float,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)` from 0.0f to 1.0f representing fully transparent to fully opaque respectively. |
| `shadow: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shadow? = null` | The shadow effect applied on the text. |
| `textDecoration: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration? = null` | The decorations to paint on the text (e.g., an underline). |
| `drawStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawStyle? = null` | Whether or not the text is stroked or filled in. |
| `blendMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode = DrawScope.DefaultBlendMode` | Blending algorithm to be applied to the text |

### DrawScope.drawText

Cmn 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/TextPainter.kt+function:drawText) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun DrawScope.drawText(
    textLayoutResult: TextLayoutResult,
    color: Color = Color.Unspecified,
    topLeft: Offset = Offset.Zero,
    alpha: Float = Float.NaN,
    shadow: Shadow? = null,
    textDecoration: TextDecoration? = null,
    drawStyle: DrawStyle? = null,
    blendMode: BlendMode = DrawScope.DefaultBlendMode
): Unit
```

Draw an existing text layout as produced by `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer`.

This draw function cannot relayout when async font loading resolves. If using async fonts or other dynamic text layout, you are responsible for invalidating layout on changes.

```kotlin
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.Layout
import androidx.compose.ui.layout.layout
import androidx.compose.ui.text.TextLayoutResult
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.drawText
import androidx.compose.ui.text.rememberTextMeasurer
import androidx.compose.ui.unit.sp

val textMeasurer = rememberTextMeasurer()
var textLayoutResult by remember { mutableStateOf<TextLayoutResult?>(null) }

Canvas(
    Modifier.fillMaxSize().layout { measurable, constraints ->
        val placeable = measurable.measure(constraints)
        // TextLayout can be done any time prior to its use in draw, including in a
        // background thread.
        // In this sample, text layout is measured in layout modifier. This way the layout
        // call can be restarted when async font loading completes due to the fact that
        // `.measure` call is executed in `.layout`.
        textLayoutResult =
            textMeasurer.measure(text = "Hello, World!", style = TextStyle(fontSize = 24.sp))
        layout(placeable.width, placeable.height) { placeable.placeRelative(0, 0) }
    }
) {
    // This happens during draw phase.
    textLayoutResult?.let { drawText(it) }
}
```

```kotlin
import androidx.compose.animation.animateColor
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.LocalTextStyle
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawWithCache
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.Layout
import androidx.compose.ui.layout.layout
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.drawText
import androidx.compose.ui.text.rememberTextMeasurer
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Constraints

// We can disable implicit caching since we will cache in DrawWithCache
val textMeasurer = rememberTextMeasurer(cacheSize = 0)
// Apply the current text style from theme, otherwise TextStyle.Default will be used.
val materialTextStyle = LocalTextStyle.current

// Animate color repeatedly
val infiniteTransition = rememberInfiniteTransition()
val color by
    infiniteTransition.animateColor(
        initialValue = Color.Red,
        targetValue = Color.Blue,
        animationSpec = infiniteRepeatable(tween(1000)),
    )

Box(
    Modifier.fillMaxSize().drawWithCache {
        // Text layout will be measured just once until the size of the drawing area or
        // materialTextStyle changes.
        val textLayoutResult =
            textMeasurer.measure(
                text = "Hello, World!",
                style = materialTextStyle,
                constraints =
                    Constraints.fixed(
                        width = (size.width / 2).roundToInt(),
                        height = (size.height / 2).roundToInt(),
                    ),
                overflow = TextOverflow.Ellipsis,
            )
        // color changes will only invalidate draw phase
        onDrawWithContent {
            drawContent()
            drawText(
                textLayoutResult,
                color = color,
                topLeft =
                    Offset(
                        (size.width - textLayoutResult.size.width) / 2,
                        (size.height - textLayoutResult.size.height) / 2,
                    ),
            )
        }
    }
)
```

| Parameters |
|---|---|
| `textLayoutResult: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult` | Text Layout to be drawn |
| `color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | Text color to use |
| `topLeft: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset = Offset.Zero` | Offsets the text from top left point of the current coordinate system. |
| `alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Float.NaN` | opacity to be applied to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextLayoutResult,androidx.compose.ui.graphics.Color,androidx.compose.ui.geometry.Offset,kotlin.Float,androidx.compose.ui.graphics.Shadow,androidx.compose.ui.text.style.TextDecoration,androidx.compose.ui.graphics.drawscope.DrawStyle,androidx.compose.ui.graphics.BlendMode)` from 0.0f to 1.0f representing fully transparent to fully opaque respectively |
| `shadow: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shadow? = null` | The shadow effect applied on the text. |
| `textDecoration: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextDecoration? = null` | The decorations to paint on the text (e.g., an underline). |
| `drawStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawStyle? = null` | Whether or not the text is stroked or filled in. |
| `blendMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode = DrawScope.DefaultBlendMode` | Blending algorithm to be applied to the text |

### DrawScope.drawText

Cmn 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/TextPainter.kt+function:drawText) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun DrawScope.drawText(
    textMeasurer: TextMeasurer,
    text: String,
    topLeft: Offset = Offset.Zero,
    style: TextStyle = TextStyle.Default,
    overflow: TextOverflow = TextOverflow.Clip,
    softWrap: Boolean = true,
    maxLines: Int = Int.MAX_VALUE,
    size: Size = Size.Unspecified,
    blendMode: BlendMode = DrawScope.DefaultBlendMode
): Unit
```

Draw text using a TextMeasurer.

This draw function supports only one text style, and async font loading.

TextMeasurer carries an internal cache to optimize text layout measurement for repeated calls in draw phase. If layout affecting attributes like font size, font weight, overflow, softWrap, etc. are changed in consecutive calls to this method, TextMeasurer and its internal cache that holds layout results may not offer any benefits. Check out `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer` and drawText overloads that take `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult` to learn more about text layout and draw phase optimizations.

```kotlin
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.drawText
import androidx.compose.ui.text.rememberTextMeasurer

val textMeasurer = rememberTextMeasurer()

Canvas(Modifier.fillMaxSize()) { drawText(textMeasurer, "Hello, World!") }
```

```kotlin
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.drawText
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.rememberTextMeasurer
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.sp

val textMeasurer = rememberTextMeasurer()

Canvas(Modifier.fillMaxSize()) {
    drawText(
        textMeasurer = textMeasurer,
        text = "Hello, World!",
        style =
            TextStyle(
                fontSize = 24.sp,
                fontWeight = FontWeight.Bold,
                textDecoration = TextDecoration.Underline,
            ),
    )
}
```

| Parameters |
|---|---|
| `textMeasurer: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer` | Measures and lays out the text |
| `text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | Text to be drawn |
| `topLeft: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset = Offset.Zero` | Offsets the text from top left point of the current coordinate system. |
| `style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle = TextStyle.Default` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` to be applied to the text |
| `overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow = TextOverflow.Clip` | How visual overflow should be handled. |
| `softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | Whether the text should break at soft line breaks. If false, the glyphs in the text will be positioned as if there was unlimited horizontal space. If `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,kotlin.String,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)` is false, `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,kotlin.String,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)` and TextAlign may have unexpected effects. |
| `maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = Int.MAX_VALUE` | An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated according to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,kotlin.String,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,kotlin.String,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)`. If it is not null, then it must be greater than zero. |
| `size: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size = Size.Unspecified` | how wide and tall the text should be. If left `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size#Unspecified()` as its default value, text will be forced to fit inside the total drawing area from where it's placed. If size is specified, `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size#width()` will define the width of the text. `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size#height()` helps defining the number of lines that fit if `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,kotlin.String,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)` is enabled and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,kotlin.String,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow#Ellipsis()`. Otherwise, `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size#height()` either defines where the text is clipped (`https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow#Clip()`) or becomes no-op. |
| `blendMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode = DrawScope.DefaultBlendMode` | Blending algorithm to be applied to the text |

### DrawScope.drawText

Cmn 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/TextPainter.kt+function:drawText) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun DrawScope.drawText(
    textMeasurer: TextMeasurer,
    text: AnnotatedString,
    topLeft: Offset = Offset.Zero,
    style: TextStyle = TextStyle.Default,
    overflow: TextOverflow = TextOverflow.Clip,
    softWrap: Boolean = true,
    maxLines: Int = Int.MAX_VALUE,
    placeholders: List<AnnotatedString.Range<Placeholder>> = listOf(),
    size: Size = Size.Unspecified,
    blendMode: BlendMode = DrawScope.DefaultBlendMode
): Unit
```

Draw styled text using a TextMeasurer.

This draw function supports multi-styling and async font loading.

TextMeasurer carries an internal cache to optimize text layout measurement for repeated calls in draw phase. If layout affecting attributes like font size, font weight, overflow, softWrap, etc. are changed in consecutive calls to this method, TextMeasurer and its internal cache that holds layout results may not offer any benefits. Check out `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer` and drawText overloads that take `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLayoutResult` to learn more about text layout and draw phase optimizations.

```kotlin
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.ParagraphStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.drawText
import androidx.compose.ui.text.rememberTextMeasurer
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.withStyle

val textMeasurer = rememberTextMeasurer()

Canvas(Modifier.fillMaxSize()) {
    drawText(
        textMeasurer = textMeasurer,
        text =
            buildAnnotatedString {
                withStyle(ParagraphStyle(textAlign = TextAlign.Start)) { append("Hello") }
                withStyle(ParagraphStyle(textAlign = TextAlign.End)) { append("World") }
            },
    )
}
```

| Parameters |
|---|---|
| `textMeasurer: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextMeasurer` | Measures and lays out the text |
| `text: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | Text to be drawn |
| `topLeft: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Offset = Offset.Zero` | Offsets the text from top left point of the current coordinate system. |
| `style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle = TextStyle.Default` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` to be applied to the text |
| `overflow: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow = TextOverflow.Clip` | How visual overflow should be handled. |
| `softWrap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | Whether the text should break at soft line breaks. If false, the glyphs in the text will be positioned as if there was unlimited horizontal space. If `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,kotlin.collections.List,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)` is false, `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,kotlin.collections.List,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)` and TextAlign may have unexpected effects. |
| `maxLines: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = Int.MAX_VALUE` | An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated according to `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,kotlin.collections.List,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,kotlin.collections.List,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)`. If it is not null, then it must be greater than zero. |
| `placeholders: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Range<https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder>> = listOf()` | a list of `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder`s that specify ranges of text which will be skipped during layout and replaced with `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder`. It's required that the range of each `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/Placeholder` doesn't cross paragraph boundary, otherwise `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` is thrown. |
| `size: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size = Size.Unspecified` | how wide and tall the text should be. If left `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size#Unspecified()` as its default value, text will be forced to fit inside the total drawing area from where it's placed. If size is specified, `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size#width()` will define the width of the text. `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size#height()` helps defining the number of lines that fit if `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,kotlin.collections.List,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)` is enabled and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.graphics.drawscope.DrawScope).drawText(androidx.compose.ui.text.TextMeasurer,androidx.compose.ui.text.AnnotatedString,androidx.compose.ui.geometry.Offset,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.style.TextOverflow,kotlin.Boolean,kotlin.Int,kotlin.collections.List,androidx.compose.ui.geometry.Size,androidx.compose.ui.graphics.BlendMode)` is `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow#Ellipsis()`. Otherwise, `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size#height()` either defines where the text is clipped (`https://developer.android.com/reference/kotlin/androidx/compose/ui/text/style/TextOverflow#Clip()`) or becomes no-op. |
| `blendMode: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode = DrawScope.DefaultBlendMode` | Blending algorithm to be applied to the text |

### AnnotatedString.Companion.fromHtml

android 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/Html.android.kt+function:fromHtml)

```
fun AnnotatedString.Companion.fromHtml(
    htmlString: String,
    linkStyles: TextLinkStyles? = null,
    linkInteractionListener: LinkInteractionListener? = null
): AnnotatedString
```

Converts a string with HTML tags into `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`.

If you define your string in the resources, make sure to use HTML-escaped opening brackets `<` instead of `<`.

For a list of supported tags go check [Styling with HTML markup](https://developer.android.com/guide/topics/resources/string-resource#StylingWithHTML) guide.

To support nested bullet list, the nested sub-list wrapped in

tag MUST be placed inside a list item with a tag
- . In other words, you must add wrapped sub-list in between opening and closing
- tag of the wrapping sub-list. This is due to the specificities of the underlying XML/HTML parser.<br />

  ```kotlin
  import androidx.compose.foundation.text.BasicText
  import androidx.compose.ui.res.stringResource
  import androidx.compose.ui.text.AnnotatedString
  import androidx.compose.ui.text.fromHtml

  // First, download a string as a plain text using one of the resources' methods. At this stage
  // you will be handling plurals and formatted strings in needed. Moreover, the string will be
  // resolved with respect to the current locale and available translations.
  val string = stringResource(id = R.string.example)

  // Next, convert a string marked with HTML tags into AnnotatedString to be displayed by Text
  val styledAnnotatedString = AnnotatedString.fromHtml(htmlString = string)

  BasicText(styledAnnotatedString)
  ```

  | Parameters |
  |---|---|
  | `htmlString: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | HTML-tagged string to be parsed to construct AnnotatedString |
  | `linkStyles: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextLinkStyles? = null` | style configuration to be applied to links present in the string in different styles |
  | `linkInteractionListener: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkInteractionListener? = null` | a listener that will be attached to links that are present in the string and triggered when user clicks on those links. When set to null, which is a default, the system will try to open the corresponding links with the `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/UriHandler` composition local Note that any link style passed directly to this method will be merged with the styles set directly on a HTML-tagged string. For example, if you set a color of the link via the span annotation to "red" but also pass a green color via the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Companion).fromHtml(kotlin.String,androidx.compose.ui.text.TextLinkStyles,androidx.compose.ui.text.LinkInteractionListener)`, the link will be displayed as green. If, however, you pass a green background via the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Companion).fromHtml(kotlin.String,androidx.compose.ui.text.TextLinkStyles,androidx.compose.ui.text.LinkInteractionListener)` instead, the link will be displayed as red on a green background. Example of displaying styled string from resources |

  | See also |
  |---|---|
  | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkAnnotation` |   |

### CharSequence.substring

Cmn 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/TextRange.kt+function:substring) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.10.0)

```
fun CharSequence.substring(range: TextRange): String
```

### AnnotatedString.toLowerCase

Cmn 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/AnnotatedString.kt+function:toLowerCase) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun AnnotatedString.[toLowerCase](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).toLowerCase(androidx.compose.ui.text.intl.LocaleList))(localeList: LocaleList = LocaleList.current): AnnotatedString
```

> [!CAUTION]
> **This function is deprecated.**   
> This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. Call toLowerCase with an explicit locale instead. If you have a non-empty locale list, the correct thing to do is use the first locale in the list.

Create lower case transformed `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`

The lowercase sometimes maps different number of characters. This function adjusts the text style and paragraph style ranges to transformed offset.

Note, if the style's offset is middle of the lowercase mapping context, this function won't transform the character, e.g. style starts from between base alphabet character and accent character.

| Parameters |
|---|---|
| `localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList = LocaleList.current` | A locale list used for lower case mapping. Only the first locale is effective. If empty locale list is passed, use the current locale instead. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | A lowercase transformed string. |

### String.toLowerCase

Cmn 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/String.kt+function:toLowerCase) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun String.[toLowerCase](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.String).toLowerCase(androidx.compose.ui.text.intl.LocaleList))(localeList: LocaleList): String
```

> [!CAUTION]
> **This function is deprecated.**   
> This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. Call toLowerCase with an explicit locale instead. If you have a non-empty locale list, the correct thing to do is use the first locale in the list.

Returns lowercase transformed String.

| Parameters |
|---|---|
| `localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList` | a locale list object. If empty locale list object is passed, use current locale instead. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | a transformed text |

### AnnotatedString.toLowerCase

Cmn 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/AnnotatedString.kt+function:toLowerCase) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun AnnotatedString.toLowerCase(locale: Locale): AnnotatedString
```

Create lower case transformed `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`

The lowercase sometimes maps different number of characters. This function adjusts the text style and paragraph style ranges to transformed offset.

Note, if the style's offset is middle of the lowercase mapping context, this function won't transform the character, e.g. style starts from between base alphabet character and accent character.

| Parameters |
|---|---|
| `locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale` | The locale used for lower case mapping. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | A lowercase transformed `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`. |

### String.toLowerCase

Cmn 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/String.kt+function:toLowerCase) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun String.toLowerCase(locale: Locale): String
```

Returns lowercase transformed String.

| Parameters |
|---|---|
| `locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale` | a locale object |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | a transformed text |

### AnnotatedString.toUpperCase

Cmn 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/AnnotatedString.kt+function:toUpperCase) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun AnnotatedString.[toUpperCase](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString).toUpperCase(androidx.compose.ui.text.intl.LocaleList))(localeList: LocaleList = LocaleList.current): AnnotatedString
```

> [!CAUTION]
> **This function is deprecated.**   
> This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. Call toUpperCase with an explicit locale instead. If you have a non-empty locale list, the correct thing to do is use the first locale in the list.

Create upper case transformed `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`

The uppercase sometimes maps different number of characters. This function adjusts the text style and paragraph style ranges to transformed offset.

Note, if the style's offset is middle of the uppercase mapping context, this function won't transform the character, e.g. style starts from between base alphabet character and accent character.

| Parameters |
|---|---|
| `localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList = LocaleList.current` | A locale list used for upper case mapping. Only the first locale is effective. If empty locale list is passed, use the current locale instead. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | An uppercase transformed `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`. |

### String.toUpperCase

Cmn 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/String.kt+function:toUpperCase) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Deprecated in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun String.[toUpperCase](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(kotlin.String).toUpperCase(androidx.compose.ui.text.intl.LocaleList))(localeList: LocaleList): String
```

> [!CAUTION]
> **This function is deprecated.**   
> This method allows passing an empty locale list, which will pull a locale in a way that can't be backed by snapshot state. Call toUpperCase with an explicit locale instead. If you have a non-empty locale list, the correct thing to do is use the first locale in the list.

Returns uppercase transformed String.

| Parameters |
|---|---|
| `localeList: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/LocaleList` | a locale list object. If empty locale list object is passed, use current locale instead. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | a transformed text |

### AnnotatedString.toUpperCase

Cmn 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/AnnotatedString.kt+function:toUpperCase) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
fun AnnotatedString.toUpperCase(locale: Locale): AnnotatedString
```

Create upper case transformed `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`

The uppercase sometimes maps different number of characters. This function adjusts the text style and paragraph style ranges to transformed offset.

Note, if the style's offset is middle of the uppercase mapping context, this function won't transform the character, e.g. style starts from between base alphabet character and accent character.

| Parameters |
|---|---|
| `locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale` | The locale used for upper case mapping. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString` | An uppercase transformed `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString`. |

### String.toUpperCase

Cmn 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/String.kt+function:toUpperCase) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
fun String.toUpperCase(locale: Locale): String
```

Returns uppercase transformed String.

| Parameters |
|---|---|
| `locale: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/intl/Locale` | a locale object |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | a transformed text |

### AnnotatedString.Builder.withAnnotation

Cmn 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/AnnotatedString.kt+function:withAnnotation) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
inline fun <R : Any> AnnotatedString.Builder.withAnnotation(
    ttsAnnotation: TtsAnnotation,
    crossinline block: AnnotatedString.Builder.() -> R
): R
```

Pushes an `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TtsAnnotation` to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder`, executes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withAnnotation(androidx.compose.ui.text.TtsAnnotation,kotlin.Function1)` and then pops the annotation.

| Parameters |
|---|---|
| `ttsAnnotation: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TtsAnnotation` | an object that stores text to speech metadata that intended for the TTS engine. |
| `crossinline block: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> R` | function to be executed |

| Returns |
|---|---|
| `R` | result of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withAnnotation(androidx.compose.ui.text.TtsAnnotation,kotlin.Function1)` |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder#pushStringAnnotation(kotlin.String,kotlin.String)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder#pop()` |   |

### AnnotatedString.Builder.withAnnotation

Cmn 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/AnnotatedString.kt+function:withAnnotation) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.3.0) Deprecated in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0)

```
@ExperimentalTextApi
inline fun <R : Any> AnnotatedString.Builder.[withAnnotation](https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withAnnotation(androidx.compose.ui.text.UrlAnnotation,kotlin.Function1))(
    urlAnnotation: UrlAnnotation,
    crossinline block: AnnotatedString.Builder.() -> R
): R
```

> [!CAUTION]
> **This function is deprecated.**   
> Use LinkAnnotation API for links instead, use this instead:
>
> ```kotlin
> withLink(, block)
> ```

Pushes an `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation` to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder`, executes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withAnnotation(androidx.compose.ui.text.UrlAnnotation,kotlin.Function1)` and then pops the annotation.

| Parameters |
|---|---|
| `urlAnnotation: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/UrlAnnotation` object that stores the URL being linked to. |
| `crossinline block: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> R` | function to be executed |

| Returns |
|---|---|
| `R` | result of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withAnnotation(androidx.compose.ui.text.UrlAnnotation,kotlin.Function1)` |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder#pushStringAnnotation(kotlin.String,kotlin.String)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder#pop()` |   |

### AnnotatedString.Builder.withAnnotation

Cmn 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/AnnotatedString.kt+function:withAnnotation) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
inline fun <R : Any> AnnotatedString.Builder.withAnnotation(
    tag: String,
    annotation: String,
    crossinline block: AnnotatedString.Builder.() -> R
): R
```

Pushes an annotation to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder`, executes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withAnnotation(kotlin.String,kotlin.String,kotlin.Function1)` and then pops the annotation.

| Parameters |
|---|---|
| `tag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the tag used to distinguish annotations |
| `annotation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | the string annotation attached on this AnnotatedString |
| `crossinline block: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> R` | function to be executed |

| Returns |
|---|---|
| `R` | result of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withAnnotation(kotlin.String,kotlin.String,kotlin.Function1)` |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder#pushStringAnnotation(kotlin.String,kotlin.String)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder#pop()` |   |

### AnnotatedString.Builder.withLink

Cmn 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/AnnotatedString.kt+function:withLink) Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.7.0)

```
inline fun <R : Any> AnnotatedString.Builder.withLink(
    link: LinkAnnotation,
    block: AnnotatedString.Builder.() -> R
): R
```

Pushes a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkAnnotation` to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder`, executes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withLink(androidx.compose.ui.text.LinkAnnotation,kotlin.Function1)` and then pops the annotation.

```kotlin
import androidx.compose.foundation.text.BasicText
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.LinkAnnotation
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextLinkStyles
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.withLink
import androidx.compose.ui.unit.sp

// Display a link in the text
BasicText(
    buildAnnotatedString {
        append("Build better apps faster with ")
        withLink(
            LinkAnnotation.Url(
                "https://developer.android.com/jetpack/compose",
                TextLinkStyles(style = SpanStyle(color = Color.Blue)),
            )
        ) {
            append("Jetpack Compose")
        }
    }
)
```

```kotlin
import androidx.compose.foundation.text.BasicText
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.LinkAnnotation
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextLinkStyles
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.text.withLink
import androidx.compose.ui.unit.sp

// Display a link in the text that gets an underline when hovered
BasicText(
    buildAnnotatedString {
        append("Build better apps faster with ")
        val link =
            LinkAnnotation.Url(
                "https://developer.android.com/jetpack/compose",
                TextLinkStyles(
                    style = SpanStyle(color = Color.Blue),
                    hoveredStyle = SpanStyle(textDecoration = TextDecoration.Underline),
                ),
            )
        withLink(link) { append("Jetpack Compose") }
    }
)
```

```kotlin
import androidx.compose.foundation.text.BasicText
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.LinkAnnotation
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextLinkStyles
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.withLink
import androidx.compose.ui.unit.sp

// Display a link in the text and log metrics whenever user clicks on it. In that case we handle
// the link using openUri method of the LocalUriHandler
val uriHandler = LocalUriHandler.current
BasicText(
    buildAnnotatedString {
        append("Build better apps faster with ")
        val link =
            LinkAnnotation.Url(
                "https://developer.android.com/jetpack/compose",
                TextLinkStyles(SpanStyle(color = Color.Blue)),
            ) {
                val url = (it as LinkAnnotation.Url).url
                // log some metrics
                uriHandler.openUri(url)
            }
        withLink(link) { append("Jetpack Compose") }
    }
)
```

| Parameters |
|---|---|
| `link: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkAnnotation` | A `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/LinkAnnotation` object representing a clickable part of the text |
| `block: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> R` | function to be executed |

| Returns |
|---|---|
| `R` | result of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withLink(androidx.compose.ui.text.LinkAnnotation,kotlin.Function1)` |

### AnnotatedString.Builder.withStyle

Cmn 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/AnnotatedString.kt+function:withStyle) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
inline fun <R : Any> AnnotatedString.Builder.withStyle(
    style: ParagraphStyle,
    crossinline block: AnnotatedString.Builder.() -> R
): R
```

Pushes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.ParagraphStyle,kotlin.Function1)` to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder`, executes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.ParagraphStyle,kotlin.Function1)` and then pops the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.ParagraphStyle,kotlin.Function1)`.

```kotlin
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.withStyle

buildAnnotatedString {
    withStyle(SpanStyle(color = Color.Green)) {
        // green text style will be applied to all text in this block
        append("Hello")
    }
    toAnnotatedString()
}
```

| Parameters |
|---|---|
| `style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/ParagraphStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle` to be applied |
| `crossinline block: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> R` | function to be executed |

| Returns |
|---|---|
| `R` | result of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.ParagraphStyle,kotlin.Function1)` |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder#pushStyle(androidx.compose.ui.text.SpanStyle)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder#pop()` |   |

### AnnotatedString.Builder.withStyle

Cmn 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/AnnotatedString.kt+function:withStyle) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
inline fun <R : Any> AnnotatedString.Builder.withStyle(style: SpanStyle, block: AnnotatedString.Builder.() -> R): R
```

Pushes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.SpanStyle,kotlin.Function1)` to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder`, executes `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.SpanStyle,kotlin.Function1)` and then pops the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.SpanStyle,kotlin.Function1)`.

```kotlin
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.withStyle

buildAnnotatedString {
    withStyle(SpanStyle(color = Color.Green)) {
        // green text style will be applied to all text in this block
        append("Hello")
    }
    toAnnotatedString()
}
```

| Parameters |
|---|---|
| `style: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle` to be applied |
| `block: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder.() -> R` | function to be executed |

| Returns |
|---|---|
| `R` | result of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/package-summary#(androidx.compose.ui.text.AnnotatedString.Builder).withStyle(androidx.compose.ui.text.SpanStyle,kotlin.Function1)` |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder#pushStyle(androidx.compose.ui.text.SpanStyle)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/AnnotatedString.Builder#pop()` |   |