LayoutElementBuilders.FontSetting


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


Interface defining a single point of customization in a font.

Summary

Public functions

java-static LayoutElementBuilders.FontSetting
@RequiresSchemaVersion(major = 1, minor = 400)
tabularNum()

FontSetting option for enabling displaying tabular numerals.

java-static LayoutElementBuilders.FontSetting
@RequiresSchemaVersion(major = 1, minor = 400)
weight(value: @IntRange(from = 1, to = 1000) Int)

FontSetting option for custom weight for font.

java-static LayoutElementBuilders.FontSetting
@RequiresSchemaVersion(major = 1, minor = 400)
width(value: @FloatRange(from = 0) Float)

FontSetting option for custom width for font.

Public functions

tabularNum

Added in 1.2.0-alpha05
@RequiresSchemaVersion(major = 1, minor = 400)
java-static fun tabularNum(): LayoutElementBuilders.FontSetting

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-alpha05
@RequiresSchemaVersion(major = 1, minor = 400)
java-static fun weight(value: @IntRange(from = 1, to = 1000) Int): LayoutElementBuilders.FontSetting

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
value: @IntRange(from = 1, to = 1000) Int

weight, usually in 1..1000, but actual range can be smaller, depending on the font used

width

Added in 1.2.0-alpha05
@RequiresSchemaVersion(major = 1, minor = 400)
java-static fun width(value: @FloatRange(from = 0) Float): LayoutElementBuilders.FontSetting

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

Parameters
value: @FloatRange(from = 0) Float

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