-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android Text lineHeight is incorrect for the first line #7546
Comments
@andreicoman11 any thoughts? |
Will have to investigate, it's probably a cool bug somewhere. |
@brentvatne @andreicoman11 Did this ever get fixed? |
I have diff internally that fixes this, I just need to get all details right and land it. |
@andreicoman11 That'd be awesome :D |
wooo awesome @andreicoman11! |
Same problem here, is there any fix for this? |
@andreicoman11 is there any chance you will do a PR with a fix? |
c79f617 fixes this. The TLDR is that Android's StaticLayout gives you incorrect layout when using It took longer than usual to fix this because it was tricky to get the implementation details right. We initially pushed a version of this fix internally and then had to immediately revert it because it didn't work right in many cases. Given that this might change the layout of many Text components, we might still need to do that, or to add more fixes on top of this one. |
@andreicoman11
|
@alexHlebnikov do you mind opening a new issue with the entire code, expected outcome, actual outcome, maybe also a few screenshots? Thanks! |
Please try to use .TTF webfont. I had this issue but I was using .OTF |
Same problem here with OTF or TTF fonts. (the lineHeight is incorrect only for the first line) I'm using |
Looking at the Release notes of RN 0.35.0 I noticed that this bug was fixed and I just confirmed it works fine in Android. Thanks @andreicoman11 |
@mdvacca It still does not work fine for me. |
Noticed this in a production app, easy repro case with the template app: all I did to the example app was add some
lineHeight
and change the text to make it obvious. You can copy and paste the source from here: https://gist.github.com/brentvatne/ed98472bc8605484862c7adfdee8d5caExample gif:
Full video: http://url.brentvatne.ca/1jQXm
cc @dmmiller
The text was updated successfully, but these errors were encountered: