# TextAnnotation

# TextAnnotation

Artifact:[androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/common/text/TextAnnotation.java+class:androidx.media3.common.text.TextAnnotation)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/common/text/TextAnnotation "View this page in Java")

<br />

```
@UnstableApi
class TextAnnotation
```

<br />

*** ** * ** ***

Properties of a text annotation (i.e. ruby, text emphasis marks).

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                          ### Nested types                                                                                                                                                                                                                                                                                                                                                                                                                          |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `@`[Documented](https://developer.android.com/reference/java/lang/annotation/Documented.html) `@`[Retention](https://developer.android.com/reference/java/lang/annotation/Retention.html)`(value = `[RetentionPolicy.SOURCE](https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE)`)` `@`[Target](https://developer.android.com/reference/java/lang/annotation/Target.html)`(value = `[ElementType.TYPE_USE](https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE)`)` `@`[IntDef](https://developer.android.com/reference/kotlin/androidx/annotation/IntDef)`(value = )` `annotation `[TextAnnotation.Position](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextAnnotation.Position) The possible positions of the annotation text relative to the base text. |

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [POSITION_AFTER](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextAnnotation#POSITION_AFTER())` = 2` For horizontal text, the text annotation should be positioned below the base text.   |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [POSITION_BEFORE](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextAnnotation#POSITION_BEFORE())` = 1` For horizontal text, the text annotation should be positioned above the base text. |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [POSITION_UNKNOWN](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextAnnotation#POSITION_UNKNOWN())` = -1` The text annotation position is unknown.                                        |

## Constants

### POSITION_AFTER

```
const val POSITION_AFTER = 2: Int
```

For horizontal text, the text annotation should be positioned below the base text.

For vertical text it should be positioned to the left, same as CSS's[ruby-position](https://developer.mozilla.org/en-US/docs/Web/CSS/ruby-position).  

### POSITION_BEFORE

```
const val POSITION_BEFORE = 1: Int
```

For horizontal text, the text annotation should be positioned above the base text.

For vertical text it should be positioned to the right, same as CSS's[ruby-position](https://developer.mozilla.org/en-US/docs/Web/CSS/ruby-position).  

### POSITION_UNKNOWN

```
const val POSITION_UNKNOWN = -1: Int
```

The text annotation position is unknown.