Skip to content

Add Android text font variation settings (#57804) - #57804

Open
evankatz14 wants to merge 1 commit into
react:mainfrom
evankatz14:export-D113580491
Open

Add Android text font variation settings (#57804)#57804
evankatz14 wants to merge 1 commit into
react:mainfrom
evankatz14:export-D113580491

Conversation

@evankatz14

@evankatz14 evankatz14 commented Aug 3, 2026

Copy link
Copy Markdown

Summary:

Add a fontVariationSettings text style prop and carry it through Fabric text attributes into Android text rendering. Android now deserializes the prop for <Text>, applies it to Paint, and includes it in text measurement cache identity because variable axes can affect layout.

Preserve the distinction between an absent setting and an explicitly empty setting so nested text can inherit or clear the parent variation axes. Apply high-level font properties before low-level variation settings so explicit axes take precedence, matching CSS font realization order.

Settings syntax is intentionally forwarded unchanged through common text attributes and validated only by the Android font variation parser. This avoids narrowing the grammar Android accepts. As a result, malformed child settings are outside the supported inheritance contract: they replace an inherited value before Android validation and are not guaranteed to fall back to the parent settings. Android also accepts normal and the React Native empty-string convention as explicit resets.

Changelog:
[Android][Added] - Add fontVariationSettings support for <Text>

Reviewed By: Abbondanzo

Differential Revision: D113580491

@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 3, 2026
@meta-codesync

meta-codesync Bot commented Aug 3, 2026

Copy link
Copy Markdown

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

@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Aug 3, 2026
@meta-codesync meta-codesync Bot changed the title Add Android text font variation settings Add Android text font variation settings (#57804) Aug 3, 2026
evankatz14 added a commit to evankatz14/react-native that referenced this pull request Aug 3, 2026
Summary:

Add a `fontVariationSettings` text style prop and carry it through Fabric text attributes into Android text rendering. Android now deserializes the prop for `<Text>`, applies it to `Paint`, and includes it in text measurement cache identity because variable axes can affect layout.

Preserve the distinction between an absent setting and an explicitly empty setting so nested text can inherit or clear the parent variation axes. Apply high-level font properties before low-level variation settings so explicit axes take precedence, matching CSS font realization order.

Settings syntax is intentionally forwarded unchanged through common text attributes and validated only by the Android font variation parser. This avoids narrowing the grammar Android accepts. As a result, malformed child settings are outside the supported inheritance contract: they replace an inherited value before Android validation and are not guaranteed to fall back to the parent settings. Android also accepts `normal` and the React Native empty-string convention as explicit resets.

Changelog:
[Android][Added] - Add `fontVariationSettings` support for `<Text>`

Reviewed By: Abbondanzo

Differential Revision: D113580491
Summary:

Add a `fontVariationSettings` text style prop and carry it through Fabric text attributes into Android text rendering. Android now deserializes the prop for `<Text>`, applies it to `Paint`, and includes it in text measurement cache identity because variable axes can affect layout.

Preserve the distinction between an absent setting and an explicitly empty setting so nested text can inherit or clear the parent variation axes. Apply high-level font properties before low-level variation settings so explicit axes take precedence, matching CSS font realization order.

Settings syntax is intentionally forwarded unchanged through common text attributes and validated only by the Android font variation parser. This avoids narrowing the grammar Android accepts. As a result, malformed child settings are outside the supported inheritance contract: they replace an inherited value before Android validation and are not guaranteed to fall back to the parent settings. Android also accepts `normal` and the React Native empty-string convention as explicit resets.

Changelog:
[Android][Added] - Add `fontVariationSettings` support for `<Text>`

Reviewed By: Abbondanzo

Differential Revision: D113580491
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@matinzd

matinzd commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Successor to: #44667 :D

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.

2 participants