<Hyphenation got announced in 1.3.0rc01>. Tried it...
# compose
l
Hyphenation got announced in 1.3.0rc01. Tried it out but I’m unable to figure out the difference in the behaviors🤔 (Couldn’t see the hyphen too…) Added the soft-hyphen also as follows
"Hyphenation \u00AD is here!"
to see any behavior changes. Couldn’t figure it out though 🥲 〜 Am I missing something ?
z
Have you tried running on a device or emulator?
l
On device it’s the same (running on a Pixel4)
z
No hyphens on the Pixel4 either?
Please file a bug with all this information
a
If you change the LineBreak to something other than Simple, does it help?
l
Yup still no hyphen. Will do 👍
If you change the LineBreak to something other than Simple, does it help?
Let me try this out
Copy code
Text(
    modifier = Modifier.width(textWidth),
    text = text,
    style = TextStyle(
        fontSize = 24.sp,
        color = Color.Red,
        hyphens = Hyphens.Auto,
        lineBreak = LineBreak.Heading
    )
)
Get’s even weirder 😅 (on Pixel4)
a
What Android version is this?
l
13
a
Thanks! Please file a bug as Zach suggested above
l
Sure will! Thanks!!
a
Quick follow-up. What locale do you have on a device?
Is it English?
l
It’s Japanese 😅 Let me try it out with English once
a
Yeah, it should work with English
l
Yup works 🎉 🎉 Should I go ahead filing the bug ? Updating the docs or an Appropriate Locale warning or something would help blob smile
a
I think updating the docs will be helpful
so please file a bug so we don’t forget
l
s
Can you try setting the locale of the text using TextStyle? It might be that Text doesn't know the language and tries to apply system locale dictionaries.
In this case english text on japanese locale will not be able to find hyphen candidates
It is similar to this html desc "Hyphenation rules are language-specific. In HTML, the language is determined by the lang attribute, and browsers will hyphenate only if this attribute is present and the appropriate hyphenation dictionary is available. "