import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp
import com.example.meditationui.R
val gothicA1 = FontFamily(
listOf(
Font(R.font.gothica1_regular, FontWeight.Normal),
Font(R.font.gothica1_medium, FontWeight.Medium),
Font(R.font.gothica1_semibold, FontWeight.SemiBold),
Font(R.font.gothica1_bold, FontWeight.Bold),
Font(R.font.gothica1_black, FontWeight.Black),
)
)
// Set of Material typography styles to start with
val Typography = Typography(
bodyLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.5.sp
),
h1 = TextStyle(
color = TextWhite,
fontFamily = gothicA1,
fontWeight = FontWeight.Bold,
fontSize = 22.sp
)
)
Android Studio 未检测到 h1“无法找到具有此名称的参数:h1”
我尝试将自定义字体系列添加到我的项目中,但我不断面临这个问题“找不到具有此名称的参数:h1”
h1
。
您可以使用 headlineLarge
、headlineMedium
或 headlineSmall
来代替。