public final class

LayoutElementBuilders.FontStyle

extends java.lang.Object

 java.lang.Object

↳androidx.wear.protolayout.LayoutElementBuilders.FontStyle

Overview

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

Summary

Fields
public static final java.lang.StringROBOTO_FLEX_FONT

Font family name that uses Roboto Flex variable font.

public static final java.lang.StringROBOTO_FONT

Font family name that uses Roboto font.

Methods
public static LayoutElementBuilders.FontStylefromProto(LayoutElementProto.FontStyle proto, Fingerprint fingerprint)

Creates a new wrapper instance from the proto.

public ColorBuilders.ColorPropgetColor()

Gets the text color.

public FingerprintgetFingerprint()

Get the fingerprint for this object, or null if unknown.

public TypeBuilders.BoolPropgetItalic()

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

public DimensionBuilders.EmPropgetLetterSpacing()

Gets the text letter-spacing.

public java.util.List<java.lang.String>getPreferredFontFamilies()

Gets the prioritized collection of font family names describing which font should be used for this LayoutElementBuilders.FontStyle and its fallback values if not available.

public java.util.List<LayoutElementBuilders.FontSetting>getSettings()

Gets the collection of font settings to be applied.

public DimensionBuilders.SpPropgetSize()

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

public java.util.List<DimensionBuilders.SpProp>getSizes()

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

public TypeBuilders.BoolPropgetUnderline()

Gets whether the text should be rendered with an underline.

public LayoutElementBuilders.FontVariantPropgetVariant()

Gets the variant of a font.

public LayoutElementBuilders.FontWeightPropgetWeight()

Gets the weight of the font.

public LayoutElementProto.FontStyletoProto()

Returns the internal proto instance.

public java.lang.StringtoString()

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Fields

public static final java.lang.String ROBOTO_FONT

Font family name that uses Roboto font. Supported in renderers supporting 1.4.

public static final java.lang.String ROBOTO_FLEX_FONT

Font family name that uses Roboto Flex variable font. Supported in renderers supporting 1.4.

Methods

public ColorBuilders.ColorProp getColor()

Gets the text color. If not defined, defaults to white.

While this field is statically accessible from 1.0, it's only bindable since version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).

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

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.

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

public java.util.List<LayoutElementBuilders.FontSetting> getSettings()

Gets the collection of font settings to be applied.

Supported settings depend on the font used and renderer version.

public java.util.List<java.lang.String> getPreferredFontFamilies()

Gets the prioritized collection of font family names describing which font should be used for this LayoutElementBuilders.FontStyle and its fallback values if not available. For example, preferring default system variable font with default non variable system font as a fallback.

public DimensionBuilders.SpProp getSize()

Gets the size of the font, in scaled pixels (sp). If more than one size was originally added, it will return the last one.

public java.util.List<DimensionBuilders.SpProp> getSizes()

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

public TypeBuilders.BoolProp getItalic()

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

public TypeBuilders.BoolProp getUnderline()

Gets whether the text should be rendered with an underline. If not specified, defaults to "false".

public Fingerprint getFingerprint()

Get the fingerprint for this object, or null if unknown.

Creates a new wrapper instance from the proto.

Returns the internal proto instance.

public java.lang.String toString()