https://kotlinlang.org logo
#compose
Title
# compose
l

lilypuchi

10/06/2022, 6:31 AM
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

Zach Klippenstein (he/him) [MOD]

10/06/2022, 4:07 PM
Have you tried running on a device or emulator?
l

lilypuchi

10/06/2022, 4:11 PM
On device it’s the same (running on a Pixel4)
z

Zach Klippenstein (he/him) [MOD]

10/06/2022, 4:11 PM
No hyphens on the Pixel4 either?
Please file a bug with all this information
a

Anastasia [G]

10/06/2022, 4:16 PM
If you change the LineBreak to something other than Simple, does it help?
l

lilypuchi

10/06/2022, 4:16 PM
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

Anastasia [G]

10/06/2022, 4:21 PM
What Android version is this?
l

lilypuchi

10/06/2022, 4:22 PM
13
a

Anastasia [G]

10/06/2022, 4:26 PM
Thanks! Please file a bug as Zach suggested above
l

lilypuchi

10/06/2022, 4:28 PM
Sure will! Thanks!!
a

Anastasia [G]

10/06/2022, 4:32 PM
Quick follow-up. What locale do you have on a device?
Is it English?
l

lilypuchi

10/06/2022, 4:33 PM
It’s Japanese 😅 Let me try it out with English once
a

Anastasia [G]

10/06/2022, 4:33 PM
Yeah, it should work with English
l

lilypuchi

10/06/2022, 4:36 PM
Yup works 🎉 🎉 Should I go ahead filing the bug ? Updating the docs or an Appropriate Locale warning or something would help blob smile
a

Anastasia [G]

10/06/2022, 4:37 PM
I think updating the docs will be helpful
so please file a bug so we don’t forget
l

lilypuchi

10/06/2022, 4:40 PM
s

Siyamed

10/06/2022, 4:56 PM
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. "
18 Views