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

Daniele Segato

03/25/2022, 2:42 PM
Why aren't text transformations (such as all-caps) part of
TextStyle
? Most designers see those as part of the text styling but in compose we are forced to handle them via code. Is there any plan to include text transformations in text style so that we can manage them in themes? In some project I created my own Text widgets to add this behavior, but I think it should be part of Compose handling of Texts.
s

Siyamed

03/25/2022, 7:06 PM
One reason was they create problems for selection, editing etc when uppercase version is different than lowercase. There were a few more but it is safer to call string.toUpperCase
I am not a language expert but 'SS' in german was one of the common exanples
It doesn't mean we wont add (i dont have an opinion if we will or we will not) but it was more reliable for everybody for api user to call to upper case for now.
d

Daniele Segato

03/27/2022, 8:58 AM
I still think it can be done by calling upper case, I just think it should be part of the
TextStyle
It should be possible to use it in the theme
s

Siyamed

03/27/2022, 2:37 PM
Please create a ticket 👍
d

Daniele Segato

03/27/2022, 2:39 PM
I will and link it here :-)
s

Siyamed

03/27/2022, 2:40 PM
Sure. Meanwhile you should be able to have a custom theme attribute, and apply via VisualTransformation (hmm this is for editing). For text (or editin) toUppercase
d

Daniele Segato

03/27/2022, 2:43 PM
That's a good point. VisualTransformation would make more sense for a styling attribute
(sorry messed up the formatting in the issue)