skip
skip copied to clipboard
docs: Document how to manage Material3 typography
To edit Android fonts, especially navigation titles and tab bar titles, you have to edit your Main.kt and edit typography settings there. This should be in the docs somewhere.
@Composable
internal fun PresentationRootView(context: ComposeContext) {
val colorScheme = if (isSystemInDarkTheme()) ColorScheme.dark else ColorScheme.light
val typography = androidx.compose.material3.Typography(
// nav title (large)
headlineLarge = androidx.compose.ui.text.TextStyle(
fontFamily = androidx.compose.ui.text.font.FontFamily.Monospace,
fontWeight = androidx.compose.ui.text.font.FontWeight.Bold
),
// nav title (smaller)
headlineMedium = androidx.compose.ui.text.TextStyle(
fontFamily = androidx.compose.ui.text.font.FontFamily.Monospace,
fontWeight = androidx.compose.ui.text.font.FontWeight.Bold
),
// tab title
labelMedium = androidx.compose.ui.text.TextStyle(
fontFamily = androidx.compose.ui.text.font.FontFamily.Monospace,
fontWeight = androidx.compose.ui.text.font.FontWeight.Bold
)
)
androidx.compose.material3.MaterialTheme(typography = typography) {
PresentationRoot(defaultColorScheme = colorScheme, context = context) { ctx ->
val contentContext = ctx.content()
Box(modifier = ctx.modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
RootView().Compose(context = contentContext)
}
}
}
}