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 figures.

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

FontSetting option for custom weight for font.

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

FontSetting option for custom width for font.

Public methods

tabularNum

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

FontSetting option for enabling displaying tabular figures. 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-alpha04
@RequiresSchemaVersion(major = 1, minor = 400)
default static @NonNull LayoutElementBuilders.FontSetting weight(float value)

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

Note that using this FontSetting will override setWeight.

Parameters
float value

weight, usually in 1..1000, but actual range can depend on the font used

width

Added in 1.2.0-alpha04
@RequiresSchemaVersion(major = 1, minor = 400)
default static @NonNull LayoutElementBuilders.FontSetting width(float value)

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

Parameters
float value

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