Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SatyaSnehith/54cf4ce68d3e4afc0febb31db3d8a1ef to your computer and use it in GitHub Desktop.
Save SatyaSnehith/54cf4ce68d3e4afc0febb31db3d8a1ef to your computer and use it in GitHub Desktop.
automatic creation of fonts values in compose
fun printFont() {
for (fontWeight in listOf(
"Thin",
"Light",
"Normal",
"Medium",
"Bold",
"Black"
)) {
for (fontSize in 12..24) {
println("val text$fontSize$fontWeight = robotoTextStyle.copy(\n" +
" fontSize = $fontSize.sp,\n" +
" fontWeight = FontWeight.$fontWeight\n" +
")\n")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment