Skip to content

fix(ios): inherit text fonts for inline attachments - #58967

Merged
meta-codesync[bot] merged 3 commits into
react:mainfrom
mj-studio-playground:fix/ios-inline-view-inherited-font
Nov 26, 2026
Merged

meta-codesync[bot] merged 3 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 omit the enclosing <Text> font. Apply that font to the attachment. The RNTester example covers font inheritance, line heights, wrapping, and Dynamic Type.

Rebased onto main at 2fed45cd. Baseline positioning uses main's TextKit implementation from #59921; the superseded manual baseline-offset adjustment has been removed.

The reproduction is included in RNTester under Text > Inline view baseline alignment, with ten samples, numeric alignment differences, and Dynamic Type. Direct link: rntester://example/TextExample/inline-view-baseline.

Earlier source-build comparison: main@502f112f and PR@d969690b. The screenshots and measurements below are from those revisions.

RNTester source-build results, commands, and measurements

Before After
RNTester before, default text size RNTester after, default text size
RNTester before, enlarged text RNTester after, enlarged text

Changelog:

[IOS] [FIXED] - Preserve inherited text fonts on inline View attachments.

Test Plan:

  • Rebase verification: the font-inheritance code and both RNTester files match the previous PR revision byte for byte. RCTTextLayoutManager.mm matches the new base exactly.
  • Current checks: Prettier, ESLint (--max-warnings 0), the full Flow check (--max-workers 6), clang-format, and git diff --check origin/main: passed.
  • Earlier source-build verification: RNTester Debug builds succeeded before and after the original fix. All nine measurable cases were within one physical pixel (0.333 pt) at font scales 1.0 and 2.143. Nested Text was checked visually because its public View measurement is unavailable.
  • Earlier verification: 35 native font/attributed-string tests passed; Android API 37's nine cases stayed within 0.0001 dp at scales 1.0 and 1.75 (results).

Native source builds were not rerun for this rebase.

@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
@mym0404

mym0404 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Hi @cipolleschi, could you please review this iOS inline View alignment fix when you have a chance? Thank you!

@mym0404

mym0404 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Hi @cortinico, could you please review this iOS inline View alignment fix when you have a chance? Thank you!

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reproduction | Measurements and logs

Can we add this reproduction to RNTester please?

@cortinico

Copy link
Copy Markdown
Contributor

@mym0404 also pls fix merge conflicts

@mym0404

mym0404 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

@cortinico conflicts have been resolved.

@meta-codesync

meta-codesync Bot commented Nov 13, 2026

Copy link
Copy Markdown

@cortinico has imported this pull request. If you are a Meta employee, you can view this in D131806404.

@cortinico

Copy link
Copy Markdown
Contributor

@mym0404 can you please rebase and resolve the conflicts so we can merge this?

@mym0404
mym0404 force-pushed the fix/ios-inline-view-inherited-font branch from d969690 to 86a3f09 Compare November 26, 2026 13:54
@github-actions github-actions Bot added the Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. label Nov 26, 2026
@mym0404 mym0404 changed the title fix(ios): align inline views with inherited fonts and line heights fix(ios): inherit text fonts for inline attachments Nov 26, 2026
@mym0404

mym0404 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

@cortinico Rebased onto the latest main and resolved the conflicts, keeping the baseline positioning from #59921 and the RNTester example. Local Flow, ESLint and formatting checks pass. The Meta check reports unexported internal changes; could you sync/export D131806404 as well? Thanks!

@cortinico

Copy link
Copy Markdown
Contributor

@cortinico Rebased onto the latest main and resolved the conflicts, keeping the baseline positioning from #59921 and the RNTester example. Local Flow, ESLint and formatting checks pass. The Meta check reports unexported internal changes; could you sync/export D131806404 as well? Thanks!

yup I couldn't re-sync till you rebased, thanks for doing it.

@meta-codesync
meta-codesync Bot merged commit 562e397 into react:main Nov 26, 2026
102 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @mym0404 in 562e397

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Nov 26, 2026
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 Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. 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.

3 participants