# FontShearSpan

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

*** ** * ** ***


```
class FontShearSpan : MetricAffectingSpan
```

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||
| ↳ | [android.text.style.CharacterStyle](https://developer.android.com/reference/android/text/style/CharacterStyle.html) |||
|   | ↳ | [android.text.style.MetricAffectingSpan](https://developer.android.com/reference/android/text/style/MetricAffectingSpan.html) ||
|   |   | ↳ | [androidx.text.vertical.FontShearSpan](https://developer.android.com/reference/kotlin/androidx/text/vertical/FontShearSpan) |

*** ** * ** ***

A span that applies a shear (skew) transformation to vertical writing text.

This span inherits from `https://developer.android.com/reference/android/text/style/MetricAffectingSpan.html`, but it is specifically designed for use within a `https://developer.android.com/reference/kotlin/androidx/text/vertical/VerticalTextLayout` and will not have an effect in other contexts.

It is used to achieve an italic-like effect for vertical text layout, where traditional italic fonts may not render correctly.

The shear value represents the horizontal skew factor for rotated or tate-chu-yoko text. For upright text, this value is used as the vertical skew factor.

NOTE: This span only works with `https://developer.android.com/reference/kotlin/androidx/text/vertical/VerticalTextLayout`.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/text/vertical/FontShearSpan#DEFAULT_FONT_SHEAR() = 0.2679492f` Default constant for fontShear. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/text/vertical/FontShearSpan#FontShearSpan(kotlin.Float)(fontShear: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/text/vertical/FontShearSpan#updateDrawState(android.text.TextPaint)(textPaint: https://developer.android.com/reference/android/text/TextPaint.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/text/vertical/FontShearSpan#updateMeasureState(android.text.TextPaint)(textPaint: https://developer.android.com/reference/android/text/TextPaint.html)` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/text/vertical/FontShearSpan#fontShear()` The shear factor to apply to the text. |

### Inherited properties

From [android.text.style.MetricAffectingSpan](https://developer.android.com/reference/android/text/style/MetricAffectingSpan.html) `open https://developer.android.com/reference/android/text/style/MetricAffectingSpan.html` `https://developer.android.com/reference/android/text/style/MetricAffectingSpan.html#underlying`

## Constants

### DEFAULT_FONT_SHEAR

```
const val DEFAULT_FONT_SHEAR = 0.2679492f: Float
```

Default constant for fontShear.

This value represents a shear angle of 15 degrees (tan(15 deg)).

## Public constructors

### FontShearSpan

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

```
FontShearSpan(fontShear: Float = DEFAULT_FONT_SHEAR)
```

## Public functions

### updateDrawState

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

```
open fun updateDrawState(textPaint: TextPaint?): Unit
```

### updateMeasureState

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

```
open fun updateMeasureState(textPaint: TextPaint): Unit
```

## Public properties

### fontShear

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

```
val fontShear: Float
```

The shear factor to apply to the text. This is the tangent of the shear angle.