# LayoutElementBuilders.FontStyle

Artifact: [androidx.wear.tiles:tiles](https://developer.android.com/jetpack/androidx/releases/wear-tiles) [View Source](https://cs.android.com/search?q=file:androidx/wear/tiles/LayoutElementBuilders.java+class:androidx.wear.tiles.LayoutElementBuilders.FontStyle) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

*** ** * ** ***


```
public final class LayoutElementBuilders.FontStyle
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> Deprecated in Java

The styling of a font (e.g. font size, and metrics).

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder` **This class is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/ColorBuilders.ColorProp` | `[getColor](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getColor())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/TypeBuilders.BoolProp` | `[getItalic](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getItalic())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/DimensionBuilders.EmProp` | `[getLetterSpacing](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getLetterSpacing())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/DimensionBuilders.SpProp` | `[getSize](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getSize())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/TypeBuilders.BoolProp` | `[getUnderline](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getUnderline())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontVariantProp` | `@https://developer.android.com/reference/androidx/wear/tiles/TilesExperimental [getVariant](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getVariant())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontWeightProp` | `[getWeight](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getWeight())()` **This method is deprecated.** Deprecated in Java |

## Public methods

### getColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @Nullable ColorBuilders.ColorProp [getColor](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getColor())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the text color. If not defined, defaults to white. Intended for testing purposes only.

### getItalic

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @Nullable TypeBuilders.BoolProp [getItalic](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getItalic())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets whether the text should be rendered in a italic typeface. If not specified, defaults to "false". Intended for testing purposes only.

### getLetterSpacing

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @Nullable DimensionBuilders.EmProp [getLetterSpacing](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getLetterSpacing())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the text letter-spacing. Positive numbers increase the space between letters while negative numbers tighten the space. If not specified, defaults to 0. Intended for testing purposes only.

### getSize

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @Nullable DimensionBuilders.SpProp [getSize](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getSize())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the size of the font, in scaled pixels (sp). If not specified, defaults to the size of the system's "body" font. Intended for testing purposes only.

### getUnderline

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @Nullable TypeBuilders.BoolProp [getUnderline](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getUnderline())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets whether the text should be rendered with an underline. If not specified, defaults to "false". Intended for testing purposes only.

### getVariant

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
@TilesExperimental
public @Nullable LayoutElementBuilders.FontVariantProp [getVariant](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getVariant())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the variant of a font. Some renderers may use different fonts for title and body text, which can be selected using this field. If not specified, defaults to "body". Intended for testing purposes only.

### getWeight

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.0.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @Nullable LayoutElementBuilders.FontWeightProp [getWeight](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle#getWeight())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Gets the weight of the font. If the provided value is not supported on a platform, the nearest supported value will be used. If not defined, or when set to an invalid value, defaults to "normal". Intended for testing purposes only.