LayoutElementBuilders.FontSetting


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


Interface defining a single point of customization in a font.

Summary

Public methods

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

FontSetting option for enabling displaying tabular numerals.

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

FontSetting option for custom weight for font.

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

FontSetting option for custom width for font.

Public methods

tabularNum

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

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
@RequiresSchemaVersion(major = 1, minor = 400)
default static @NonNull LayoutElementBuilders.FontSetting weight(@IntRange(from = 1, to = 1000) int value)

FontSetting option for custom weight for font. Similar to the but it accepts any value. For more information, see here.

Note that using this FontSetting will override setWeight.

Parameters
@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
@RequiresSchemaVersion(major = 1, minor = 400)
default static @NonNull LayoutElementBuilders.FontSetting width(@FloatRange(from = 25, to = 200) float value)

FontSetting option for custom width for font. For more information, see here.

Parameters
@FloatRange(from = 25, to = 200) float value

width, usually in 25..200, but actual range can depend on the font used