I’m trying to achieve a similar effect like in terminal, where █ looks like a space with filled background.
My current code looks like this:
@Composable
fun myComposable(){
val res = "██n ██"
Text(
text = res,
style = TextStyle(letterSpacing = 0.sp, lineHeight = (height - 3).dp.textDpToSp(LocalDensity.current)),
fontFamily = FontFamily.Monospace,
fontSize = TEXT_SIZE_SP
)
}
fun Dp.textDpToSp(density: Density): TextUnit = with(density) {
[email protected]()
}
I’ve tried following apporaches with a on Ubuntu:
- setting text spacing to 0.sp ( but there are still very thin spaces)
- reducing the height slightly, but the effect isn’t scalable for other text sizes.
New contributor
user25468871 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.