Skip to content

Instantly share code, notes, and snippets.

@armcha
Last active October 26, 2023 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save armcha/8201fc33b6e6a4aa6a7a66c7cfc1f4bb to your computer and use it in GitHub Desktop.
Save armcha/8201fc33b6e6a4aa6a7a66c7cfc1f4bb to your computer and use it in GitHub Desktop.
@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