# RubySpan

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/RubySpan.java+class:androidx.media3.common.text.RubySpan)

*** ** * ** ***


```
@UnstableApi
public final class RubySpan implements LanguageFeatureSpan
```

<br />

*** ** * ** ***

A styling span for ruby text.

The text covered by this span is known as the "base text", and the ruby text is stored in `https://developer.android.com/reference/androidx/media3/common/text/RubySpan#rubyText()`.

More information on [ruby characters](https://en.wikipedia.org/wiki/Ruby_character) and [span styling](https://developer.android.com/guide/topics/text/spans).

## Summary

| ### Public fields |
|---|---|
| `final int` | `@https://developer.android.com/reference/androidx/media3/common/text/TextAnnotation.Position https://developer.android.com/reference/androidx/media3/common/text/RubySpan#position()` The position of the ruby text relative to the base text. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/common/text/RubySpan#rubyText()` The ruby text, i.e. the smaller explanatory characters. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/common/text/RubySpan#RubySpan(java.lang.String,int)(https://developer.android.com/reference/java/lang/String.html rubyText, @https://developer.android.com/reference/androidx/media3/common/text/TextAnnotation.Position int position)` |

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/media3/common/text/RubySpan` | `https://developer.android.com/reference/androidx/media3/common/text/RubySpan#fromBundle(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html bundle)` |
| `https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/androidx/media3/common/text/RubySpan#toBundle()()` |

## Public fields

### position

```
@TextAnnotation.Position
public final int position
```

The position of the ruby text relative to the base text.

### rubyText

```
public final String rubyText
```

The ruby text, i.e. the smaller explanatory characters.

## Public constructors

### RubySpan

```
public RubySpan(String rubyText, @TextAnnotation.Position int position)
```

## Public methods

### fromBundle

```
public static RubySpan fromBundle(Bundle bundle)
```

### toBundle

```
public Bundle toBundle()
```