# LayoutElementBuilders.FontSetting

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

*** ** * ** ***

<br />

```
@RequiresSchemaVersion(major = 1, minor = 400)
public interface LayoutElementBuilders.FontSetting
```

<br />

*** ** * ** ***

Interface defining a single point of customization in a font.

## Summary

| ### Public methods |
|---|---|
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting#roundness(int)(int value)` `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` option for custom roundness for font. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting#tabularNum()()` `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` option for enabling displaying tabular numerals. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting#weight(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 1, to = 1000) int value)` `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` option for custom weight for font. |
| `default static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 400) https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting#width(float)(@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 25, to = 200) float value)` `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` option for custom width for font. |

## Public methods

### roundness

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

```
@RequiresSchemaVersion(major = 1, minor = 400)
default static @NonNull LayoutElementBuilders.FontSetting roundness(int value)
```

`https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` option for custom roundness for font. For more information, see [here](https://fonts.google.com/knowledge/glossary/rond_axis).

| Parameters |
|---|---|
| `int value` | roundness, usually in 0..100, but actual range and availability can depend on the font used |

### tabularNum

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

```
@RequiresSchemaVersion(major = 1, minor = 400)
default static @NonNull LayoutElementBuilders.FontSetting tabularNum()
```

`https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` option for enabling displaying tabular numerals. In other words, all numeral characters will have the same width. This corresponds to `tnum` OpenType feature.

This setting's availability is font dependent and may not have effect on all font families, some of them like Roboto automatically space out numeral characters to have the same width, while other characters will have their own width.

### weight

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

```
@RequiresSchemaVersion(major = 1, minor = 400)
default static @NonNull LayoutElementBuilders.FontSetting weight(@IntRange(from = 1, to = 1000) int value)
```

`https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` option for custom weight for font. Similar to the `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontWeightProp` but it accepts any value. For more information, see [here](https://fonts.google.com/knowledge/glossary/weight_axis).

Note that using this `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` will override `https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontStyle.Builder#setWeight(androidx.wear.protolayout.LayoutElementBuilders.FontWeightProp)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 1, to = 1000) int value` | weight, usually in 1..1000, but actual range can be smaller, depending on the font used |

### width

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

```
@RequiresSchemaVersion(major = 1, minor = 400)
default static @NonNull LayoutElementBuilders.FontSetting width(@FloatRange(from = 25, to = 200) float value)
```

`https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.FontSetting` option for custom width for font. For more information, see [here](https://fonts.google.com/knowledge/glossary/width_axis).

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 25, to = 200) float value` | width, usually in 25..200, but actual range can depend on the font used |