Skip to content

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

Description

@mosab-nasrallah

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions