Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support text hyphenation #4792

Open
brewin opened this issue May 9, 2024 · 1 comment
Open

Support text hyphenation #4792

brewin opened this issue May 9, 2024 · 1 comment
Labels
enhancement New feature or request skia text

Comments

@brewin
Copy link

brewin commented May 9, 2024

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

@brewin brewin added bug Something isn't working submitted labels May 9, 2024
@MatkovIvan MatkovIvan changed the title Text hyphenation does not work on iOS Support text hyphenation May 13, 2024
@MatkovIvan MatkovIvan added enhancement New feature or request and removed bug Something isn't working submitted labels May 13, 2024
@MatkovIvan
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request skia text
Projects
None yet
Development

No branches or pull requests

2 participants