-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Fix/text cutoff when scaling #39711
Fix/text cutoff when scaling #39711
Conversation
…ing for it will be called in super constructor
Base commit: 8e36cc0 |
This PR fixed npe in #39581 which has been reverted. |
Hi, @NickGerleman Could you help to review this PR? |
@jcdhlzq hi, I have the same problem as you, but I set allowFontScaling to false, and still could not display the numbers completely. what should I do? |
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This PR was closed because it has been stalled for 7 days with no activity. |
Fix Text cut off issues when adjusting text size and font weight in system settings.
Summary:
This pr fixed the problem that can be reproduced with the snack on Xiaomi devices with MIUI13 and MIUI14. The problem is shown as the image below: the number "999" is cut off and only "99" is rendered.
The problem is produced with setting font scaling in system settings like the image below shows.
This text cut off case can be avoided by setting
allowFontScaling
to false. But this pr can make it no matter what valueallowFontScaling
is set.The root cause of this case, according to MIUI developers, is that Misans typeface, as a variable font which will adjust the weight of different font axes with different font size, gets different widths when Text is measured and drawn for a bug in the framework of MIUI rom. They will fix this bug in next version while this pr fixed it in old versions.
Changelog:
[ANDROID][FIXED]-Fix Text cut off issues when adjusting text size and font weight in system settings.
Test Plan:
The effect after fixed is shown in the image below.