정세현
02/28/2023, 8:21 AMOleksandr Karpovich [JB]
02/28/2023, 8:28 AMdarkmoon_uk
02/28/2023, 8:49 AMdarkmoon_uk
02/28/2023, 10:05 AMdarkmoon_uk
02/28/2023, 10:06 AM@Composable
fun FontTestView(provideFontBytes: suspend () -> ByteArray) {
var fontBytes by remember { mutableStateOf<ByteArray?>(null) }
LaunchedEffect(Unit) {
fontBytes = provideFontBytes()
}
fontBytes?.let { bytes ->
val skTypeface: Typeface = Typeface.makeFromData(Data.makeFromBytes(bytes))
val typeface = Typeface(skTypeface)
val fontFamily = FontFamily(typeface)
Text("Hello, this is a test of font loading", fontFamily = fontFamily, fontSize = 24.sp)
}
}
darkmoon_uk
02/28/2023, 10:09 AMresources
so that it ends up being copied as a file to the web-server - just hosted as a regular file alongside index.html
.darkmoon_uk
02/28/2023, 10:09 AM정세현
02/28/2023, 10:10 AMRobert Munro
12/22/2024, 3:49 PM