Skip to content

adjustsFontSizeToFit not working as expected on Android #43104

Closed

Description

@vikalinic

Description

On Android devices when adjustsFontSizeToFit is set to Text component, text is missing and not resized.
Tested on version 0.73.1 and 0.73.4
Working as expected on iOS and Android with old Arch.
On Expo Snack working as expected.

Steps to reproduce

    <Text
      style={styles.textStyle}
      adjustsFontSizeToFit
      numberOfLines={1}>
      Some random big text 
    </Text>
    
    .....

const styles = StyleSheet.create({
textStyle: {
color: 'white',
fontSize: 50,
},
});

React Native Version

0.73.1

Affected Platforms

Runtime - Android

Areas

Fabric - The New Renderer, JSI - Javascript Interface

Output of npx react-native info

System:
  OS: macOS 14.2.1
  CPU: (8) arm64 Apple M1 Pro
  Memory: 170.55 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.5.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.21
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.2.4
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2023.12.04.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK:
    API Levels:
      - "33"
      - "34"
      - "34"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10811636
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /opt/homebrew/opt/openjdk@17/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.1
    wanted: 0.73.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

-

Reproducer

https://snack.expo.dev/iJlK5wo96XDF2FPlYXbIc?platform=android

Screenshots and Videos

Android
Screenshot 2024-02-19 at 16 06 24

iOS
Screenshot 2024-02-19 at 16 06 24

Activity

  1. added
    Type: New Architecture
    on Feb 20, 2024
  2. github-actions commented on Feb 20, 2024

    @github-actions
    ⚠️ Newer Version of React Native is Available!
    ℹ️ You are on a supported minor version, but it looks like there's a newer patch available - 0.73.4. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
  3. added
    Issue: Author Provided Repro
    and removed on Mar 5, 2024
  4. cortinico commented on Mar 25, 2024

    @cortinico
    Contributor

    Related to #42044

  5. j-piasecki commented on Apr 9, 2024

    @j-piasecki
    Contributor

    Oh, I believe I need to comment on the issue for you to be able to assign me @cortinico.

  6. cortinico commented on Apr 9, 2024

    @cortinico
    Contributor

    Oh, I believe I need to comment on the issue for you to be able to assign me @cortinico.

    Exactly :)

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

Metadata

Metadata

Assignees

Labels

Issue: Author Provided ReproNewer Patch AvailablePlatform: AndroidType: New Architecture

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions