I have two lines of text, which have to be in sepa...
# compose
l
I have two lines of text, which have to be in separate
Text
composables inside a
Column
(they cannot be in an
annotatedString()
). How can I make sure there is still typographicaly correct vertical space between them? Is there some API to get the line spacing from a
TextStyle
?
k
I don't think there is a straight forward way to do this. Have you looked at the onTextLayout() callback ?
l
No, although maybe it's a good direction. Right now I just took the
(lineHeight.toDp() - fontSize.toDp()) / 2
.
k
Yeah. It'd probably have to be something like that. The TextLayoutResult has some baseline measurements that might be useful.
👍 1