# TextOrientation

Artifact: [androidx.text:text-vertical](https://developer.android.com/jetpack/androidx/releases/text) [View Source](https://cs.android.com/search?q=file:androidx/text/vertical/Orientations.kt+class:androidx.text.vertical.TextOrientation) Added in [1.0.0-beta03](https://developer.android.com/jetpack/androidx/releases/text#1.0.0-beta03)

*** ** * ** ***


```
enum TextOrientation : Enum<TextOrientation>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)\<[TextOrientation](https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation)\> ||
|   | ↳ | [androidx.text.vertical.TextOrientation](https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation) |

*** ** * ** ***

Represents the orientation of text within a vertical writing mode.

This controls how text characters are displayed when using a vertical writing mode. For more information, refer to: [CSS text-orientation](https://www.w3.org/TR/css-writing-modes-3/#text-orientation)

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation#Mixed` | Characters from horizontal scripts are rotated 90 degrees clockwise, while characters from vertical scripts remain in their original orientation. |
| `https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation#Sideways` | All characters are rotated 90 degrees clockwise, regardless of script. |
| `https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation#Upright` | Specifies that all characters are laid out in an upright orientation, regardless of script. |

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation` | `https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation#fromInt(kotlin.Int)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation` | `https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation#valueOf(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation>` | `https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation#values()()` Returns an array containing the constants of this enum type, in the order they're declared. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation>` | `https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation#entries()` Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared. |

## Enum Values

### Mixed

```
val TextOrientation.Mixed: TextOrientation
```

Characters from horizontal scripts are rotated 90 degrees clockwise, while characters from vertical scripts remain in their original orientation.

This is useful for mixed-script content where you want horizontal text to fit vertically while vertical text remains upright.

Corresponds to CSS `text-orientation: mixed;`.

### Sideways

```
val TextOrientation.Sideways: TextOrientation
```

All characters are rotated 90 degrees clockwise, regardless of script.

This is useful when you want all text to be sideways in a vertical layout.

Corresponds to CSS `text-orientation: sideways;`.

### Upright

```
val TextOrientation.Upright: TextOrientation
```

Specifies that all characters are laid out in an upright orientation, regardless of script.

This is useful when you want all characters to remain upright even for horizontal scripts.

Corresponds to CSS `text-orientation: upright;`.

## Public companion functions

### fromInt

Added in [1.0.0-beta03](https://developer.android.com/jetpack/androidx/releases/text#1.0.0-beta03)

```
fun fromInt(value: Int): TextOrientation
```

## Public functions

### valueOf

Added in [1.0.0-beta03](https://developer.android.com/jetpack/androidx/releases/text#1.0.0-beta03)

```
fun valueOf(value: String): TextOrientation
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if this enum type has no constant with the specified name |

### values

Added in [1.0.0-beta03](https://developer.android.com/jetpack/androidx/releases/text#1.0.0-beta03)

```
fun values(): Array<TextOrientation>
```

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using `entries` property as a more efficient alternative returning an immutable list of enum entries.

## Public properties

### entries

```
val entries: EnumEntries<TextOrientation>
```

Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared.