Android
public class Typography
private constructor(
public val titleLarge: TextStyle,
public val titleMedium: TextStyle,
public val titleSmall: TextStyle,
public val bodyLarge: TextStyle,
public val bodyMedium: TextStyle,
public val bodySmall: TextStyle,
public val caption: TextStyle,
)
The Jetpack Compose Glimmer type scale includes a range of contrasting styles that support the needs of your product and its content.
Secondary Constructors
public constructor(
defaultFontFamily: FontFamily? = null,
titleLarge: TextStyle = TypographyDefaults.TitleLarge,
titleMedium: TextStyle = TypographyDefaults.TitleMedium,
titleSmall: TextStyle = TypographyDefaults.TitleSmall,
bodyLarge: TextStyle = TypographyDefaults.BodyLarge,
bodyMedium: TextStyle = TypographyDefaults.BodyMedium,
bodySmall: TextStyle = TypographyDefaults.BodySmall,
caption: TextStyle = TypographyDefaults.Caption,
) : this(
titleLarge = titleLarge.withDefaultFontFamily(defaultFontFamily),
titleMedium = titleMedium.withDefaultFontFamily(defaultFontFamily),
titleSmall = titleSmall.withDefaultFontFamily(defaultFontFamily),
bodyLarge = bodyLarge.withDefaultFontFamily(defaultFontFamily),
bodyMedium = bodyMedium.withDefaultFontFamily(defaultFontFamily),
bodySmall = bodySmall.withDefaultFontFamily(defaultFontFamily),
caption = caption.withDefaultFontFamily(defaultFontFamily),
)
Creates a Jetpack Compose Glimmer type scale.
Parameters
| defaultFontFamily | the default FontFamily to be used for TextStyles provided in this constructor. This default will be used if the FontFamily on the TextStyle is null. |
| titleLarge | titleLarge is the largest title, and is typically reserved for emphasized text that is shorter in length. |
| titleMedium | titleMedium is the second largest title, and is typically reserved for emphasized text that is shorter in length. |
| titleSmall | titleSmall is the smallest title, and is typically reserved for emphasized text that is shorter in length. |
| bodyLarge | bodyLarge is the largest body, and is typically used for long-form writing as it works well for small text sizes. |
| bodyMedium | bodyMedium is the second largest body, and is typically used for long-form writing as it works well for small text sizes. |
| bodySmall | bodySmall is the smallest body, and is typically used for long-form writing as it works well for small text sizes. |
| caption | caption is the smallest text style, and should be used sparingly for use-cases where it is not essential to the user experience. |
Functions
copy
public fun copy(
titleLarge: TextStyle = this.titleLarge,
titleMedium: TextStyle = this.titleMedium,
titleSmall: TextStyle = this.titleSmall,
bodyLarge: TextStyle = this.bodyLarge,
bodyMedium: TextStyle = this.bodyMedium,
bodySmall: TextStyle = this.bodySmall,
caption: TextStyle = this.caption,
): Typography
Returns a copy of this Typography, optionally overriding some of the values.