Skip to content

fix(ios): align inline views with inherited fonts and line heights - #58967

Open
mym0404 wants to merge 2 commits into
react:mainfrom
mj-studio-playground:fix/ios-inline-view-inherited-font
Open

mym0404 wants to merge 2 commits into
react:mainfrom
mj-studio-playground:fix/ios-inline-view-inherited-font

Conversation

@mym0404

@mym0404 mym0404 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

iOS Fabric inline <View> attachments use a fallback font and miss the baseline offset from an explicit lineHeight. Preserve the enclosing <Text> font on each attachment and subtract NSBaselineOffsetAttributeName when positioning the View.

Reproduction | Measurements and logs

Before After
Before, default text size After, default text size
Before, enlarged text After, enlarged text

Changelog:

[IOS] [FIXED] - Align inline Views with inherited fonts and explicit lineHeight.

Test Plan:

  • RNTester source builds and agent-device on iPhone 17 Pro / iOS 26.5, at font scales 1.0 and 2.143: all nine measurable samples are within one physical pixel (1/3 pt). lineHeight: 48 public error is 10.293 pt before and -0.041 pt after; native baseline error is 0 pt after.
  • Existing RCTAttributedTextUtilsTest and RCTFontTests: 35 passed, 0 failed. clang-format, ESLint, Prettier, and git diff --check passed. Commands and test results are in the measurements above.
  • Android API 37 comparison: nine samples within 0.0001 dp at font scales 1.0 and 1.75 (results). Android renderer code is unchanged.

Nested Text returns a zero-size public View frame and is excluded from numerical comparisons.

@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 9, 2026
@mym0404
mym0404 marked this pull request as ready for review October 9, 2026 16:29
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 9, 2026
@mym0404 mym0404 changed the title fix(ios): inherit text fonts for inline attachments fix(ios): align inline views with inherited fonts and line heights Oct 9, 2026

This branch has not been deployed

No deployments
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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant