mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: In the old arch, stylistic sets were supported however in the new arch support was not added. It seems that fontVariant support was actually initially missed on iOS fabric however a limited version was added in https://github.com/facebook/react-native/pull/44112 . I referenced that PR and also old arch implementation for these changes. <img width="480" alt="Screenshot 2025-01-14 at 11 15 18 AM" src="https://github.com/user-attachments/assets/ec32a356-fadd-4281-83b9-15871bbcd18f" /> ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [GENERAL] [ADDED] - Support stylistic sets for fontVariant Pull Request resolved: https://github.com/facebook/react-native/pull/48674 Test Plan: - Verified that the "Unsupported FontVariant" native log no longer displays on both platforms - On iOS was easy to test in the tester app as SF supports stylistic sets by default: ``` <Text> Stylistic{'\n'} <Text>Normal: ${'\n'}</Text> <Text style={{fontVariant: ['stylistic-four']}}> Stylistic Four: $ </Text> </Text> ``` <img width="391" alt="Screenshot 2025-01-14 at 11 59 29 AM" src="https://github.com/user-attachments/assets/1ede258e-783f-448f-8300-4c8c710796ef" /> - On Android I could not find any system fonts that support stylistic sets by default so I added Raleway and confirmed with a W character  I did not add font variant example to the tester apps as I felt it could be confusing for people at a glance to understand why there is only a system font example on iOS and why I chose the specific stylistic set. Reviewed By: cipolleschi Differential Revision: D68205738 Pulled By: javache fbshipit-source-id: 03ce572d3c8ecafca71fe00fc0e88eeafc2558bb