react / react/react-native

Setting Fallback Fonts in FontFamily Styling is Not Supported

Open
#48,625 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs: Author Feedback Needs: Repro Needs: Version Info Never gets stale
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.