moko-resources
moko-resources copied to clipboard
@ReadOnlyComposable on fontFamilyResource and FontResource.asFont
Is it possible to make these functions have @ReadOnlyComposable also? To make it a bit more efficient
// @ReadOnlyComposable <-- is it possible?
@Composable
fun fontFamilyResource(fontResource: FontResource): FontFamily {
return fontResource.asFont()
?.let { FontFamily(it) }
?: FontFamily.Default
}
// @ReadOnlyComposable <-- is it possible?
@Composable
expect fun FontResource.asFont(
weight: FontWeight = FontWeight.Normal,
style: FontStyle = FontStyle.Normal,
): Font?