Log unrecognized font family on Android - #58751
mosab-nasrallah wants to merge 3 commits into
Conversation
|
Hi @mosab-nasrallah! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
javache
left a comment
There was a problem hiding this comment.
Is this warning accurate enough? What if you're using a different system font name and Typeface.create is able to resolve it?
You're right, it wasn't accurate. It now only logs when |
Summary:
On Android, a
fontFamilythat can't be resolved silently falls back to the default system font. iOS logsUnrecognized font family '<name>'in the same case (RCTFont.mm). This adds the same log on Android, only whenTypeface.createfalls back to the default typeface, so valid system families likemonospacedon't log.Fixes #58750
Changelog:
[ANDROID] [ADDED] - Log unrecognized font families, matching iOS
Test Plan:
Ran this branch's
ReactFontManager.ktin a test app on an API 35 emulator and checked logcat:'FontFamilyThatDoesNotExist'logsUnrecognized font family 'FontFamilyThatDoesNotExist'(once per style)'monospace','serif','sans-serif','sans-serif-medium','cursive', fonts inassets/fonts/and fonts added withaddCustomFontlog nothingRepro: RNTesterPlayground.js