Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [XML Attrs](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#lattrs) \| [Inherited Constants](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#inhconstants) \| [Ctors](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#pubctors) \| [Methods](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#inhmethods)

# TextAppearanceSpan

*** ** * ** ***


`
public


class
TextAppearanceSpan
`


`


`

`


`

`

extends https://developer.android.com/reference/android/text/style/MetricAffectingSpan


`

`


implements

https://developer.android.com/reference/android/text/ParcelableSpan


`

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||||
| ↳ | [android.text.style.CharacterStyle](https://developer.android.com/reference/android/text/style/CharacterStyle) |||
|   | ↳ | [android.text.style.MetricAffectingSpan](https://developer.android.com/reference/android/text/style/MetricAffectingSpan) ||
|   |   | ↳ | android.text.style.TextAppearanceSpan |

<br />

*** ** * ** ***

Sets the text appearance using the given
`https://developer.android.com/reference/android/R.styleable#TextAppearance` attributes.
By default `https://developer.android.com/reference/android/text/style/TextAppearanceSpan` only changes the specified attributes in XML.
`https://developer.android.com/reference/android/R.styleable#TextAppearance_textColorHighlight`,
`https://developer.android.com/reference/android/R.styleable#TextAppearance_textColorHint`,
`https://developer.android.com/reference/android/R.styleable#TextAppearance_textAllCaps` and
`https://developer.android.com/reference/android/R.styleable#TextAppearance_fallbackLineSpacing`
are not supported by `https://developer.android.com/reference/android/text/style/TextAppearanceSpan`.
**See also:**

- `https://developer.android.com/reference/android/widget/TextView#setTextAppearance(int)`

## Summary

| ### XML attributes ||
|---|---|
| [`android:elegantTextHeight`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:elegantTextHeight) | Elegant text height, especially for less compacted complex script text. |
| [`android:fontFamily`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:fontFamily) | Font family (named by string or as a font resource reference) for the text. |
| [`android:fontFeatureSettings`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:fontFeatureSettings) | Font feature settings. |
| [`android:fontVariationSettings`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:fontVariationSettings) | Font variation settings. |
| [`android:letterSpacing`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:letterSpacing) | Text letter-spacing. |
| [`android:shadowColor`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:shadowColor) | Place a blurred shadow of text underneath the text, drawn with the specified color. |
| [`android:shadowDx`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:shadowDx) | Horizontal offset of the text shadow. |
| [`android:shadowDy`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:shadowDy) | Vertical offset of the text shadow. |
| [`android:shadowRadius`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:shadowRadius) | Blur radius of the text shadow. |
| [`android:textColor`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:textColor) | Text color. |
| [`android:textColorLink`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:textColorLink) | Color of the links. |
| [`android:textFontWeight`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:textFontWeight) | Weight for the font used in the TextView. |
| [`android:textSize`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:textSize) | Size of the text. |
| [`android:textStyle`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:textStyle) | Style (normal, bold, italic, bold\|italic) for the text. |
| [`android:typeface`](https://developer.android.com/reference/android/text/style/TextAppearanceSpan#attr_android:typeface) | Typeface (normal, sans, serif, monospace) for the text. |

| ### Inherited constants |
|---|
| From interface `https://developer.android.com/reference/android/os/Parcelable` |---|---| | `int` | `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. | | `int` | `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#TextAppearanceSpan(android.content.Context,%20int)(https://developer.android.com/reference/android/content/Context context, int appearance) ` Uses the specified TextAppearance resource to determine the text appearance. |
| ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#TextAppearanceSpan(android.content.Context,%20int,%20int)(https://developer.android.com/reference/android/content/Context context, int appearance, int colorList) ` Uses the specified TextAppearance resource to determine the text appearance, and the specified text color resource to determine the color. |
| ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#TextAppearanceSpan(android.os.Parcel)(https://developer.android.com/reference/android/os/Parcel src) ` |
| ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#TextAppearanceSpan(java.lang.String,%20int,%20int,%20android.content.res.ColorStateList,%20android.content.res.ColorStateList)(https://developer.android.com/reference/java/lang/String family, int style, int size, https://developer.android.com/reference/android/content/res/ColorStateList color, https://developer.android.com/reference/android/content/res/ColorStateList linkColor) ` Makes text be drawn with the specified typeface, size, style, and colors. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getFamily()() ` Returns the typeface family specified by this span, or `null` if it does not specify one. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getFontFeatureSettings()() ` Returns the font feature settings specified by this span, or `null` if it does not specify one. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getFontVariationSettings()() ` Returns the font variation settings specified by this span, or `null` if it does not specify one. |
| ` float` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getLetterSpacing()() ` Returns the value of letter spacing to be added in em unit. |
| ` https://developer.android.com/reference/android/content/res/ColorStateList` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getLinkTextColor()() ` Returns the link color specified by this span, or `null` if it does not specify one. |
| ` int` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getShadowColor()() ` Returns the color of the text shadow specified by this span, or `0` if it does not specify one. |
| ` float` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getShadowDx()() ` Returns the horizontal offset of the text shadow specified by this span, or `0.0f` if it does not specify one. |
| ` float` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getShadowDy()() ` Returns the vertical offset of the text shadow specified by this span, or `0.0f` if it does not specify one. |
| ` float` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getShadowRadius()() ` Returns the blur radius of the text shadow specified by this span, or `0.0f` if it does not specify one. |
| ` int` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getSpanTypeId()() ` Return a special type identifier for this span class. |
| ` https://developer.android.com/reference/android/content/res/ColorStateList` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getTextColor()() ` Returns the text color specified by this span, or `null` if it does not specify one. |
| ` int` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getTextFontWeight()() ` Returns the text font weight specified by this span, or `FontStyle.FONT_WEIGHT_UNSPECIFIED` if it does not specify one. |
| ` https://developer.android.com/reference/android/os/LocaleList` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getTextLocales()() ` Returns the `https://developer.android.com/reference/android/os/LocaleList` specified by this span, or `null` if it does not specify one. |
| ` int` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getTextSize()() ` Returns the text size specified by this span, or `-1` if it does not specify one. |
| ` int` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getTextStyle()() ` Returns the text style specified by this span, or `0` if it does not specify one. |
| ` https://developer.android.com/reference/android/graphics/Typeface` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#getTypeface()() ` Returns the typeface specified by this span, or `null` if it does not specify one. |
| ` boolean` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#isElegantTextHeight()() ` Returns the value of elegant height metrics flag specified by this span, or `false` if it does not specify one. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#updateDrawState(android.text.TextPaint)(https://developer.android.com/reference/android/text/TextPaint ds) ` |
| ` void` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#updateMeasureState(android.text.TextPaint)(https://developer.android.com/reference/android/text/TextPaint ds) ` Classes that extend MetricAffectingSpan implement this method to update the text formatting in a way that can change the width or height of characters. |
| ` void` | ` https://developer.android.com/reference/android/text/style/TextAppearanceSpan#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/android/text/style/MetricAffectingSpan ` |---|---| | ` https://developer.android.com/reference/android/text/style/MetricAffectingSpan` | ` https://developer.android.com/reference/android/text/style/MetricAffectingSpan#getUnderlying()() ` Returns "this" for most MetricAffectingSpans, but for MetricAffectingSpans that were generated by `https://developer.android.com/reference/android/text/style/CharacterStyle#wrap(android.text.style.CharacterStyle)`, returns the underlying MetricAffectingSpan. | | ` abstract void` | ` https://developer.android.com/reference/android/text/style/MetricAffectingSpan#updateMeasureState(android.text.TextPaint)(https://developer.android.com/reference/android/text/TextPaint textPaint) ` Classes that extend MetricAffectingSpan implement this method to update the text formatting in a way that can change the width or height of characters. | ||
| From class ` https://developer.android.com/reference/android/text/style/CharacterStyle ` |---|---| | ` https://developer.android.com/reference/android/text/style/CharacterStyle` | ` https://developer.android.com/reference/android/text/style/CharacterStyle#getUnderlying()() ` Returns "this" for most CharacterStyles, but for CharacterStyles that were generated by `https://developer.android.com/reference/android/text/style/CharacterStyle#wrap(android.text.style.CharacterStyle)`, returns the underlying CharacterStyle. | | ` abstract void` | ` https://developer.android.com/reference/android/text/style/CharacterStyle#updateDrawState(android.text.TextPaint)(https://developer.android.com/reference/android/text/TextPaint tp) ` | | ` static https://developer.android.com/reference/android/text/style/CharacterStyle` | ` https://developer.android.com/reference/android/text/style/CharacterStyle#wrap(android.text.style.CharacterStyle)(https://developer.android.com/reference/android/text/style/CharacterStyle cs) ` A given CharacterStyle can only applied to a single region of a given Spanned. | ||
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||
| From interface ` https://developer.android.com/reference/android/text/ParcelableSpan ` |---|---| | ` abstract int` | ` https://developer.android.com/reference/android/text/ParcelableSpan#getSpanTypeId()() ` Return a special type identifier for this span class. | ||
| From interface ` https://developer.android.com/reference/android/os/Parcelable ` |---|---| | ` abstract int` | ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. | | ` abstract void` | ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. | ||

## XML attributes

### android:elegantTextHeight

Elegant text height, especially for less compacted complex script text.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:fontFamily

Font family (named by string or as a font resource reference) for the text.

May be a string value, using '\\\\;' to escape characters such as
'\\\\n' or '\\\\uxxxx' for a unicode character;

<br />

### android:fontFeatureSettings

Font feature settings.

May be a string value, using '\\\\;' to escape characters such as
'\\\\n' or '\\\\uxxxx' for a unicode character;

<br />

### android:fontVariationSettings

Font variation settings.

May be a string value, using '\\\\;' to escape characters such as
'\\\\n' or '\\\\uxxxx' for a unicode character;

<br />

### android:letterSpacing

Text letter-spacing.

May be a floating point value, such as "`1.2`".

<br />

### android:shadowColor

Place a blurred shadow of text underneath the text, drawn with the
specified color. The text shadow produced does not interact with
properties on View that are responsible for real time shadows,
`https://developer.android.com/reference/android/R.styleable#View_elevation` and
`https://developer.android.com/reference/android/R.styleable#View_translationZ`.

May be a color value, in the form of "`#*rgb*`",
"`#*argb*`", "`#*rrggbb*`", or
"`#*aarrggbb*`".

<br />

### android:shadowDx

Horizontal offset of the text shadow.

May be a floating point value, such as "`1.2`".

<br />

### android:shadowDy

Vertical offset of the text shadow.

May be a floating point value, such as "`1.2`".

<br />

### android:shadowRadius

Blur radius of the text shadow.

May be a floating point value, such as "`1.2`".

<br />

### android:textColor

Text color.

May be a reference to another resource, in the form
"`@[+][*package*:]*type*/*name*`" or a theme
attribute in the form
"`?[*package*:]*type*/*name*`".

May be a color value, in the form of "`#*rgb*`",
"`#*argb*`", "`#*rrggbb*`", or
"`#*aarrggbb*`".

<br />

### android:textColorLink

Color of the links.

May be a reference to another resource, in the form
"`@[+][*package*:]*type*/*name*`" or a theme
attribute in the form
"`?[*package*:]*type*/*name*`".

May be a color value, in the form of "`#*rgb*`",
"`#*argb*`", "`#*rrggbb*`", or
"`#*aarrggbb*`".

<br />

### android:textFontWeight

Weight for the font used in the TextView.

May be an integer value, such as "`100`".

<br />

### android:textSize

Size of the text. Recommended dimension type for text is "sp" for scaled-pixels (example: 15sp).

May be a dimension value, which is a floating point number appended with a
unit such as "`14.5sp`".
Available units are: px (pixels), dp (density-independent pixels),
sp (scaled pixels based on preferred font size), in (inches), and
mm (millimeters).

<br />

### android:textStyle

Style (normal, bold, italic, bold\|italic) for the text.

Must be one or more (separated by '\|') of the following constant values.

| Constant | Value | Description |
|---|---|---|
| bold | 1 |   |
| italic | 2 |   |
| normal | 0 |   |

<br />

<br />

### android:typeface

Typeface (normal, sans, serif, monospace) for the text.

Must be one of the following constant values.

| Constant | Value | Description |
|---|---|---|
| monospace | 3 |   |
| normal | 0 |   |
| sans | 1 |   |
| serif | 2 |   |

<br />

<br />

## Public constructors

### TextAppearanceSpan

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TextAppearanceSpan (Context context, 
                int appearance)
```

Uses the specified TextAppearance resource to determine the
text appearance. The `appearance` should be, for example,
`android.R.style.TextAppearance_Small`.

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |
| `appearance` | `int` <br /> |

### TextAppearanceSpan

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TextAppearanceSpan (Context context, 
                int appearance, 
                int colorList)
```

Uses the specified TextAppearance resource to determine the
text appearance, and the specified text color resource
to determine the color. The `appearance` should be,
for example, `android.R.style.TextAppearance_Small`,
and the `colorList` should be, for example,
`android.R.styleable.Theme_textColorPrimary`.

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |
| `appearance` | `int` <br /> |
| `colorList` | `int` <br /> |

### TextAppearanceSpan

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TextAppearanceSpan (Parcel src)
```

<br />

<br />

| Parameters ||
|---|---|
| `src` | `Parcel` <br /> |

### TextAppearanceSpan

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public TextAppearanceSpan (String family, 
                int style, 
                int size, 
                ColorStateList color, 
                ColorStateList linkColor)
```

Makes text be drawn with the specified typeface, size, style,
and colors.

<br />

| Parameters ||
|---|---|
| `family` | `String` <br /> |
| `style` | `int` <br /> |
| `size` | `int` <br /> |
| `color` | `ColorStateList` <br /> |
| `linkColor` | `ColorStateList` <br /> |

## Public methods

### describeContents

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`,
the return value of this method must include the
`https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getFamily

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getFamily ()
```

Returns the typeface family specified by this span, or `null`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getFontFeatureSettings

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getFontFeatureSettings ()
```

Returns the font feature settings specified by this span, or `null`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getFontVariationSettings

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getFontVariationSettings ()
```

Returns the font variation settings specified by this span, or `null`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getLetterSpacing

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getLetterSpacing ()
```

Returns the value of letter spacing to be added in em unit.

<br />

| Returns ||
|---|---|
| `float` | a letter spacing amount <br /> |

### getLinkTextColor

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ColorStateList getLinkTextColor ()
```

Returns the link color specified by this span, or `null`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/ColorStateList` | <br /> |

### getShadowColor

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getShadowColor ()
```

Returns the color of the text shadow specified by this span, or `0`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getShadowDx

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getShadowDx ()
```

Returns the horizontal offset of the text shadow specified by this span, or `0.0f`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `float` | <br /> |

### getShadowDy

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getShadowDy ()
```

Returns the vertical offset of the text shadow specified by this span, or `0.0f`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `float` | <br /> |

### getShadowRadius

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getShadowRadius ()
```

Returns the blur radius of the text shadow specified by this span, or `0.0f`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `float` | <br /> |

### getSpanTypeId

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSpanTypeId ()
```

Return a special type identifier for this span class.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getTextColor

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ColorStateList getTextColor ()
```

Returns the text color specified by this span, or `null`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/res/ColorStateList` | <br /> |

### getTextFontWeight

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getTextFontWeight ()
```

Returns the text font weight specified by this span, or
`FontStyle.FONT_WEIGHT_UNSPECIFIED` if it does not specify one.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getTextLocales

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public LocaleList getTextLocales ()
```

Returns the `https://developer.android.com/reference/android/os/LocaleList` specified by this span, or `null`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/LocaleList` | <br /> |

### getTextSize

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getTextSize ()
```

Returns the text size specified by this span, or `-1`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getTextStyle

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getTextStyle ()
```

Returns the text style specified by this span, or `0`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getTypeface

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Typeface getTypeface ()
```

Returns the typeface specified by this span, or `null`
if it does not specify one.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Typeface` | <br /> |

### isElegantTextHeight

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isElegantTextHeight ()
```

Returns the value of elegant height metrics flag specified by this span,
or `false` if it does not specify one.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### toString

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### updateDrawState

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void updateDrawState (TextPaint ds)
```

<br />

<br />

| Parameters ||
|---|---|
| `ds` | `TextPaint` <br /> |

### updateMeasureState

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void updateMeasureState (TextPaint ds)
```

Classes that extend MetricAffectingSpan implement this method to update the text formatting
in a way that can change the width or height of characters.

<br />

| Parameters ||
|---|---|
| `ds` | `TextPaint`: the paint used for drawing the text. This value cannot be `null`. <br /> |

### writeToParcel

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |