, but obviously the real bounding box’s top of these charaters is not 0.
r
romainguy
08/30/2025, 5:19 PM
To get pixel-level bounding boxes you have to go through the graphics APIs but I don’t know if the necessary APIs have been exposed in Compose. On Android you’d use a Paint object to measure the text or turn it into a Path and then get the path’s bounds.
romainguy
08/30/2025, 5:19 PM
Having a text -> Path API in Compose would make sense as it can be used for many things including your use case
a
Alexander Maryanovsky
08/30/2025, 5:38 PM
I see, thanks.
z
Zach Klippenstein (he/him) [MOD]
09/01/2025, 3:24 PM
Something that could potentially be added to TextMeasurer or TextLayoutResult APIs, worth a feature request