# TextEmphasisSpan

# TextEmphasisSpan

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

*** ** * ** ***

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

<br />

```
@UnstableApi
class TextEmphasisSpan : LanguageFeatureSpan
```

<br />

*** ** * ** ***

A styling span for text emphasis marks.

These are pronunciation aids such as[Japanese boutens](https://www.w3.org/TR/jlreq/?lang=en#term.emphasis-dots)which can be rendered using the[text-emphasis](https://developer.mozilla.org/en-US/docs/Web/CSS/text-emphasis)CSS property.

## 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 `[TextEmphasisSpan.MarkFill](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan.MarkFill) The possible mark fills that can be used.    |
| `@`[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 `[TextEmphasisSpan.MarkShape](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan.MarkShape) The possible mark shapes that can be used. |

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [MARK_FILL_FILLED](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#MARK_FILL_FILLED())` = 1`   |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [MARK_FILL_OPEN](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#MARK_FILL_OPEN())` = 2`       |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [MARK_FILL_UNKNOWN](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#MARK_FILL_UNKNOWN())` = 0` |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [MARK_SHAPE_CIRCLE](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#MARK_SHAPE_CIRCLE())` = 1` |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [MARK_SHAPE_DOT](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#MARK_SHAPE_DOT())` = 2`       |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [MARK_SHAPE_NONE](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#MARK_SHAPE_NONE())` = 0`     |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [MARK_SHAPE_SESAME](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#MARK_SHAPE_SESAME())` = 3` |

|                                                                                                                                                                                                                                                                                                                                                                                                           ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                           |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TextEmphasisSpan](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#TextEmphasisSpan(int,int,int))`(` ` @`[TextEmphasisSpan.MarkShape](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan.MarkShape)` shape: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` @`[TextEmphasisSpan.MarkFill](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan.MarkFill)` fill: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` @`[TextAnnotation.Position](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextAnnotation.Position)` position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` |

|                                                       ### Public functions                                                       |
|----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[TextEmphasisSpan](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan)`!` | [fromBundle](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#fromBundle(android.os.Bundle))`(bundle: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`!)` |
| [Bundle](https://developer.android.com/reference/android/os/Bundle.html)`!`                                                      | [toBundle](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#toBundle())`()`                                                                                                         |

|                            ### Public properties                            |
|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | `@`[TextEmphasisSpan.MarkFill](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan.MarkFill) [markFill](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#markFill()) The mark fill for the text emphasis mark.                |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | `@`[TextEmphasisSpan.MarkShape](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan.MarkShape) [markShape](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#markShape()) The mark shape used for text emphasis.               |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | `@`[TextAnnotation.Position](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextAnnotation.Position) [position](https://developer.android.com/reference/kotlin/androidx/media3/common/text/TextEmphasisSpan#position()) The position of the text emphasis relative to the base text. |

## Constants

### MARK_FILL_FILLED

```
const val MARK_FILL_FILLED = 1: Int
```  

### MARK_FILL_OPEN

```
const val MARK_FILL_OPEN = 2: Int
```  

### MARK_FILL_UNKNOWN

```
const val MARK_FILL_UNKNOWN = 0: Int
```  

### MARK_SHAPE_CIRCLE

```
const val MARK_SHAPE_CIRCLE = 1: Int
```  

### MARK_SHAPE_DOT

```
const val MARK_SHAPE_DOT = 2: Int
```  

### MARK_SHAPE_NONE

```
const val MARK_SHAPE_NONE = 0: Int
```  

### MARK_SHAPE_SESAME

```
const val MARK_SHAPE_SESAME = 3: Int
```  

## Public constructors

### TextEmphasisSpan

```
TextEmphasisSpan(
    @TextEmphasisSpan.MarkShape shape: Int,
    @TextEmphasisSpan.MarkFill fill: Int,
    @TextAnnotation.Position position: Int
)
```  

## Public functions

### fromBundle

```
java-static fun fromBundle(bundle: Bundle!): TextEmphasisSpan!
```  

### toBundle

```
fun toBundle(): Bundle!
```  

## Public properties

### markFill

```
@TextEmphasisSpan.MarkFill
val markFill: Int
```

The mark fill for the text emphasis mark.  

### markShape

```
@TextEmphasisSpan.MarkShape
val markShape: Int
```

The mark shape used for text emphasis.  

### position

```
@TextAnnotation.Position
val position: Int
```

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