diff --git a/patches/react-native@0.86.0.patch b/patches/react-native@0.86.0.patch index eb91618aa9..2fcc63c350 100644 --- a/patches/react-native@0.86.0.patch +++ b/patches/react-native@0.86.0.patch @@ -178,6 +178,19 @@ index 89b666dcf0258df0702c812600b685463128294c..2b1c3971f0c31a0d7a592b90170e4cc5 val intersects = clippingRect.intersects(child.left, child.top, child.right, child.bottom) var needUpdateClippingRecursive = false +diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm +index 9b04cad..b2b2762 100644 +--- a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm ++++ b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm +@@ -361,7 +361,7 @@ UIFont *RCTFontWithFontProperties(RCTFontProperties fontProperties) + font = [UIFont fontWithName:fontProperties.family size:effectiveFontSize]; + if (font != nullptr) { + fontNames = [UIFont fontNamesForFamilyName:font.familyName]; +- fontWeight = (fontWeight != 0.0) ?: RCTGetFontWeight(font); ++ fontWeight = (fontWeight != 0.0) ? fontWeight : RCTGetFontWeight(font); + } else { + // Failback to system font. + font = RCTDefaultFontWithFontProperties(fontProperties); diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm index ac55304..d99c8f4 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm diff --git a/patches/react-native@0.86.0.patch.md b/patches/react-native@0.86.0.patch.md index d34a684958..d15b6b2e80 100644 --- a/patches/react-native@0.86.0.patch.md +++ b/patches/react-native@0.86.0.patch.md @@ -79,6 +79,16 @@ the prebuilt AAR from Maven Central instead, where this hunk (like any ReactAndr source change) has no effect - do not expect to see the fix in a local debug build unless you prebuild with EXPO_PUBLIC_ENV=production or add the substitution block manually. +## RCTFontUtils.mm Patch - Custom font weights render as the heaviest face on New Arch + +**TODO: Remove after bumping React Native to a release that contains facebook/react-native#57483** +(commit 918fb15bfe5f, on `main`; not in 0.86 and not yet released). + +Backport of the upstream one-liner: use a real ternary so the numeric weight is returned instead of +the boolean. For a double, `(A != 0.0) ? A : B` is exactly equivalent to the original `A ?: B`. + +PR: https://github.com/facebook/react-native/pull/57483 + ## RCTTextLayoutManager.mm Patch - Text overflows instead of wrapping on the last line Issue: https://github.com/react/react-native/issues/53450#issuecomment-3298157830