Repository navigation
Limit Android 15 bounds-based text width to RTL text (#59504) - #59504
Closed
christophpurrer wants to merge 1 commit into
Closed
christophpurrer wants to merge 1 commit into
christophpurrer wants to merge 1 commit into
Conversation
|
@christophpurrer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D126965612. |
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
christophpurrer
force-pushed
the
export-D126965612
branch
from
October 26, 2026 14:42
1d955d5 to
783af5d
Compare
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
christophpurrer
force-pushed
the
export-D126965612
branch
from
October 26, 2026 14:49
783af5d to
a3f0be4
Compare
|
This pull request has been merged in 12e066b. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
On Android 15+, every exactly sized
StaticLayoutenablessetUseBoundsForWidthandsetShiftDrawingOffsetForStartOverhangto keep RTL line-start ink from clipping. The exact width usually comes from an earlierAT_MOSTmeasurement, which is advance-based. When a font's glyph bounds extend past their advances (seen with some OEM system fonts), a single-line LTRTextwithnumberOfLines={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
Textbeing ellipsized inside its measured width on Android 15+Reviewed By: christophpurrer
Differential Revision: D126965612