Mark
11/12/2025, 12:31 PMTextIndent indentation values being TextUnit? The problem here is that TextUnit does not scale linearly, so we can’t just double the value to get double the margin size. To fudge it, we need access to the Density.Stylianos Gakis
11/12/2025, 1:35 PMMark
11/12/2025, 1:40 PMTextUnit best describes the size of a character/glyph, not an indentation size.
What to do now? Suppose I guess that a character is 10.sp, and I want about 4 characters to represent a single-level indent. I can’t just use 40.sp because that is probably much less than 4 characters. And it gets worse and worse as you get 2, 3, 4 or more levels deep. Note, this is relevant even when fontScale is the default (1f), thanks to changes introduced in Android 14.
https://developer.android.com/about/versions/14/features#non-linear-font-scalingAlex Vanyo
11/12/2025, 4:53 PMMark
11/13/2025, 3:42 AMMark
11/13/2025, 3:55 AMem doesn’t help because that can’t be converted to px in order to do the workaround of working out an indent corresponding to, say, 4 characters. What I would like to declare is something like indentSize = 4 half-width characters, indentCount = 3
EDIT: I just confirmed that specifying 1.em throws: IllegalStateException: Only Sp can convert to Px from compose