Closed kingsword09 closed 1 month ago
Different platforms have different default fonts, so the exact position of glyphs may vary a bit. To get equal positioning - use the same font (from resources for example)
Marking it as duplicate as it was answered a few times already (1, 2, ...).
The only leftover is to support all lineHeightStyle
values: #2602, but it won't affect the case in the description of this issue
Describe the bug The demo I downloaded from kmp.jetbrains.com for testing Icon and Text vertical alignment works fine on the Android end, but it is not vertically centered on desktop jvm and iOS.
Affected platforms
Versions
Libraries:
Kotlin version: 1.9.24
OS version(s) (required for Desktop and iOS issues): MacOS: 14.4.1 iOS: 17.4
OS architecture (x86 or arm64): arm64
Device (model or simulator for iOS issues): simulator
JDK (for desktop issues): corretto-17
To Reproduce Steps to reproduce the behavior:
Run this code snippet:
Expected behavior Hoping for the icon and text to align vertically in the center.
Screenshots Desktop:![image](https://github.com/JetBrains/compose-multiplatform/assets/19650362/aa95defb-5ce0-4185-ba7a-8a6f8e04c320)
iOS:![image](https://github.com/JetBrains/compose-multiplatform/assets/19650362/87c18ff0-8eb5-43cd-8be9-0975ed8c4609)
Android:![image](https://github.com/JetBrains/compose-multiplatform/assets/19650362/0c08a206-9874-4d05-8dc3-6e8d8c3b54e9)
Additional context The Android and iOS platform meets the requirements, but Desktop do not.