FontShearSpan


class FontShearSpan : MetricAffectingSpan


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

This span inherits from MetricAffectingSpan, but it is specifically designed for use within a 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.

See DEFAULT_FONT_SHEAR for the default value.

Note: This span only works with VerticalTextLayout.

Summary

Constants

const Float
DEFAULT_FONT_SHEAR = 0.2679492f

Default constant for fontShear.

Public constructors

FontShearSpan(fontShear: Float)

Public functions

open Unit
open Unit

Public properties

Float

The shear factor to apply to the text.

Constants

DEFAULT_FONT_SHEAR

const val DEFAULT_FONT_SHEAR = 0.2679492f: Float

Default constant for fontShear.

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

Public constructors

FontShearSpan

Added in 1.0.0-alpha01
FontShearSpan(fontShear: Float = DEFAULT_FONT_SHEAR)

Public functions

updateDrawState

Added in 1.0.0-alpha01
open fun updateDrawState(p0: TextPaint?): Unit

updateMeasureState

Added in 1.0.0-alpha01
open fun updateMeasureState(p0: TextPaint): Unit

Public properties

fontShear

Added in 1.0.0-alpha01
val fontShearFloat

The shear factor to apply to the text.