androidx.xr.glimmer.googlefonts

Objects

GoogleSansFlexTypographyDefaults

Default variable font configurations for using Google Sans Flex in Jetpack Compose Glimmer

Top-level functions summary

Typography
createGoogleSansFlexTypography(
    titleLarge: TextStyle,
    titleLargeVariationSettings: FontVariation.Settings,
    titleMedium: TextStyle,
    titleMediumVariationSettings: FontVariation.Settings,
    titleSmall: TextStyle,
    titleSmallVariationSettings: FontVariation.Settings,
    bodyLarge: TextStyle,
    bodyLargeVariationSettings: FontVariation.Settings,
    bodyMedium: TextStyle,
    bodyMediumVariationSettings: FontVariation.Settings,
    bodySmall: TextStyle,
    bodySmallVariationSettings: FontVariation.Settings,
    caption: TextStyle,
    captionVariationSettings: FontVariation.Settings
)

Returns a Typography instance configured with Google Sans Flex and customized with the recommended settings for Jetpack Compose Glimmer.

Top-level functions

createGoogleSansFlexTypography

fun createGoogleSansFlexTypography(
    titleLarge: TextStyle = GoogleSansFlexTypographyDefaults.TitleLarge,
    titleLargeVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.TitleLargeVariationSettings,
    titleMedium: TextStyle = GoogleSansFlexTypographyDefaults.TitleMedium,
    titleMediumVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.TitleMediumVariationSettings,
    titleSmall: TextStyle = GoogleSansFlexTypographyDefaults.TitleSmall,
    titleSmallVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.TitleSmallVariationSettings,
    bodyLarge: TextStyle = GoogleSansFlexTypographyDefaults.BodyLarge,
    bodyLargeVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.BodyLargeVariationSettings,
    bodyMedium: TextStyle = GoogleSansFlexTypographyDefaults.BodyMedium,
    bodyMediumVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.BodyMediumVariationSettings,
    bodySmall: TextStyle = GoogleSansFlexTypographyDefaults.BodySmall,
    bodySmallVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.BodySmallVariationSettings,
    caption: TextStyle = GoogleSansFlexTypographyDefaults.Caption,
    captionVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.CaptionVariationSettings
): Typography

Returns a Typography instance configured with Google Sans Flex and customized with the recommended settings for Jetpack Compose Glimmer.

Note: Google Sans Flex is a variable font. It is recommended to configure attributes such as weight, slant, and grade by using FontVariation.Settings (e.g. FontVariation.weight) rather than the TextStyle properties.

import androidx.xr.glimmer.GlimmerTheme
import androidx.xr.glimmer.Text
import androidx.xr.glimmer.googlefonts.createGoogleSansFlexTypography

val typography = createGoogleSansFlexTypography()
GlimmerTheme(typography = typography) {
    Text("Hello World", style = GlimmerTheme.typography.titleLarge)
}
Parameters
titleLarge: TextStyle = GoogleSansFlexTypographyDefaults.TitleLarge

the TextStyle for Typography.titleLarge

titleLargeVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.TitleLargeVariationSettings

the FontVariation.Settings for Typography.titleLarge.

titleMedium: TextStyle = GoogleSansFlexTypographyDefaults.TitleMedium

the TextStyle for Typography.titleMedium.

titleMediumVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.TitleMediumVariationSettings

the FontVariation.Settings for Typography.titleMedium.

titleSmall: TextStyle = GoogleSansFlexTypographyDefaults.TitleSmall

the TextStyle for Typography.titleSmall.

titleSmallVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.TitleSmallVariationSettings

the FontVariation.Settings for Typography.titleSmall.

bodyLarge: TextStyle = GoogleSansFlexTypographyDefaults.BodyLarge

the TextStyle for Typography.bodyLarge.

bodyLargeVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.BodyLargeVariationSettings

the FontVariation.Settings for Typography.bodyLarge.

bodyMedium: TextStyle = GoogleSansFlexTypographyDefaults.BodyMedium

the TextStyle for Typography.bodyMedium.

bodyMediumVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.BodyMediumVariationSettings

the FontVariation.Settings for Typography.bodyMedium.

bodySmall: TextStyle = GoogleSansFlexTypographyDefaults.BodySmall

the TextStyle for Typography.bodySmall.

bodySmallVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.BodySmallVariationSettings

the FontVariation.Settings for Typography.bodySmall.

caption: TextStyle = GoogleSansFlexTypographyDefaults.Caption

the TextStyle for Typography.caption.

captionVariationSettings: FontVariation.Settings = GoogleSansFlexTypographyDefaults.CaptionVariationSettings

the FontVariation.Settings for Typography.caption.