Skip to content
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

Only find closest font if system font was not found #32482

Closed
wants to merge 1 commit into from

Conversation

danilobuerger
Copy link
Contributor

Summary

Before f951da9 finding a system font used to return early. In order to allow variants, the referenced patch removed the early return so that variants could be applied later. However, there is no need to find the closest font as we already selected the proper system font. This also fixes a bug with setting a custom font handler via RCTSetDefaultFontHandler whos return could get overwritten by the closest font search.

Changelog

[iOS] [Fixed] - Respect RCTSetDefaultFontHandler chosen font

Test Plan

@facebook-github-bot facebook-github-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 Oct 27, 2021
@danilobuerger
Copy link
Contributor Author

cc @jacobp100 since this references your commit.

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 27, 2021
@react-native-bot react-native-bot added Bug Platform: iOS iOS applications. labels Oct 27, 2021
@pull-bot
Copy link

PR build artifact for 0c5d6e6 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.

@pull-bot
Copy link

PR build artifact for 5482c58 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.

@danilobuerger
Copy link
Contributor Author

the failing test seem unrelated to my commit

@analysis-bot
Copy link

analysis-bot commented Oct 27, 2021

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,297,788 +0
android hermes armeabi-v7a 7,634,879 +0
android hermes x86 8,771,104 +0
android hermes x86_64 8,708,122 +0
android jsc arm64-v8a 9,783,593 +0
android jsc armeabi-v7a 8,768,874 +0
android jsc x86 9,749,504 +0
android jsc x86_64 10,345,405 +0

Base commit: d6db5c5
Branch: main

@pull-bot
Copy link

PR build artifact for 4d8cf39 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.

@cortinico
Copy link
Contributor

Hey @danilobuerger, Thanks for the PR.
Could you please rebase the CI on top of main as the CI is currently red?

Before facebook@f951da9 finding a system font used to return early. In order to allow variants, the referenced patch removed the early return so that variants could be applied later. However, there is no need to find the closest font as we already selected the proper system font. This also fixes a bug with setting a custom font handler via RCTSetDefaultFontHandler whos return could get overwritten by the closest font search.
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: d6db5c5
Branch: main

@danilobuerger
Copy link
Contributor Author

@cortinico Hi, I rebased it. One test is still failing which seems unrelated to my change.

@facebook-github-bot
Copy link
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @danilobuerger in 89efa1a.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Jan 28, 2022
@danilobuerger danilobuerger deleted the patch-3 branch January 31, 2022 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: iOS iOS applications. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants