Setting Fallback Fonts in FontFamily Styling is Not Supported
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 127k
- Forks
- 25.3k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 4
Description
Description
There is an issue already for this bug #25798, but for some reason it has been closed even though it's not fixed yet. This issue should not be closed even if there is inactivity. It is a bug obviously.
This is a critical bug especially if there are multi-languages in the app, let's say an app with both Hebrew and Latin texts. For the Hebrew text you use "HebrewFont" and for Latin text you use "LatinFont", so you should be able to set the fontFamily to "HebrewFont, LatinFont"
Steps to reproduce
This line of code works fine:
<Text style={{ fontFamily: "sans-serif" }}>Hello</Text>
This line of code works fine too:
<Text style={{ fontFamily: "Roboto" }}>Hello</Text>
But this doesn't work:
<Text style={{ fontFamily: "Roboto, sans-serif" }}>Hello</Text>
React Native Version
0.76.2
Affected Platforms
Runtime - Android, Runtime - iOS
Output of npx react-native info
Any React Native Project!
Stacktrace or Logs
There are no logs related to this issue
Reproducer
Any React Native Project!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal React Native reproducer in the issue and compare the existing single-font cases with fontFamily: "Roboto, sans-serif" on Android and iOS. Done means comma-separated fallback fonts work for multilingual text on both affected platforms, with coverage for the reported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100