[iOS] Make font styling work when using specific font name on the new architecture#37109
Closed
j-piasecki wants to merge 1 commit into
Closed
[iOS] Make font styling work when using specific font name on the new architecture#37109j-piasecki wants to merge 1 commit into
j-piasecki wants to merge 1 commit into
Conversation
Base commit: 2cda4f7 |
Contributor
|
@sammy-SC has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
sammy-SC
pushed a commit
to sammy-SC/react-native
that referenced
this pull request
May 3, 2023
…tecture (facebook#37109) Summary: Currently, when `fontFamily` style is set to a specific font instead of a font family, [that specific font is used](https://github.com/facebook/react-native/blob/2058da8f2012578c3e82f1af19c3248346655f9a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm#L126) to display the text on iOS when using the new architecture. This is different behavior to the old architecture, where the font family and [font properties were extracted from the specified](https://github.com/facebook/react-native/blob/2058da8f2012578c3e82f1af19c3248346655f9a/packages/react-native/React/Views/RCTFont.mm#L450-L457) font and overridden if not provided by the user. ## Changelog: [IOS] [FIXED] - Make font resolution work when using specific font name on the new architecture Pull Request resolved: facebook#37109 Test Plan: You can verify the problem on a simple snippet: ```jsx import React from 'react'; import {SafeAreaView, Text} from 'react-native'; function App() { return ( <SafeAreaView style={{flex: 1}}> <Text style={{ fontFamily: 'Helvetica Light Oblique', fontWeight: 'bold', fontStyle: 'normal', }}> Some random text </Text> </SafeAreaView> ); } export default App; ``` <details> <summary> Here's before & after </summary> Without changes from this PR: <img src="https://user-images.githubusercontent.com/21055725/234618852-07cbe67c-f534-4b04-b760-828f4edef549.png" width=400 /> With changes from this PR: <img src="https://user-images.githubusercontent.com/21055725/234618902-9e44a389-8f27-4ab0-95dc-e34ca781d2ed.png" width=400 /> </details> Differential Revision: D45351185 Pulled By: sammy-SC fbshipit-source-id: 09b17b75d58f2cfe82dc755424632ab8cc6da55e
|
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
facebook-github-bot
pushed a commit
that referenced
this pull request
Feb 7, 2024
…tecture (#37109) Summary: Currently, when `fontFamily` style is set to a specific font instead of a font family, [that specific font is used](https://github.com/facebook/react-native/blob/2058da8f2012578c3e82f1af19c3248346655f9a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm#L126) to display the text on iOS when using the new architecture. This is different behavior to the old architecture, where the font family and [font properties were extracted from the specified](https://github.com/facebook/react-native/blob/2058da8f2012578c3e82f1af19c3248346655f9a/packages/react-native/React/Views/RCTFont.mm#L450-L457) font and overridden if not provided by the user. ## Changelog: [IOS] [FIXED] - Make font resolution work when using specific font name on the new architecture Pull Request resolved: #37109 Test Plan: You can verify the problem on a simple snippet: ```jsx import React from 'react'; import {SafeAreaView, Text} from 'react-native'; function App() { return ( <SafeAreaView style={{flex: 1}}> <Text style={{ fontFamily: 'Helvetica Light Oblique', fontWeight: 'bold', fontStyle: 'normal', }}> Some random text </Text> </SafeAreaView> ); } export default App; ``` <details> <summary> Here's before & after </summary> Without changes from this PR: <img src="https://user-images.githubusercontent.com/21055725/234618852-07cbe67c-f534-4b04-b760-828f4edef549.png" width=400 /> With changes from this PR: <img src="https://user-images.githubusercontent.com/21055725/234618902-9e44a389-8f27-4ab0-95dc-e34ca781d2ed.png" width=400 /> </details> Reviewed By: NickGerleman Differential Revision: D45351185 Pulled By: sammy-SC fbshipit-source-id: 1f0a6a52a714ca4989775817d1fb53ae593143f8
|
This pull request was successfully merged by @j-piasecki in 6177408. When will my fix make it into a release? | Upcoming Releases |
facebook-github-bot
pushed a commit
that referenced
this pull request
Feb 8, 2024
… new architecture" (#42919) Summary: Changelog: [IOS] [FIXED] - backout #37109 Pull Request resolved: #42919 Original commit changeset: 1f0a6a52a714 Original Phabricator Diff: D45351185 Reviewed By: cipolleschi Differential Revision: D53566506 fbshipit-source-id: e96813edfee4b54a7828ac02c3dc8aaffc83d6b7
Contributor
|
This pull request has been reverted by f6b984d. |
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:
Currently, when
fontFamilystyle is set to a specific font instead of a font family, that specific font is used to display the text on iOS when using the new architecture. This is different behavior to the old architecture, where the font family and font properties were extracted from the specified font and overridden if not provided by the user.Changelog:
[IOS] [FIXED] - Make font resolution work when using specific font name on the new architecture
Test Plan:
You can verify the problem on a simple snippet:
Here's before & after
Without changes from this PR:

With changes from this PR:
