Skip to content

Name CustomStyleSpan's font style and weight for what they hold - #57979

Closed
Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D115621390
Closed

Name CustomStyleSpan's font style and weight for what they hold#57979
Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D115621390

Conversation

@Abbondanzo

Copy link
Copy Markdown
Contributor

Summary:
CustomStyleSpan held its two typeface axes as privateStyle and privateWeight, named that way only to dodge a collision with the normalising style and weight getters. That detail then leaked into every call site that wanted to use named arguments.

The collision is now resolved from the other side. The two normalising getters become effectiveStyle and effectiveWeight, matching effectiveFontSize, effectiveLineHeight and effectiveLetterSpacing on TextAttributes as well as the effectiveFontStyle and effectiveFontWeight locals that ReactEditText already compares them against. They are computed once when the span is constructed rather than on every read.

Changelog: [Internal]

Differential Revision: D115621390

Summary:
`CustomStyleSpan` held its two typeface axes as `privateStyle` and `privateWeight`, named that way only to dodge a collision with the normalising `style` and `weight` getters. That detail then leaked into every call site that wanted to use named arguments.

The collision is now resolved from the other side. The two normalising getters become `effectiveStyle` and `effectiveWeight`, matching `effectiveFontSize`, `effectiveLineHeight` and `effectiveLetterSpacing` on `TextAttributes` as well as the `effectiveFontStyle` and `effectiveFontWeight` locals that `ReactEditText` already compares them against. They are computed once when the span is constructed rather than on every read.

Changelog: [Internal]

Differential Revision: D115621390
@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 Aug 17, 2026
@meta-codesync

meta-codesync Bot commented Aug 17, 2026

Copy link
Copy Markdown

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

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. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant