Jetpack Compose Material Design3 Typography(排版)的默认值及简单使用
所属分类:Android | 发布于 2023-03-26 23:24:16
在Jetpack Compose的Material Design3的Typography中,抛弃了Material Design2中的h1, h2这样的属性,使用了一套新的属性,更符合现代编程风格。
1、Material Design3的Typography中的属性
Typography(
displayLarge: TextStyle,
displayMedium: TextStyle,
displaySmall: TextStyle,
headlineLarge: TextStyle,
headlineMedium: TextStyle,
headlineSmall: TextStyle,
titleLarge: TextStyle,
titleMedium: TextStyle,
titleSmall: TextStyle,
bodyLarge: TextStyle,
bodyMedium: TextStyle,
bodySmall: TextStyle,
labelLarge: TextStyle,
labelMedium: TextStyle,
labelSmall: TextStyle
)
2、M3的Typography的默认值
M3 | 默认字体大小/行高 |
displayLarge |
Roboto 57/ |
displayMedium |
Roboto 45/ |
displaySmall |
Roboto 36/ |
headlineLarge |
Roboto 32/ |
headlineMedium |
Roboto 28/ |
headlineSmall |
Roboto 24/ |
titleLarge |
New- Roboto Medium 22/ |
titleMedium |
Roboto Medium 16/ |
titleSmall |
Roboto Medium 14/ |
bodyLarge |
Roboto 16/ |
bodyMedium |
Roboto 14/ |
bodySmall |
Roboto 12/ |
labelLarge |
Roboto Medium 14/ |
labelMedium |
Roboto Medium 12/ |
labelSmall |
New Roboto Medium, |
官方地址:https://developer.android.com/jetpack/compose/designsystems/material3#typography