Typography


public final class Typography


The Glimmer type scale includes a range of contrasting styles that support the needs of your product and its content.

Summary

Public constructors

Typography(
    FontFamily defaultFontFamily,
    @NonNull TextStyle titleLarge,
    @NonNull TextStyle titleMedium,
    @NonNull TextStyle titleSmall,
    @NonNull TextStyle bodyLarge,
    @NonNull TextStyle bodyMedium,
    @NonNull TextStyle bodySmall
)

Creates a Glimmer type scale.

Public methods

final @NonNull Typography
copy(
    @NonNull TextStyle titleLarge,
    @NonNull TextStyle titleMedium,
    @NonNull TextStyle titleSmall,
    @NonNull TextStyle bodyLarge,
    @NonNull TextStyle bodyMedium,
    @NonNull TextStyle bodySmall
)

Returns a copy of this Typography, optionally overriding some of the values.

boolean
equals(Object other)
final @NonNull TextStyle

bodyLarge is the largest body, and is typically used for long-form writing as it works well for small text sizes.

final @NonNull TextStyle

bodyMedium is the second largest body, and is typically used for long-form writing as it works well for small text sizes.

final @NonNull TextStyle

bodySmall is the smallest body, and is typically used for long-form writing as it works well for small text sizes.

final @NonNull TextStyle

titleLarge is the largest title, and is typically reserved for emphasized text that is shorter in length.

final @NonNull TextStyle

titleMedium is the second largest title, and is typically reserved for emphasized text that is shorter in length.

final @NonNull TextStyle

titleSmall is the smallest title, and is typically reserved for emphasized text that is shorter in length.

int
@NonNull String

Public constructors

Typography

Added in 1.0.0-alpha01
public Typography(
    FontFamily defaultFontFamily,
    @NonNull TextStyle titleLarge,
    @NonNull TextStyle titleMedium,
    @NonNull TextStyle titleSmall,
    @NonNull TextStyle bodyLarge,
    @NonNull TextStyle bodyMedium,
    @NonNull TextStyle bodySmall
)

Creates a Glimmer type scale.

Parameters
FontFamily 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.

@NonNull TextStyle titleLarge

titleLarge is the largest title, and is typically reserved for emphasized text that is shorter in length.

@NonNull TextStyle titleMedium

titleMedium is the second largest title, and is typically reserved for emphasized text that is shorter in length.

@NonNull TextStyle titleSmall

titleSmall is the smallest title, and is typically reserved for emphasized text that is shorter in length.

@NonNull TextStyle bodyLarge

bodyLarge is the largest body, and is typically used for long-form writing as it works well for small text sizes.

@NonNull TextStyle bodyMedium

bodyMedium is the second largest body, and is typically used for long-form writing as it works well for small text sizes.

@NonNull TextStyle bodySmall

bodySmall is the smallest body, and is typically used for long-form writing as it works well for small text sizes.

Public methods

copy

Added in 1.0.0-alpha01
public final @NonNull Typography copy(
    @NonNull TextStyle titleLarge,
    @NonNull TextStyle titleMedium,
    @NonNull TextStyle titleSmall,
    @NonNull TextStyle bodyLarge,
    @NonNull TextStyle bodyMedium,
    @NonNull TextStyle bodySmall
)

Returns a copy of this Typography, optionally overriding some of the values.

equals

public boolean equals(Object other)

getBodyLarge

Added in 1.0.0-alpha01
public final @NonNull TextStyle getBodyLarge()

bodyLarge is the largest body, and is typically used for long-form writing as it works well for small text sizes.

getBodyMedium

Added in 1.0.0-alpha01
public final @NonNull TextStyle getBodyMedium()

bodyMedium is the second largest body, and is typically used for long-form writing as it works well for small text sizes.

getBodySmall

Added in 1.0.0-alpha01
public final @NonNull TextStyle getBodySmall()

bodySmall is the smallest body, and is typically used for long-form writing as it works well for small text sizes.

getTitleLarge

Added in 1.0.0-alpha01
public final @NonNull TextStyle getTitleLarge()

titleLarge is the largest title, and is typically reserved for emphasized text that is shorter in length.

getTitleMedium

Added in 1.0.0-alpha01
public final @NonNull TextStyle getTitleMedium()

titleMedium is the second largest title, and is typically reserved for emphasized text that is shorter in length.

getTitleSmall

Added in 1.0.0-alpha01
public final @NonNull TextStyle getTitleSmall()

titleSmall is the smallest title, and is typically reserved for emphasized text that is shorter in length.

hashCode

public int hashCode()

toString

public @NonNull String toString()