EmphasisSpan


public final class EmphasisSpan extends 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

static final boolean

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

static final int

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

static final float

The default scale factor for emphasis marks.

static final int

Emphasis mark is a large circle.

static final int

Emphasis mark is a small circle.

static final int

Emphasis mark is a double circle.

static final int

Emphasis mark is a sesame.

static final int

Emphasis mark is a triangle.

Public constructors

EmphasisSpan(int style, boolean isFilled, float scale)

Public methods

final float

The scale factor for the size of the mark.

final int

The style of the emphasis mark.

final boolean

Whether the mark should be filled or outlined.

void
void

Constants

DEFAULT_EMPHASIS_FILL

public static final boolean DEFAULT_EMPHASIS_FILL = true

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

DEFAULT_EMPHASIS_STYLE

public static final int DEFAULT_EMPHASIS_STYLE

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

DEFAULT_SCALE

public static final float DEFAULT_SCALE = 0.5f

The default scale factor for emphasis marks.

STYLE_CIRCLE

public static final int STYLE_CIRCLE = 1

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

STYLE_DOT

public static final int STYLE_DOT = 0

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

STYLE_DOUBLE_CIRCLE

public static final int STYLE_DOUBLE_CIRCLE = 2

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

STYLE_SESAME

public static final int STYLE_SESAME = 4

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

STYLE_TRIANGLE

public static final int STYLE_TRIANGLE = 3

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
public EmphasisSpan(int style, boolean isFilled, float scale)
Parameters
int 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.

boolean isFilled

Whether the mark should be filled or outlined.

float 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 methods

getScale

Added in 1.0.0-alpha01
public final float getScale()

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.

getStyle

Added in 1.0.0-alpha01
public final int getStyle()

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

Added in 1.0.0-alpha01
public final boolean isFilled()

Whether the mark should be filled or outlined.

updateDrawState

Added in 1.0.0-alpha01
public void updateDrawState(TextPaint p0)

updateMeasureState

Added in 1.0.0-alpha01
public void updateMeasureState(@NonNull TextPaint p0)