{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

Typography

public final class Typography


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

Use typography to make writing legible and beautiful. Material's default type scale includes contrasting and flexible styles to support a wide range of use cases.

The type scale is a combination of thirteen styles that are supported by the type system. It contains reusable categories of text, each with an intended application and meaning.

To learn more about typography, see Material Design typography.

Summary

Public constructors

Typography(
    @NonNull TextStyle displayLarge,
    @NonNull TextStyle displayMedium,
    @NonNull TextStyle displaySmall,
    @NonNull TextStyle headlineLarge,
    @NonNull TextStyle headlineMedium,
    @NonNull TextStyle headlineSmall,
    @NonNull TextStyle titleLarge,
    @NonNull TextStyle titleMedium,
    @NonNull TextStyle titleSmall,
    @NonNull TextStyle bodyLarge,
    @NonNull TextStyle bodyMedium,
    @NonNull TextStyle bodySmall,
    @NonNull TextStyle labelLarge,
    @NonNull TextStyle labelMedium,
    @NonNull TextStyle labelSmall
)

Public methods

final @NonNull Typography
copy(
    @NonNull TextStyle displayLarge,
    @NonNull TextStyle displayMedium,
    @NonNull TextStyle displaySmall,
    @NonNull TextStyle headlineLarge,
    @NonNull TextStyle headlineMedium,
    @NonNull TextStyle headlineSmall,
    @NonNull TextStyle titleLarge,
    @NonNull TextStyle titleMedium,
    @NonNull TextStyle titleSmall,
    @NonNull TextStyle bodyLarge,
    @NonNull TextStyle bodyMedium,
    @NonNull TextStyle bodySmall,
    @NonNull TextStyle labelLarge,
    @NonNull TextStyle labelMedium,
    @NonNull TextStyle labelSmall
)

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

displayLarge is the largest display text.

final @NonNull TextStyle

displayMedium is the second largest display text.

final @NonNull TextStyle

displaySmall is the smallest display text.

final @NonNull TextStyle

headlineLarge is the largest headline, reserved for short, important text or numerals.

final @NonNull TextStyle

headlineMedium is the second largest headline, reserved for short, important text or numerals.

final @NonNull TextStyle

headlineSmall is the smallest headline, reserved for short, important text or numerals.

final @NonNull TextStyle

labelLarge text is a call to action used in different types of buttons (such as text, outlined and contained buttons) and in tabs, dialogs, and cards.

final @NonNull TextStyle

labelMedium is one of the smallest font sizes.

final @NonNull TextStyle

labelSmall is one of the smallest font sizes.

final @NonNull TextStyle

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

final @NonNull TextStyle

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

final @NonNull TextStyle

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

int
@NonNull String

Public constructors

Typography

public Typography(
    @NonNull TextStyle displayLarge,
    @NonNull TextStyle displayMedium,
    @NonNull TextStyle displaySmall,
    @NonNull TextStyle headlineLarge,
    @NonNull TextStyle headlineMedium,
    @NonNull TextStyle headlineSmall,
    @NonNull TextStyle titleLarge,
    @NonNull TextStyle titleMedium,
    @NonNull TextStyle titleSmall,
    @NonNull TextStyle bodyLarge,
    @NonNull TextStyle bodyMedium,
    @NonNull TextStyle bodySmall,
    @NonNull TextStyle labelLarge,
    @NonNull TextStyle labelMedium,
    @NonNull TextStyle labelSmall
)

Public methods

copy

public final @NonNull Typography copy(
    @NonNull TextStyle displayLarge,
    @NonNull TextStyle displayMedium,
    @NonNull TextStyle displaySmall,
    @NonNull TextStyle headlineLarge,
    @NonNull TextStyle headlineMedium,
    @NonNull TextStyle headlineSmall,
    @NonNull TextStyle titleLarge,
    @NonNull TextStyle titleMedium,
    @NonNull TextStyle titleSmall,
    @NonNull TextStyle bodyLarge,
    @NonNull TextStyle bodyMedium,
    @NonNull TextStyle bodySmall,
    @NonNull TextStyle labelLarge,
    @NonNull TextStyle labelMedium,
    @NonNull TextStyle labelSmall
)

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

equals

public boolean equals(Object other)

getBodyLarge

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. For longer sections of text, a serif or sans serif typeface is recommended.

getBodyMedium

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. For longer sections of text, a serif or sans serif typeface is recommended.

getBodySmall

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. For longer sections of text, a serif or sans serif typeface is recommended.

getDisplayLarge

public final @NonNull TextStyle getDisplayLarge()

displayLarge is the largest display text.

getDisplayMedium

public final @NonNull TextStyle getDisplayMedium()

displayMedium is the second largest display text.

getDisplaySmall

public final @NonNull TextStyle getDisplaySmall()

displaySmall is the smallest display text.

getHeadlineLarge

public final @NonNull TextStyle getHeadlineLarge()

headlineLarge is the largest headline, reserved for short, important text or numerals. For headlines, you can choose an expressive font, such as a display, handwritten, or script style. These unconventional font designs have details and intricacy that help attract the eye.

getHeadlineMedium

public final @NonNull TextStyle getHeadlineMedium()

headlineMedium is the second largest headline, reserved for short, important text or numerals. For headlines, you can choose an expressive font, such as a display, handwritten, or script style. These unconventional font designs have details and intricacy that help attract the eye.

getHeadlineSmall

public final @NonNull TextStyle getHeadlineSmall()

headlineSmall is the smallest headline, reserved for short, important text or numerals. For headlines, you can choose an expressive font, such as a display, handwritten, or script style. These unconventional font designs have details and intricacy that help attract the eye.

getLabelLarge

public final @NonNull TextStyle getLabelLarge()

labelLarge text is a call to action used in different types of buttons (such as text, outlined and contained buttons) and in tabs, dialogs, and cards. Button text is typically sans serif, using all caps text.

getLabelMedium

public final @NonNull TextStyle getLabelMedium()

labelMedium is one of the smallest font sizes. It is used sparingly to annotate imagery or to introduce a headline.

getLabelSmall

public final @NonNull TextStyle getLabelSmall()

labelSmall is one of the smallest font sizes. It is used sparingly to annotate imagery or to introduce a headline.

getTitleLarge

public final @NonNull TextStyle getTitleLarge()

titleLarge is the largest title, and is typically reserved for medium-emphasis text that is shorter in length. Serif or sans serif typefaces work well for subtitles.

getTitleMedium

public final @NonNull TextStyle getTitleMedium()

titleMedium is the second largest title, and is typically reserved for medium-emphasis text that is shorter in length. Serif or sans serif typefaces work well for subtitles.

getTitleSmall

public final @NonNull TextStyle getTitleSmall()

titleSmall is the smallest title, and is typically reserved for medium-emphasis text that is shorter in length. Serif or sans serif typefaces work well for subtitles.

hashCode

public int hashCode()

toString

public @NonNull String toString()