JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.9k stars 1.16k forks source link

Text: letterSpacing and TextAlign.Center break text centering #1856

Open mcpiroman opened 2 years ago

mcpiroman commented 2 years ago
MaterialTheme {
    Column {
        /*A*/ Text("BLAH", Modifier.border(2.dp, Color.Red), letterSpacing = 10.sp)
        /*B*/ Text("BLAH", Modifier.border(2.dp, Color.Red), letterSpacing = 10.sp, textAlign = TextAlign.Center)
    }
}

Actual:

image

Expected:

I expect letterSpacing not to add any padding (so that all letters touch the border).

However, if it is meant to do so, then:


Not sure if it's specific to CfD, I'd file it at Google's tracker, but I'm not sure which Jetpack's versions correspond to CfD.

SudoDios commented 10 months ago

Hi. letterSpacing get padding in end of text Screenshot from 2023-11-19 10-42-48 How to fix it ?

okushnikov commented 2 weeks ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.