compose-multiplatform
compose-multiplatform copied to clipboard
Support text hyphenation
Describe the bug Automatic text hyphenation does not work on iOS.
Affected platforms
- iOS
Versions
-
Libraries:
- Compose Multiplatform version: 1.6.10-dev1623
-
Kotlin version:
-
OS version(s) (required for Desktop and iOS issues): iOS 17.4
-
OS architecture (x86 or arm64): arm64
-
Device (model or simulator for iOS issues): All
To Reproduce
@Composable
fun App() {
MaterialTheme {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
Text(
text = text,
modifier = Modifier.width(200.dp).background(Color.LightGray).padding(8.dp),
style = MaterialTheme.typography.bodyMedium.copy(
lineBreak = LineBreak.Paragraph,
hyphens = Hyphens.Auto
)
)
}
}
}
expect fun getPlatformName(): String
private val text =
"This is compose multiplatform text on ${getPlatformName()}. This is more compose" +
" multiplatform text on ${getPlatformName()}. This is even more compose multiplatform" +
" text on ${getPlatformName()}. Supercalifragilisticexpialidocious!"
Screenshots
It's currently not supported. As I see, it's not implemented in an underlying skia library either. On Android, Compose uses a system line breaker for this.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.