Typography
public class Typography
internal constructor(
public val arcLarge: CurvedTextStyle,
public val arcMedium: CurvedTextStyle,
public val arcSmall: CurvedTextStyle,
public val displayLarge: TextStyle,
public val displayMedium: TextStyle,
public val displaySmall: TextStyle,
public val titleLarge: TextStyle,
public val titleMedium: TextStyle,
public val titleSmall: TextStyle,
public val labelLarge: TextStyle,
public val labelMedium: TextStyle,
public val labelSmall: TextStyle,
public val bodyLarge: TextStyle,
public val bodyMedium: TextStyle,
public val bodySmall: TextStyle,
public val bodyExtraSmall: TextStyle,
public val numeralExtraLarge: TextStyle,
public val numeralLarge: TextStyle,
public val numeralMedium: TextStyle,
public val numeralSmall: TextStyle,
public val numeralExtraSmall: TextStyle,
)
Class holding typography definitions as defined by the Wear Material typography specification.
The text styles in this typography are scaled according to the user's preferred font size in the system settings. Larger font sizes can be fixed if necessary in order to avoid pressure on screen space, because they are already sufficiently accessible.
Display styles are utilized for large, short strings of text used to display highly glanceable hero information, significant metrics, confidence or expressive brand moments.
Title styles are hierarchical text used as a mechanism for way-finding, like a page, section title, or sub-section title (in the case of Title Small).
Label styles are used for component level text that describes an action that would happen if interacted with. The most common and widely used application for label is for text nested within a button.
Body styles are reserved for content text like paragraphs of body copy, text used in complex data visualisation, time stamps and metadata.
Numeral text styles are used for numerical digits, usually limited to a few characters. These can take on more expressive properties at the larger display sizes. They give flexibility to expand width axis with minimal localization and font scaling concerns.
Arc text styles are used for curved text making up the signposting on the UI such as time text and curved labels, a tailored font axis that specifically optimizes type along a curve.
Secondary Constructors
public constructor(
defaultFontFamily: FontFamily = FontFamily.Default,
arcLarge: CurvedTextStyle = TypographyTokens.ArcLarge,
arcMedium: CurvedTextStyle = TypographyTokens.ArcMedium,
arcSmall: CurvedTextStyle = TypographyTokens.ArcSmall,
displayLarge: TextStyle = TypographyTokens.DisplayLarge,
displayMedium: TextStyle = TypographyTokens.DisplayMedium,
displaySmall: TextStyle = TypographyTokens.DisplaySmall,
titleLarge: TextStyle = TypographyTokens.TitleLarge,
titleMedium: TextStyle = TypographyTokens.TitleMedium,
titleSmall: TextStyle = TypographyTokens.TitleSmall,
labelLarge: TextStyle = TypographyTokens.LabelLarge,
labelMedium: TextStyle = TypographyTokens.LabelMedium,
labelSmall: TextStyle = TypographyTokens.LabelSmall,
bodyLarge: TextStyle = TypographyTokens.BodyLarge,
bodyMedium: TextStyle = TypographyTokens.BodyMedium,
bodySmall: TextStyle = TypographyTokens.BodySmall,
bodyExtraSmall: TextStyle = TypographyTokens.BodyExtraSmall,
numeralExtraLarge: TextStyle = TypographyTokens.NumeralExtraLarge,
numeralLarge: TextStyle = TypographyTokens.NumeralLarge,
numeralMedium: TextStyle = TypographyTokens.NumeralMedium,
numeralSmall: TextStyle = TypographyTokens.NumeralSmall,
numeralExtraSmall: TextStyle = TypographyTokens.NumeralExtraSmall,
) : this(
arcLarge = arcLarge.withDefaultFontFamily(defaultFontFamily),
arcMedium = arcMedium.withDefaultFontFamily(defaultFontFamily),
arcSmall = arcSmall.withDefaultFontFamily(defaultFontFamily),
displayLarge = displayLarge.withDefaultFontFamily(defaultFontFamily),
displayMedium = displayMedium.withDefaultFontFamily(defaultFontFamily),
displaySmall = displaySmall.withDefaultFontFamily(defaultFontFamily),
titleLarge = titleLarge.withDefaultFontFamily(defaultFontFamily),
titleMedium = titleMedium.withDefaultFontFamily(defaultFontFamily),
titleSmall = titleSmall.withDefaultFontFamily(defaultFontFamily),
labelLarge = labelLarge.withDefaultFontFamily(defaultFontFamily),
labelMedium = labelMedium.withDefaultFontFamily(defaultFontFamily),
labelSmall = labelSmall.withDefaultFontFamily(defaultFontFamily),
bodyLarge = bodyLarge.withDefaultFontFamily(defaultFontFamily),
bodyMedium = bodyMedium.withDefaultFontFamily(defaultFontFamily),
bodySmall = bodySmall.withDefaultFontFamily(defaultFontFamily),
bodyExtraSmall = bodyExtraSmall.withDefaultFontFamily(defaultFontFamily),
numeralExtraLarge = numeralExtraLarge.withDefaultFontFamily(defaultFontFamily),
numeralLarge = numeralLarge.withDefaultFontFamily(defaultFontFamily),
numeralMedium = numeralMedium.withDefaultFontFamily(defaultFontFamily),
numeralSmall = numeralSmall.withDefaultFontFamily(defaultFontFamily),
numeralExtraSmall = numeralExtraSmall.withDefaultFontFamily(defaultFontFamily),
)
Functions
public fun copy(
arcLarge: CurvedTextStyle = this.arcLarge,
arcMedium: CurvedTextStyle = this.arcMedium,
arcSmall: CurvedTextStyle = this.arcSmall,
displayLarge: TextStyle = this.displayLarge,
displayMedium: TextStyle = this.displayMedium,
displaySmall: TextStyle = this.displaySmall,
titleLarge: TextStyle = this.titleLarge,
titleMedium: TextStyle = this.titleMedium,
titleSmall: TextStyle = this.titleSmall,
labelLarge: TextStyle = this.labelLarge,
labelMedium: TextStyle = this.labelMedium,
labelSmall: TextStyle = this.labelSmall,
bodyLarge: TextStyle = this.bodyLarge,
bodyMedium: TextStyle = this.bodyMedium,
bodySmall: TextStyle = this.bodySmall,
bodyExtraSmall: TextStyle = this.bodyExtraSmall,
numeralExtraLarge: TextStyle = this.numeralExtraLarge,
numeralLarge: TextStyle = this.numeralLarge,
numeralMedium: TextStyle = this.numeralMedium,
numeralSmall: TextStyle = this.numeralSmall,
numeralExtraSmall: TextStyle = this.numeralExtraSmall,
): Typography
Returns a copy of this Typography, optionally overriding some of the values.