EmphasisSpan


class EmphasisSpan : MetricAffectingSpan


A span that applies emphasis marks to text in a vertical layout.

This span is designed for use with VerticalTextLayout and will not have an effect in other contexts. It allows for the application of various emphasis styles, such as dots, circles, or triangles, above or next to characters in vertical text.

The EmphasisSpan takes a style, a boolean indicating whether the mark should be filled, and a scale factor for the size of the mark.

Summary

Constants

const Boolean

The default value for whether the emphasis mark should be filled.

const Int

The default style used for emphasis marks, typically a dot.

const Float

The default scale factor for emphasis marks.

const Int

Emphasis mark is a large circle.

const Int

Emphasis mark is a small circle.

const Int

Emphasis mark is a double circle.

const Int

Emphasis mark is a sesame.

const Int

Emphasis mark is a triangle.

Public constructors

EmphasisSpan(style: Int, isFilled: Boolean, scale: Float)

Public functions

open Unit
open Unit

Public properties

Boolean

Whether the mark should be filled or outlined.

Float

The scale factor for the size of the mark.

Int

The style of the emphasis mark.

Constants

DEFAULT_EMPHASIS_FILL

const val DEFAULT_EMPHASIS_FILL = true: Boolean

The default value for whether the emphasis mark should be filled.

DEFAULT_EMPHASIS_STYLE

const val DEFAULT_EMPHASIS_STYLEInt

The default style used for emphasis marks, typically a dot.

DEFAULT_SCALE

const val DEFAULT_SCALE = 0.5f: Float

The default scale factor for emphasis marks.

STYLE_CIRCLE

const val STYLE_CIRCLE = 1: Int

Emphasis mark is a large circle. The filled dot is U+25CF, open dot is U+25CB.

STYLE_DOT

const val STYLE_DOT = 0: Int

Emphasis mark is a small circle. The filled dot is U+2022, open dot is U+25E6.

STYLE_DOUBLE_CIRCLE

const val STYLE_DOUBLE_CIRCLE = 2: Int

Emphasis mark is a double circle. The filled dot is U+25C9, open dot is U+25CE.

STYLE_SESAME

const val STYLE_SESAME = 4: Int

Emphasis mark is a sesame. The filled dot is U+FE45, open dot is U+FE46.

STYLE_TRIANGLE

const val STYLE_TRIANGLE = 3: Int

Emphasis mark is a triangle. The filled dot is U+25B2, open dot is U+25B3.

Public constructors

EmphasisSpan

Added in 1.0.0-alpha01
EmphasisSpan(
    style: Int = DEFAULT_EMPHASIS_STYLE,
    isFilled: Boolean = DEFAULT_EMPHASIS_FILL,
    scale: Float = DEFAULT_SCALE
)
Parameters
style: Int = DEFAULT_EMPHASIS_STYLE

The style of the emphasis mark. This value determines the size of the emphasis mark relative to the font size. A scale of 0.5f means the emphasis mark will be half the size of the text.

isFilled: Boolean = DEFAULT_EMPHASIS_FILL

Whether the mark should be filled or outlined.

scale: Float = DEFAULT_SCALE

The scale factor for the size of the mark. When true, the emphasis mark will be drawn as a solid shape. When false, it will be drawn as an outline.

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

isFilled

Added in 1.0.0-alpha01
val isFilledBoolean

Whether the mark should be filled or outlined.

scale

Added in 1.0.0-alpha01
val scaleFloat

The scale factor for the size of the mark. When true, the emphasis mark will be drawn as a solid shape. When false, it will be drawn as an outline.

style

Added in 1.0.0-alpha01
val styleInt

The style of the emphasis mark. This value determines the size of the emphasis mark relative to the font size. A scale of 0.5f means the emphasis mark will be half the size of the text.