public interface

LayoutElementProto.FontStyleOrBuilder

 androidx.wear.protolayout.proto.LayoutElementProto.FontStyleOrBuilder

Subclasses:

LayoutElementProto.FontStyle, LayoutElementProto.FontStyle.Builder

Summary

Methods
public ColorProto.ColorPropgetColor()

 The text color.

public TypesProto.BoolPropgetItalic()

 Whether the text should be rendered in a italic typeface.

public DimensionProto.EmPropgetLetterSpacing()

 The text letter-spacing.

public java.lang.StringgetPreferredFontFamilies(int index)

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

public com.google.protobuf.ByteStringgetPreferredFontFamiliesBytes(int index)

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

public intgetPreferredFontFamiliesCount()

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

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

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

public LayoutElementProto.FontSettinggetSettings(int index)

 The collection of font settings to be applied.

public intgetSettingsCount()

 The collection of font settings to be applied.

public java.util.List<LayoutElementProto.FontSetting>getSettingsList()

 The collection of font settings to be applied.

public DimensionProto.SpPropgetSize(int index)

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

public intgetSizeCount()

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

public java.util.List<DimensionProto.SpProp>getSizeList()

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

public TypesProto.BoolPropgetUnderline()

 Whether the text should be rendered with an underline.

public LayoutElementProto.FontVariantPropgetVariant()

 The variant of a font.

public LayoutElementProto.FontWeightPropgetWeight()

 The weight of the font.

public booleanhasColor()

 The text color.

public booleanhasItalic()

 Whether the text should be rendered in a italic typeface.

public booleanhasLetterSpacing()

 The text letter-spacing.

public booleanhasUnderline()

 Whether the text should be rendered with an underline.

public booleanhasVariant()

 The variant of a font.

public booleanhasWeight()

 The weight of the font.

Methods

public java.util.List<DimensionProto.SpProp> getSizeList()

 The available sizes of the font, in scaled pixels (sp). If not specified,
 defaults to the size of the system's "body" font.

 If more than one size is specified and this FontStyle is applied to a Text
 element with static text, the text size will be automatically picked from
 the provided sizes to try to perfectly fit within its parent bounds. In
 other words, the largest size from the specified preset sizes that can fit
 the most text within the parent bounds will be used.

 The specified sizes don't have to be sorted. The maximum number of sizes
 used is limited to 10.

 Note that, if multiple sizes are set, the parent of the Text element this
 corresponds to shouldn't have its width and height set to wrapped, as it
 can lead to unexpected results.

 If this FontStyle is set to any other element besides Text, or that Text
 element has dynamic field, only the last added size will be use.

 Any previously added values with this method or #setSize will be cleared.

 While this field is accessible from 1.0 as singular, it only accepts
 multiple values since version 1.3 and renderers supporting version 1.3 will
 use the multiple values to automatically scale text. Renderers who don't
 support this version will use the first size among multiple values.
 
repeated .androidx.wear.protolayout.proto.SpProp size = 1;

public DimensionProto.SpProp getSize(int index)

 The available sizes of the font, in scaled pixels (sp). If not specified,
 defaults to the size of the system's "body" font.

 If more than one size is specified and this FontStyle is applied to a Text
 element with static text, the text size will be automatically picked from
 the provided sizes to try to perfectly fit within its parent bounds. In
 other words, the largest size from the specified preset sizes that can fit
 the most text within the parent bounds will be used.

 The specified sizes don't have to be sorted. The maximum number of sizes
 used is limited to 10.

 Note that, if multiple sizes are set, the parent of the Text element this
 corresponds to shouldn't have its width and height set to wrapped, as it
 can lead to unexpected results.

 If this FontStyle is set to any other element besides Text, or that Text
 element has dynamic field, only the last added size will be use.

 Any previously added values with this method or #setSize will be cleared.

 While this field is accessible from 1.0 as singular, it only accepts
 multiple values since version 1.3 and renderers supporting version 1.3 will
 use the multiple values to automatically scale text. Renderers who don't
 support this version will use the first size among multiple values.
 
repeated .androidx.wear.protolayout.proto.SpProp size = 1;

public int getSizeCount()

 The available sizes of the font, in scaled pixels (sp). If not specified,
 defaults to the size of the system's "body" font.

 If more than one size is specified and this FontStyle is applied to a Text
 element with static text, the text size will be automatically picked from
 the provided sizes to try to perfectly fit within its parent bounds. In
 other words, the largest size from the specified preset sizes that can fit
 the most text within the parent bounds will be used.

 The specified sizes don't have to be sorted. The maximum number of sizes
 used is limited to 10.

 Note that, if multiple sizes are set, the parent of the Text element this
 corresponds to shouldn't have its width and height set to wrapped, as it
 can lead to unexpected results.

 If this FontStyle is set to any other element besides Text, or that Text
 element has dynamic field, only the last added size will be use.

 Any previously added values with this method or #setSize will be cleared.

 While this field is accessible from 1.0 as singular, it only accepts
 multiple values since version 1.3 and renderers supporting version 1.3 will
 use the multiple values to automatically scale text. Renderers who don't
 support this version will use the first size among multiple values.
 
