# LayoutElementBuilders.FontStyle.Builder

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.Builder) 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.Builder
```

<br />

*** ** * ** ***

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

Builder for `https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle`

## Summary

| ### Public constructors |
|---|
| `[Builder](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#Builder())()` **This method is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle` | `[build](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#build())()` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder` | `[setColor](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setColor(androidx.wear.tiles.ColorBuilders.ColorProp))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/ColorBuilders.ColorProp color)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder` | `[setItalic](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setItalic(boolean))(boolean italic)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder` | `[setItalic](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setItalic(androidx.wear.tiles.TypeBuilders.BoolProp))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/TypeBuilders.BoolProp italic)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder` | `[setLetterSpacing](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setLetterSpacing(androidx.wear.tiles.DimensionBuilders.EmProp))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/DimensionBuilders.EmProp letterSpacing)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder` | `[setSize](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setSize(androidx.wear.tiles.DimensionBuilders.SpProp))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/DimensionBuilders.SpProp size)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder` | `[setUnderline](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setUnderline(boolean))(boolean underline)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder` | `[setUnderline](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setUnderline(androidx.wear.tiles.TypeBuilders.BoolProp))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/TypeBuilders.BoolProp underline)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder` | `@https://developer.android.com/reference/androidx/wear/tiles/TilesExperimental [setVariant](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setVariant(int))(int variant)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder` | `@https://developer.android.com/reference/androidx/wear/tiles/TilesExperimental [setVariant](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setVariant(androidx.wear.tiles.LayoutElementBuilders.FontVariantProp))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontVariantProp variant)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder` | `[setWeight](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setWeight(int))(int weight)` **This method is deprecated.** Deprecated in Java |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder` | `[setWeight](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setWeight(androidx.wear.tiles.LayoutElementBuilders.FontWeightProp))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontWeightProp weight)` **This method is deprecated.** Deprecated in Java |

## Public constructors

### Builder

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 [Builder](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#Builder())()
```

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

## Public methods

### build

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 @NonNull LayoutElementBuilders.FontStyle [build](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#build())()
```

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

Builds an instance from accumulated values.

### setColor

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 @NonNull LayoutElementBuilders.FontStyle.Builder [setColor](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setColor(androidx.wear.tiles.ColorBuilders.ColorProp))(@NonNull ColorBuilders.ColorProp color)
```

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

Sets the text color. If not defined, defaults to white.

### setItalic

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 @NonNull LayoutElementBuilders.FontStyle.Builder [setItalic](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setItalic(boolean))(boolean italic)
```

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

Sets whether the text should be rendered in a italic typeface. If not specified, defaults to "false".

### setItalic

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 @NonNull LayoutElementBuilders.FontStyle.Builder [setItalic](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setItalic(androidx.wear.tiles.TypeBuilders.BoolProp))(@NonNull TypeBuilders.BoolProp italic)
```

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

Sets whether the text should be rendered in a italic typeface. If not specified, defaults to "false".

### setLetterSpacing

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 @NonNull LayoutElementBuilders.FontStyle.Builder [setLetterSpacing](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setLetterSpacing(androidx.wear.tiles.DimensionBuilders.EmProp))(@NonNull DimensionBuilders.EmProp letterSpacing)
```

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

Sets the text letter-spacing. Positive numbers increase the space between letters while negative numbers tighten the space. If not specified, defaults to 0.

### setSize

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 @NonNull LayoutElementBuilders.FontStyle.Builder [setSize](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setSize(androidx.wear.tiles.DimensionBuilders.SpProp))(@NonNull DimensionBuilders.SpProp size)
```

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

Sets the size of the font, in scaled pixels (sp). If not specified, defaults to the size of the system's "body" font.

### setUnderline

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 @NonNull LayoutElementBuilders.FontStyle.Builder [setUnderline](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setUnderline(boolean))(boolean underline)
```

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

Sets whether the text should be rendered with an underline. If not specified, defaults to "false".

### setUnderline

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 @NonNull LayoutElementBuilders.FontStyle.Builder [setUnderline](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setUnderline(androidx.wear.tiles.TypeBuilders.BoolProp))(@NonNull TypeBuilders.BoolProp underline)
```

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

Sets whether the text should be rendered with an underline. If not specified, defaults to "false".

### setVariant

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 @NonNull LayoutElementBuilders.FontStyle.Builder [setVariant](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setVariant(int))(int variant)
```

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

Sets 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".

### setVariant

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 @NonNull LayoutElementBuilders.FontStyle.Builder [setVariant](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setVariant(androidx.wear.tiles.LayoutElementBuilders.FontVariantProp))(@NonNull LayoutElementBuilders.FontVariantProp variant)
```

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

Sets 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".

### setWeight

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 @NonNull LayoutElementBuilders.FontStyle.Builder [setWeight](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setWeight(int))(int weight)
```

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

Sets 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".

### setWeight

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 @NonNull LayoutElementBuilders.FontStyle.Builder [setWeight](https://developer.android.com/reference/androidx/wear/tiles/LayoutElementBuilders.FontStyle.Builder#setWeight(androidx.wear.tiles.LayoutElementBuilders.FontWeightProp))(@NonNull LayoutElementBuilders.FontWeightProp weight)
```

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

Sets 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".