Skip to content

Conversation

@j-piasecki
Copy link
Contributor

Summary:
Changelog: [Android][Fixed] Fixed adjustsFontSizeToFit scaling the font size too much down

Fixes #54356

Previous implementation was always using the starting font size as base for calculating ratio and was applying it to the already scaled down font sizes in each iteration. This caused the text size to be scaled down too aggresively.

In this diff I changed the implementation to use the font size from the previous iteration for calculating the scale ratio to fix that. I also updated it to use binary seach instead of linear search for finding the largest fitting font size.

Differential Revision: D87973778

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 27, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 27, 2025

@j-piasecki has exported this pull request. If you are a Meta employee, you can view the originating Diff in D87973778.

Summary:

Changelog: [Android][Fixed] Fixed `adjustsFontSizeToFit` scaling the font size too much down

Fixes facebook#54356

Previous implementation was always using the starting font size as base for calculating ratio and was applying it to the already scaled down font sizes in each iteration. This caused the text size to be scaled down too aggresively.

In this diff I changed the implementation to use the font size from the previous iteration for calculating the scale ratio to fix that. I also updated it to use binary seach instead of linear search for finding the largest fitting font size.

Differential Revision: D87973778
Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync bot closed this in 253fdf4 Dec 5, 2025
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Dec 5, 2025
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @j-piasecki in 253fdf4

When will my fix make it into a release? | How to file a pick request?

@meta-codesync
Copy link

meta-codesync bot commented Dec 5, 2025

This pull request has been merged in 253fdf4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adjustsFontSizeToFit do not work correctly on Android

4 participants