# 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)

*** ** * ** ***


```
@UnstableApi
public final class TextAnnotation
```

<br />

*** ** * ** ***

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

## Summary

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

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/text/TextAnnotation#POSITION_AFTER() = 2` For horizontal text, the text annotation should be positioned below the base text. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/text/TextAnnotation#POSITION_BEFORE() = 1` For horizontal text, the text annotation should be positioned above the base text. |
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/text/TextAnnotation#POSITION_UNKNOWN() = -1` The text annotation position is unknown. |

## Constants

### POSITION_AFTER

```
public static final int POSITION_AFTER = 2
```

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

```
public static final int POSITION_BEFORE = 1
```

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

```
public static final int POSITION_UNKNOWN = -1
```

The text annotation position is unknown.