Skip to content

Limit Android 15 bounds-based text width to RTL text (#59504) - #59504

Closed
christophpurrer wants to merge 1 commit into
react:mainfrom
christophpurrer:export-D126965612
Closed

christophpurrer wants to merge 1 commit into
react:mainfrom
christophpurrer:export-D126965612

Conversation

@christophpurrer

@christophpurrer christophpurrer commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

On Android 15+, every exactly sized StaticLayout enables setUseBoundsForWidth and setShiftDrawingOffsetForStartOverhang to keep RTL line-start ink from clipping. The exact width usually comes from an earlier AT_MOST measurement, which is advance-based. When a font's glyph bounds extend past their advances (seen with some OEM system fonts), a single-line LTR Text with numberOfLines={1} no longer fits the width it was measured at, and gets ellipsized well inside its own frame.

Only enable the bounds-based width and start-overhang shift when the text contains RTL characters, which is the case the start-overhang handling was added for. LTR-only text goes back to advance-based layout in both passes, so the layout matches the measurement.

Changelog:
[Android][Fixed] - Fix single-line LTR Text being ellipsized inside its measured width on Android 15+

Reviewed By: christophpurrer

Differential Revision: D126965612

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 26, 2026
@meta-codesync

meta-codesync Bot commented Oct 26, 2026

Copy link
Copy Markdown

@christophpurrer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D126965612.

@meta-codesync meta-codesync Bot changed the title Limit Android 15 bounds-based text width to RTL text Limit Android 15 bounds-based text width to RTL text (#59504) Oct 26, 2026
christophpurrer pushed a commit to christophpurrer/react-native-macos that referenced this pull request Oct 26, 2026
Summary:



On Android 15+, every exactly sized `StaticLayout` enables `setUseBoundsForWidth` and `setShiftDrawingOffsetForStartOverhang` to keep RTL line-start ink from clipping. The exact width usually comes from an earlier `AT_MOST` measurement, which is advance-based. When a font's glyph bounds extend past their advances (seen with some OEM system fonts), a single-line LTR `Text` with `numberOfLines={1}` no longer fits the width it was measured at, and gets ellipsized well inside its own frame.

Only enable the bounds-based width and start-overhang shift when the text contains RTL characters, which is the case the start-overhang handling was added for. LTR-only text goes back to advance-based layout in both passes, so the layout matches the measurement.

Changelog:
[Android][Fixed] - Fix single-line LTR `Text` being ellipsized inside its measured width on Android 15+

Reviewed By: christophpurrer

Differential Revision: D126965612
Summary:



On Android 15+, every exactly sized `StaticLayout` enables `setUseBoundsForWidth` and `setShiftDrawingOffsetForStartOverhang` to keep RTL line-start ink from clipping. The exact width usually comes from an earlier `AT_MOST` measurement, which is advance-based. When a font's glyph bounds extend past their advances (seen with some OEM system fonts), a single-line LTR `Text` with `numberOfLines={1}` no longer fits the width it was measured at, and gets ellipsized well inside its own frame.

Only enable the bounds-based width and start-overhang shift when the text contains RTL characters, which is the case the start-overhang handling was added for. LTR-only text goes back to advance-based layout in both passes, so the layout matches the measurement.

Changelog:
[Android][Fixed] - Fix single-line LTR `Text` being ellipsized inside its measured width on Android 15+

Reviewed By: christophpurrer

Differential Revision: D126965612
@meta-codesync meta-codesync Bot closed this in 12e066b Oct 26, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 26, 2026
@meta-codesync

meta-codesync Bot commented Oct 26, 2026

Copy link
Copy Markdown

This pull request has been merged in 12e066b.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant