79673738

Date: 2025-06-20 17:11:57
Score: 0.5
Natty:
Report link

You can try trimming both directions of the text

Text(
    text = "Hello world",
    modifier = modifier
        .border(
        width = 1.dp,
        color = Color.Red
    ).padding(0.dp),
    style = MaterialTheme.typography.displaySmall.copy(
        lineHeightStyle = LineHeightStyle(
            alignment = LineHeightStyle.Alignment.Center,
            trim = LineHeightStyle.Trim.Both,
        ),
        platformStyle = PlatformTextStyle(
            includeFontPadding = false
        ),
    )
)

enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Cj_Rodriguez