Reputation: 394
Is it possible to update the baseline in a Compose Text component to center vertically with its pivot point as the center of the Character instead of the bottom. Usecase is for a Keyboard, each key should be Centered in its own box, but some characters look off centered
'b' is centered correctly but 'c' is not, looks offset to the bottom
Upvotes: 2
Views: 135
Reputation: 394
I found a solution, although i do not see anyway to do this in Android Studio, i think it might not be possible. But a solution would be to use the font as a custom font, edit the fonts .ttf file, and center each glyph manually. As far as i see in Android Studio each glyph takes up more space than the letter itself and centers itself according to that glyph and its position in the glyph. When you use "Alignment.Center" you are centering the glyph not the letter itself
Upvotes: 1