Last active
October 26, 2023 10:19
-
-
Save armcha/8201fc33b6e6a4aa6a7a66c7cfc1f4bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun GlanceText( | |
text: String, | |
@FontRes font: Int, | |
fontSize: TextUnit, | |
modifier: GlanceModifier = GlanceModifier, | |
color: Color = Color.Black, | |
letterSpacing: TextUnit = 0.1.sp | |
) { | |
Image( | |
modifier = modifier, | |
provider = ImageProvider( | |
LocalContext.current.textAsBitmap( | |
text = text, | |
fontSize = fontSize, | |
color = color, | |
font = font, | |
letterSpacing = letterSpacing.value | |
) | |
), | |
contentDescription = null, | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment