Skip to content

adjustsFontSizeToFit do not work correctly on Android #54356

Closed

Description

@gkueny

Description

On Android, when we show a Text with adjustsFontSizeToFit={true} and numberOfLines={1}, most of the time, text is too small and do not fill available space

Steps to reproduce

run https://snack.expo.dev/@gkuenyme/android-adjustsfontsizetofit-issue on Android device

React Native Version

0.81.4

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

I reproduce in a snack. But experience issue with our project too:

System:
  OS: macOS 26.0.1
  CPU: (10) arm64 Apple M1 Max
  Memory: 373.81 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.14.0
  Yarn:
    version: 1.22.22
  npm:
    version: 10.9.2
  Watchman:
    version: 2025.03.10.00
Managers:
  CocoaPods:
    version: 1.14.2
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.0
      - iOS 26.0
      - macOS 26.0
      - tvOS 26.0
      - visionOS 26.0
      - watchOS 26.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23726.103.2422.12816248
  Xcode:
    version: 26.0.1/17A400
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
  Ruby:
    version: 3.3.8
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.2
    wanted: 20.0.2
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.81.4
    wanted: 0.81.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

No logs or StackTrace

MANDATORY Reproducer

https://snack.expo.dev/@gkuenyme/android-adjustsfontsizetofit-issue

Screenshots and Videos

Here is iOS screenshot (no issue) and same on Android SM-G996B

ios no issue android  issue

Activity

  1. Racha2004 commented on Nov 10, 2025

    @Racha2004

    i was able to reproduce it locally

  2. cortinico commented on Nov 25, 2025

    @cortinico
    Contributor

    cc @j-piasecki as I believe you have some context on adjustsFontSizeToFit right?

  3. j-piasecki commented on Nov 26, 2025

    @j-piasecki
    Contributor

    As far as I remember, this was an issue with the scaling algorithm that we decided to keep so that the end result was consistent with the old arch. Is this something that should be fixed now?

  4. gkueny commented on Nov 26, 2025

    @gkueny
    Author

    @j-piasecki on our production app, we do not have this issue on old arch, but reproduce with new arch

    I will update my repro to confirm that 👀

  5. gkueny commented on Nov 26, 2025

    @gkueny
    Author

    @j-piasecki sorry i was wrong, I can confirm that I have same issue with expo sdk 50, that I believe is not new arch

  6. cortinico commented on Nov 26, 2025

    @cortinico
    Contributor

    As far as I remember, this was an issue with the scaling algorithm that we decided to keep so that the end result was consistent with the old arch. Is this something that should be fixed now?

    I think we could probably update the behavior now (or offer a feature flag in canary to do so) that brings the behavior consistent between Android & iOS

  7. j-piasecki commented on Nov 27, 2025

    @j-piasecki
    Contributor

    @gkueny Would it be possible for you to check if this PR solves it for you?

    @cortinico Do you think this change should be gated behind a feature flag?

  8. gkueny commented on Nov 27, 2025

    @gkueny
    Author

    Hi @j-piasecki and than you !

    I tried you fix but without success. Here is a Github repro with you patch: https://github.com/gkueny/TestIssueFontSizeAndroid-54356

    And here the result on SM-G996B before applying patch and after:

    I may be doing something wrong in the reproduction, I'll let you confirm whether or not with the reproduction repo, hoping that this may help.

  9. j-piasecki commented on Nov 27, 2025

    @j-piasecki
    Contributor

    @gkueny When modifying React Native sources, you also need to configure it not to use prebuilt binaries. Otherwise, no changes made will have any effect.

  10. gkueny commented on Nov 27, 2025

    @gkueny
    Author

    Oh ..., since 0.71, I should have known 🤦

    With this fixed, it's all ok for me 🙌, thank you

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