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

*** ** * ** ***


```
public enum TextOrientation extends Enum<@NonNull TextOrientation>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [kotlin.Enum](https://developer.android.com/reference/java/lang/Enum.html)\<@[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) [TextOrientation](https://developer.android.com/reference/androidx/text/vertical/TextOrientation)\> ||
|   | ↳ | [androidx.text.vertical.TextOrientation](https://developer.android.com/reference/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/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/androidx/text/vertical/TextOrientation#Sideways` | All characters are rotated 90 degrees clockwise, regardless of script. |
| `https://developer.android.com/reference/androidx/text/vertical/TextOrientation#Upright` | Specifies that all characters are laid out in an upright orientation, regardless of script. |

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/text/vertical/TextOrientation` | `https://developer.android.com/reference/androidx/text/vertical/TextOrientation#fromInt(kotlin.Int)(int value)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/text/vertical/TextOrientation>` | `https://developer.android.com/reference/androidx/text/vertical/TextOrientation#getEntries()()` 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. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/text/vertical/TextOrientation` | `https://developer.android.com/reference/androidx/text/vertical/TextOrientation#valueOf(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html value)` Returns the enum constant of this type with the specified name. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull TextOrientation[]` | `https://developer.android.com/reference/androidx/text/vertical/TextOrientation#values()()` Returns an array containing the constants of this enum type, in the order they're declared. |

## Enum Values

### Mixed

```
TextOrientation TextOrientation.Mixed
```

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

```
TextOrientation TextOrientation.Sideways
```

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

```
TextOrientation TextOrientation.Upright
```

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 methods

### fromInt

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

```
public static final @NonNull TextOrientation fromInt(int value)
```

### getEntries

```
public final @NonNull EnumEntries<@NonNull TextOrientation> getEntries()
```

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.

### valueOf

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

```
public static final @NonNull TextOrientation valueOf(@NonNull String value)
```

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)

```
public static final @NonNull TextOrientation[] values()
```

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.