Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

[Android] Unrecognized fontFamily silently falls back to the system font (no log, unlike iOS)

已關閉 適合新手
#58,750 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
75/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
android, kotlin, react-native
領域
mobile-dev

研究方向

從 ReactFontManager.kt 中的 createAssetTypeface 開始,並在 Android 上使用連結的 RNTesterPlayground.js 重現程式。使用未知的 fontFamily 時觀察 logcat,然後驗證 Android 的行為是否與 iOS 情況一致地回報未識別的 family,同時保留文件中說明的 fallback。

由索引模型根據 Issue 內容生成。

描述

Needs: Triage :mag: Platform: Android Platform: iOS
Description

On Android, when fontFamily doesn't match any font, ReactFontManager falls back to the system font without logging anything. iOS logs Unrecognized font family '<name>' in the same case (RCTFont.mm), so a missing or misnamed font is easy to spot on iOS but not on Android.

Steps to reproduce
  1. Set fontFamily: 'FontFamilyThatDoesNotExist' on a <Text> (see reproducer)
  2. Run on Android and watch logcat
  3. Text renders in the system font and nothing is logged
React Native Version

0.87.1

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info
Not environment specific: `createAssetTypeface` in ReactFontManager.kt has no log before the system font fallback (main and 0.87-stable).
Stacktrace or Logs
Android: nothing is logged.
iOS: Unrecognized font family 'FontFamilyThatDoesNotExist'
MANDATORY Reproducer

https://github.com/mosab-nasrallah/react-native/blob/repro-android-unknown-font-family/packages/rn-tester/js/examples/Playground/RNTesterPlayground.js

Screenshots and Videos

No response

主要語言
C++
星號
127k
分支
25.3k
PR 合併指標
30 天內沒有已合併 PR

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

react/react-native 的其他 Issue

查看 react/react-native 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。