repeated .androidx.wear.protolayout.proto.SpProp size = 1;

public boolean hasItalic()

 Whether the text should be rendered in a italic typeface. If not specified,
 defaults to "false".
 
.androidx.wear.protolayout.proto.BoolProp italic = 2;

Returns:

Whether the italic field is set.

public TypesProto.BoolProp getItalic()

 Whether the text should be rendered in a italic typeface. If not specified,
 defaults to "false".
 
.androidx.wear.protolayout.proto.BoolProp italic = 2;

Returns:

The italic.

public boolean hasUnderline()

 Whether the text should be rendered with an underline. If not specified,
 defaults to "false".
 
.androidx.wear.protolayout.proto.BoolProp underline = 3;

Returns:

Whether the underline field is set.

public TypesProto.BoolProp getUnderline()

 Whether the text should be rendered with an underline. If not specified,
 defaults to "false".
 
.androidx.wear.protolayout.proto.BoolProp underline = 3;

Returns:

The underline.

public boolean hasColor()

 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).
 
.androidx.wear.protolayout.proto.ColorProp color = 4;

Returns:

Whether the color field is set.

public ColorProto.ColorProp getColor()

 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).
 
.androidx.wear.protolayout.proto.ColorProp color = 4;

Returns:

The color.

public boolean hasWeight()

 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".
 
.androidx.wear.protolayout.proto.FontWeightProp weight = 5;

Returns:

Whether the weight field is set.

 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".
 
.androidx.wear.protolayout.proto.FontWeightProp weight = 5;

Returns:

The weight.

public boolean hasLetterSpacing()

 The text letter-spacing. Positive numbers increase the space between
 letters while negative numbers tighten the space. If not specified,
 defaults to 0.
 
.androidx.wear.protolayout.proto.EmProp letter_spacing = 6;

Returns:

Whether the letterSpacing field is set.

public DimensionProto.EmProp getLetterSpacing()

 The text letter-spacing. Positive numbers increase the space between
 letters while negative numbers tighten the space. If not specified,
 defaults to 0.
 
.androidx.wear.protolayout.proto.EmProp letter_spacing = 6;

Returns:

The letterSpacing.

public boolean hasVariant()

 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".
 
.androidx.wear.protolayout.proto.FontVariantProp variant = 7;

Returns:

Whether the variant field is set.

 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".
 
.androidx.wear.protolayout.proto.FontVariantProp variant = 7;

Returns:

The variant.

public java.util.List<LayoutElementProto.FontSetting> getSettingsList()

 The collection of font settings to be applied.

 Supported settings depend on the font used and renderer version.
 <setter>If this is used with the variable fonts on renderers
 supporting 1.4, weight and width setting will always be available.</setter>
 
repeated .androidx.wear.protolayout.proto.FontSetting settings = 8;

public LayoutElementProto.FontSetting getSettings(int index)

 The collection of font settings to be applied.

 Supported settings depend on the font used and renderer version.
 <setter>If this is used with the variable fonts on renderers
 supporting 1.4, weight and width setting will always be available.</setter>
 
repeated .androidx.wear.protolayout.proto.FontSetting settings = 8;

public int getSettingsCount()

 The collection of font settings to be applied.

 Supported settings depend on the font used and renderer version.
 <setter>If this is used with the variable fonts on renderers
 supporting 1.4, weight and width setting will always be available.</setter>
 
repeated .androidx.wear.protolayout.proto.FontSetting settings = 8;

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

 The prioritized collection of font family names describing which font
 should be used for this FontStyle and its fallback values if not available.
 For example, preferring default system variable font with default non
 variable system font as a fallback. <setter>If not set, defaults to system
 font.</setter>
 
repeated string preferred_font_families = 9;

Returns:

A list containing the preferredFontFamilies.

public int getPreferredFontFamiliesCount()

 The prioritized collection of font family names describing which font
 should be used for this FontStyle and its fallback values if not available.
 For example, preferring default system variable font with default non
 variable system font as a fallback. <setter>If not set, defaults to system
 font.</setter>
 
repeated string preferred_font_families = 9;

Returns:

The count of preferredFontFamilies.

public java.lang.String getPreferredFontFamilies(int index)

 The prioritized collection of font family names describing which font
 should be used for this FontStyle and its fallback values if not available.
 For example, preferring default system variable font with default non
 variable system font as a fallback. <setter>If not set, defaults to system
 font.</setter>
 
repeated string preferred_font_families = 9;

Parameters:

index: The index of the element to return.

Returns:

The preferredFontFamilies at the given index.

public com.google.protobuf.ByteString getPreferredFontFamiliesBytes(int index)

 The prioritized collection of font family names describing which font
 should be used for this FontStyle and its fallback values if not available.
 For example, preferring default system variable font with default non
 variable system font as a fallback. <setter>If not set, defaults to system
 font.</setter>
 
repeated string preferred_font_families = 9;

Parameters:

index: The index of the element to return.

Returns:

The preferredFontFamilies at the given index.