Skip to content

Lines getting cut-off on Android devices with small font sizes #50916

Description

@LA-Johan

Description

When device font size is set to small words in certain configuration of parent views get cut-off (see reproducer). Our users just started reporting in the last month it so I believe it was introduced in 0.79.

Steps to reproduce

UI bug, see attached screenshots.

React Native Version

0.79.1

Affected Platforms

Runtime - Android, Build - MacOS

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

$npx @react-native-community/cli info
info Fetching system and libraries information...
System:
  OS: macOS 15.3.2
  CPU: (12) arm64 Apple M3 Pro
  Memory: 112.06 MB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.7.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 11.2.0
    path: ~/node_modules/.bin/npm
  Watchman:
    version: 2025.02.17.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /Users/johanlndll/.gem/ruby/3.1.4/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK:
    API Levels:
      - "30"
      - "34"
      - "35"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
      - 35.0.0
    System Images:
      - android-30 | Google Play ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-35 | Google APIs ARM 64 v8a
      - android-35 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.21829.142.2421.12409432
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.1.4
    path: /Users/johanlndll/.rubies/ruby-3.1.4/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

UI bug.

MANDATORY Reproducer

#50915

Screenshots and Videos

Emulator is Pixel_9_API_35

With the issue:

Image Image

Without the issue:

Image Image

Activity

  1. react-native-bot commented on Apr 24, 2025

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


    You can read more about about it on our website: How to report a bug.

  2. LA-Johan commented on Apr 24, 2025

    @LA-Johan
    Author

    Linked it in original, but in case it helps the bot this is pull request: #50915

  3. devanshsaini11 commented on Apr 27, 2025

    @devanshsaini11
    Collaborator

    @LA-Johan Thanks for opening the issue! While reviewing the output of npx @react-native-community/cli info, we couldn’t determine if the new architecture is enabled, could you let us know whether the problem occurs on both the old architecture and the new architecture? This will help us narrow things down.
    Thanks!

  4. LA-Johan commented on Apr 27, 2025

    @LA-Johan
    Author

    @devanshsaini11 this is only on new architecture!

  5. added
    Issue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.
    Type: New ArchitectureIssues and PRs related to new architecture (Fabric/Turbo Modules)
    and removed
    Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.
    on Apr 28, 2025
  6. LA-Johan commented on Apr 29, 2025

    @LA-Johan
    Author

    If anyone has found a workaround that would be great too. This breaks some of our core flows for users with different font sizes making some text completely unreadable.

  7. 18 remaining items

  8. huanguolin commented on Aug 8, 2025

    @huanguolin

    my workaround:

    import { Platform, StyleSheet, Text } from 'react-native';
    
    if (Platform.OS === 'android') {
        const styles = StyleSheet.create({
            defaultText: {
                fontFamily: '',
                // workaround
                fontWeight: 'normal',
            },
        });
        const oldRender = (Text as any).render;
        (Text as any).render = function (props: any, ...args: any[]) {
            return oldRender.call(
                this,
                {
                    ...props,
                    style: [styles.defaultText, props.style],
                },
                ...args,
            );
        };
    }
  9. WenBin0201 commented on Aug 8, 2025

    @WenBin0201

    @huanguolin
    这样的话 字重就没了
    我现在是设置了 robot字体 并且禁止缩放

  10. huanguolin commented on Aug 9, 2025

    @huanguolin

    @huanguolin 这样的话 字重就没了 我现在是设置了 robot字体 并且禁止缩放

    In my case, the fontWeight setting in the code is fine. However, when I set zoom to be disabled, it doesn’t work in version 0.77 (it works in 0.80). Moreover, my users won’t accept this.

  11. NiuGuohui commented on Aug 9, 2025

    @NiuGuohui

    Add a scenario: This problem can also occur on some tablet devices with very good screen resolution, such as screens with a resolution of 3200 * 2136 and 308PPI

  12. OskarAtJoint commented on Aug 13, 2025

    @OskarAtJoint

    mmm seems to occur when some specific length occurs, depending on font props, adding eg style
    Platform.OS === 'android' && { paddingHorizontal/paddingRight: 0.001 },
    helps for, at least one of our cases, but if it helps for all 🤷

  13. WenBin0201 commented on Aug 13, 2025

    @WenBin0201

    @OskarAtJoint I also apply this trick as a backup solution.

  14. klxiaoniu commented on Aug 20, 2025

    @klxiaoniu

    Confirmed this was fixed with the new logic for rounding in 1fe3ff8

    Note that the previous incorrect logic goes back all the way to legacy arch (ReactTextShadowNode), so I don't think the underlying bug is new, but it relies on getting "unlucky" with pixel grid rounding, so there are different cosmic butterflies that can influence this.

    Before After
    Image Image

    Could you please cherry pick this to 0.79?

  15. WenBin0201 commented on Sep 24, 2025

    @WenBin0201
  16. WenBin0201 commented on Sep 24, 2025

    @WenBin0201

    不仅切字 窗口的宽高还计算不准确

  17. DimitarNestorov commented on Apr 2, 2026

    @DimitarNestorov
    Contributor

    @LA-Johan have you checked if this happens on Android 14?

  18. yuzhiqiang1993 commented on Aug 12, 2026

    @yuzhiqiang1993

    Has this problem not been resolved yet?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.Needs: AttentionIssues where the author has responded to feedback.Platform: AndroidAndroid applications.Type: New ArchitectureIssues and PRs related to new architecture (Fabric/Turbo Modules)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions