react / react/react-native

Setting Fallback Fonts in FontFamily Styling is Not Supported

Offen
#48,625 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Needs: Author Feedback Needs: Repro Needs: Version Info Never gets stale
Vorherrschende Sprache
C++
Sterne
127k
Forks
25.3k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
4

Beschreibung

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!

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem minimalen React-Native-Reproducer im Issue und vergleiche die bestehenden Fälle mit einer einzelnen Schriftart mit fontFamily: "Roboto, sans-serif" auf Android und iOS. Erledigt ist die Aufgabe, wenn durch Kommas getrennte Fallback-Schriftarten auf beiden betroffenen Plattformen für mehrsprachigen Text funktionieren und das gemeldete Verhalten abgedeckt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react-native
Bereich
mobile
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.