Jesper Åman
10/13/2022, 3:34 PMText
from Compose.Siyamed
10/13/2022, 9:56 PMSiyamed
10/13/2022, 9:57 PMSiyamed
10/13/2022, 9:58 PMSiyamed
10/13/2022, 10:01 PMSiyamed
10/13/2022, 10:02 PMJesper Åman
10/14/2022, 6:34 AMthe difference between Span vs TextPaintI came across this myself yesterday as I was digging a bit deeper in the Compose code, thought this might be the culprit. One thing I saw that may or may not be related was this: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]anStyle.kt;drc=40bca873ee88887caf34da1a1aaee93cb6ddc7b6;l=727 Essentially interpolation between letter spacing from two different spans, seems like a potential source of inaccuracy. I would assume this is not what is causing the discrepancy in my case since we're probably not dealing with multiple spans here?
i will appreciate if you can create a ticket with the screenshot (not the above one but one with only letterspacing difference). We will check when available.Great, I'll go ahead and do that.
Compose Text does not have the goal to be pixel perfect equivalent of platform.Yeah I think that makes sense, and these discrepancies are pretty much indiscernible to the human eye. I just thought it would be nice if it was possible to get a pixel perfect match in order to appease the snapshot tests and have more confidence in the migration process.
Jesper Åman
10/14/2022, 1:36 PMTextView
when reading attributes from XML (and I would assume that this never manifests at runtime, it likely sorts itself out by the next layout cycle).
I've created a reproducible example here:
https://github.com/jeppeman/SnapshotDemo
I guess I can skip submitting an issue then @Siyamed, or is this something you want to investigate and fix anyway? cc @Mikael Ohlson