# androidx.xr.glimmer.googlefonts

## Objects

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/googlefonts/GoogleSansFlexTypographyDefaults` | Default variable font configurations for using Google Sans Flex in Jetpack Compose Glimmer |

## Top-level functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography` | `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/googlefonts/package-summary#createGoogleSansFlexTypography(androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.font.FontVariation.Settings,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.font.FontVariation.Settings,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.font.FontVariation.Settings,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.font.FontVariation.Settings,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.font.FontVariation.Settings,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.font.FontVariation.Settings,androidx.compose.ui.text.TextStyle,androidx.compose.ui.text.font.FontVariation.Settings)( titleLarge: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, titleLargeVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings, titleMedium: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, titleMediumVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings, titleSmall: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, titleSmallVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings, bodyLarge: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, bodyLargeVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings, bodyMedium: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, bodyMediumVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings, bodySmall: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, bodySmallVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings, caption: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle, captionVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings )` Returns a `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography` instance configured with Google Sans Flex and customized with the recommended settings for Jetpack Compose Glimmer. |

## Top-level functions

### createGoogleSansFlexTypography

Artifact: [androidx.xr.glimmer:glimmer-google-fonts](https://developer.android.com/jetpack/androidx/releases/xr-glimmer) [View Source](https://cs.android.com/search?q=file:androidx/xr/glimmer/googlefonts/GoogleSansFlexTypography.kt+function:createGoogleSansFlexTypography) Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/xr-glimmer#1.0.0-alpha22)

```
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 `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/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 `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings` (e.g. `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation#weight(kotlin.Int)`) rather than the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` properties.

```kotlin
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: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle = GoogleSansFlexTypographyDefaults.TitleLarge` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#titleLarge()` |
| `titleLargeVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings = GoogleSansFlexTypographyDefaults.TitleLargeVariationSettings` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#titleLarge()`. |
| `titleMedium: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle = GoogleSansFlexTypographyDefaults.TitleMedium` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#titleMedium()`. |
| `titleMediumVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings = GoogleSansFlexTypographyDefaults.TitleMediumVariationSettings` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#titleMedium()`. |
| `titleSmall: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle = GoogleSansFlexTypographyDefaults.TitleSmall` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#titleSmall()`. |
| `titleSmallVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings = GoogleSansFlexTypographyDefaults.TitleSmallVariationSettings` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#titleSmall()`. |
| `bodyLarge: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle = GoogleSansFlexTypographyDefaults.BodyLarge` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#bodyLarge()`. |
| `bodyLargeVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings = GoogleSansFlexTypographyDefaults.BodyLargeVariationSettings` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#bodyLarge()`. |
| `bodyMedium: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle = GoogleSansFlexTypographyDefaults.BodyMedium` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#bodyMedium()`. |
| `bodyMediumVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings = GoogleSansFlexTypographyDefaults.BodyMediumVariationSettings` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#bodyMedium()`. |
| `bodySmall: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle = GoogleSansFlexTypographyDefaults.BodySmall` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#bodySmall()`. |
| `bodySmallVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings = GoogleSansFlexTypographyDefaults.BodySmallVariationSettings` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#bodySmall()`. |
| `caption: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle = GoogleSansFlexTypographyDefaults.Caption` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#caption()`. |
| `captionVariationSettings: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings = GoogleSansFlexTypographyDefaults.CaptionVariationSettings` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/font/FontVariation.Settings` for `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Typography#caption()`. |