Zoltan Demant
03/18/2024, 8:26 AMIvan Matkov
03/18/2024, 9:02 AMZoltan Demant
03/18/2024, 9:08 AMIvan Matkov
03/18/2024, 9:10 AMif Im using the same font I should see somewhat identical positioning of text between android and desktop?Yes.
Thats not the case for me, you might be able to seeIt's hard to guess why it's not centered without a code snippet
Ivan Matkov
03/18/2024, 9:12 AMLineHeightStyle.Alignment
is not supported yet on multiplatform (skia doesn't expose such API)Zoltan Demant
03/18/2024, 9:34 AMBox(Modifier.background(Color.Black)) {
BasicText(
text = "123",
modifier = Modifier.debugBorder(),
color = { Color.White },
style = TextStyle.Default.merge(fontSize = 96.sp),
)
}
I stripped it down as far as I could, and just doing this gives me differences between top/bottom (something like 45px bottom, 62px top)Zoltan Demant
03/18/2024, 9:38 AMAh. AndSo this could be related to that? M3 specifies Proportionally, which I guess gets used on Android and not desktop?is not supported yet on multiplatform (skia doesn't expose such API)LineHeightStyle.Alignment
Ivan Matkov
03/18/2024, 9:49 AMM3 specifies Proportionally, which I guess gets used on Android and not desktop?No,
Proportional
is the only supported mode on Desktop now, so this case will handle correctly
just doing this gives me differences betweenI see that it's uses default font, so I guess it's because of it
Zoltan Demant
03/18/2024, 9:52 AMZoltan Demant
03/18/2024, 9:55 AMZoltan Demant
03/18/2024, 10:10 AMZoltan Demant
03/18/2024, 10:13 AMIvan Matkov
03/18/2024, 10:24 AMZoltan Demant
03/18/2024, 10:35 AMZoltan Demant
03/18/2024, 10:57 AM