LayoutElementBuilders.FontStyle

public final class LayoutElementBuilders.FontStyle


The styling of a font (e.g. font size, and metrics).

Summary

Public methods

static @NonNull LayoutElementBuilders.FontStyle.Builder

Returns a new Builder.

@Nullable ColorBuilders.ColorProp

Gets the text color.

@Nullable TypeBuilders.BoolProp

Gets whether the text should be rendered in a italic typeface.

@Nullable DimensionBuilders.EmProp

Gets the text letter-spacing.

@Nullable DimensionBuilders.SpProp

Gets the size of the font, in scaled pixels (sp).

@Nullable TypeBuilders.BoolProp

Gets whether the text should be rendered with an underline.

@TilesExperimental @Nullable LayoutElementBuilders.FontVariantProp

Gets the variant of a font.

@Nullable LayoutElementBuilders.FontWeightProp

Gets the weight of the font.

Public methods

builder

@NonNull
public static LayoutElementBuilders.FontStyle.Builder builder()

Returns a new Builder.

getColor

@Nullable
@NonNull
public ColorBuilders.ColorProp getColor()

Gets the text color. If not defined, defaults to white. Intended for testing purposes only.

getItalic

@Nullable
@NonNull
public TypeBuilders.BoolProp getItalic()

Gets whether the text should be rendered in a italic typeface. If not specified, defaults to "false". Intended for testing purposes only.

getLetterSpacing

@Nullable
@NonNull
public DimensionBuilders.EmProp getLetterSpacing()

Gets the text letter-spacing. Positive numbers increase the space between letters while negative numbers tighten the space. If not specified, defaults to 0. Intended for testing purposes only.

getSize

@Nullable
@NonNull
public DimensionBuilders.SpProp getSize()

Gets the size of the font, in scaled pixels (sp). If not specified, defaults to the size of the system's "body" font. Intended for testing purposes only.

getUnderline

@Nullable
@NonNull
public TypeBuilders.BoolProp getUnderline()

Gets whether the text should be rendered with an underline. If not specified, defaults to "false". Intended for testing purposes only.

getVariant

@TilesExperimental
@Nullable
@NonNull
public @TilesExperimental LayoutElementBuilders.FontVariantProp getVariant()

Gets 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". Intended for testing purposes only.

getWeight

@Nullable
@NonNull
public LayoutElementBuilders.FontWeightProp getWeight()

Gets 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". Intended for testing purposes only.