feat: add support for fontStyle #3778
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for
fontStyleinconfigureFontswith strong emphasis on how fragile it is in RN right now (explained both in docs and in our example app).Basic idea is that most of our users should still use separate font files for bold / italic fonts. Although if they manage to bundle a variable font that works on each platform - then they should be able to use it with simple
fontStyle. This is how I tried to explain it in the docs.Also, prepared a test screen in our Example app, showing that
Inter v4.0font withslntvariation fails to render variants on bothiOS 16.2andAndroid 13:In this case
iOSreplaces variants with base variant, whileandroidreplaces variants with default font for OS.Users can use this screen to test their own custom fonts.
Closes #3499
Test plan
No functional changes, added
fontStyleprop to existing unit tests just in case.