# VerticalTextLayout

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/VerticalTextLayout.kt+class:androidx.text.vertical.VerticalTextLayout) Added in [1.0.0-beta03](https://developer.android.com/jetpack/androidx/releases/text#1.0.0-beta03)

*** ** * ** ***


```
class VerticalTextLayout
```

<br />

*** ** * ** ***

Represents the result of laying out text vertically.

This class encapsulates the result of a vertical text layout process. It stores the layout's properties and provides methods to draw the layout on a `https://developer.android.com/reference/android/graphics/Canvas.html`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/text/vertical/VerticalTextLayout#VerticalTextLayout(kotlin.CharSequence,kotlin.Int,kotlin.Int,android.text.TextPaint,kotlin.Float,androidx.text.vertical.TextOrientation)( text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html, start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, end: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, paint: https://developer.android.com/reference/android/text/TextPaint.html, height: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, orientation: https://developer.android.com/reference/kotlin/androidx/text/vertical/TextOrientation )` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/text/vertical/VerticalTextLayout#draw(android.graphics.Canvas,kotlin.Float,kotlin.Float)(canvas: https://developer.android.com/reference/android/graphics/Canvas.html, x: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Draws this text layout onto the specified `https://developer.android.com/reference/android/graphics/Canvas.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/text/vertical/VerticalTextLayout#isVerticalTextSupported()()` Capability query to determine whether `https://developer.android.com/reference/kotlin/androidx/text/vertical/VerticalTextLayout` supports vertical text painting. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/text/vertical/VerticalTextLayout#lineCount()` The number of lines (columns) in this vertical text layout. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/text/vertical/VerticalTextLayout#width()` The computed width of the vertical text layout in pixels. |

## Public constructors

### VerticalTextLayout

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

```
VerticalTextLayout(
    text: CharSequence = "",
    start: Int = 0,
    end: Int = text.length,
    paint: TextPaint = TextPaint(),
    height: @Px Float = 0.0f,
    orientation: TextOrientation = TextOrientation.Mixed
)
```

## Public functions

### draw

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

```
fun draw(canvas: Canvas, x: @Px Float, y: @Px Float): Unit
```

Draws this text layout onto the specified `https://developer.android.com/reference/android/graphics/Canvas.html`.

| Parameters |
|---|---|
| `canvas: https://developer.android.com/reference/android/graphics/Canvas.html` | The `https://developer.android.com/reference/android/graphics/Canvas.html` to draw onto. |
| `x: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The horizontal offset in pixels. The drawing origin is the top-right corner. |
| `y: @https://developer.android.com/reference/kotlin/androidx/annotation/Px https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The vertical offset in pixels. The drawing origin is the top-right corner. |

### isVerticalTextSupported

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

```
fun isVerticalTextSupported(): Boolean
```

Capability query to determine whether `https://developer.android.com/reference/kotlin/androidx/text/vertical/VerticalTextLayout` supports vertical text painting. If this returns false, `https://developer.android.com/reference/kotlin/androidx/text/vertical/VerticalTextLayout#draw(android.graphics.Canvas,kotlin.Float,kotlin.Float)` will have no effect.

## Public properties

### lineCount

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

```
val lineCount: Int
```

The number of lines (columns) in this vertical text layout.

### width

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

```
val width: Float
```

The computed width of the vertical text layout in pixels.