From 130d400ab84e65911db9cfdaab679b8abaa9635a Mon Sep 17 00:00:00 2001 From: cdOut <88325488+cdOut@users.noreply.github.com> Date: Mon, 15 Jul 2024 19:13:20 +0200 Subject: [PATCH] add patch for font scalling in react-native --- ...17+iOS-fix-whitespace-support-sourcemap.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/patches/react-native+0.73.4+017+iOS-fix-whitespace-support-sourcemap.patch b/patches/react-native+0.73.4+017+iOS-fix-whitespace-support-sourcemap.patch index e8ca87026282..9199c7d322ae 100644 --- a/patches/react-native+0.73.4+017+iOS-fix-whitespace-support-sourcemap.patch +++ b/patches/react-native+0.73.4+017+iOS-fix-whitespace-support-sourcemap.patch @@ -1,3 +1,19 @@ +diff --git a/node_modules/react-native/Libraries/Text/Text/NSTextStorage+FontScaling.m b/node_modules/react-native/Libraries/Text/Text/NSTextStorage+FontScaling.m +index ee391a2..cdd6358 100644 +--- a/node_modules/react-native/Libraries/Text/Text/NSTextStorage+FontScaling.m ++++ b/node_modules/react-native/Libraries/Text/Text/NSTextStorage+FontScaling.m +@@ -19,6 +19,11 @@ - (void)scaleFontSizeToFitSize:(CGSize)size + minimumFontSize:(CGFloat)minimumFontSize + maximumFontSize:(CGFloat)maximumFontSize + { ++ // Don't scale the font if it already fits ++ if ([self compareToSize:size thresholdRatio:0.01] & RCTTextSizeComparisonSmaller) { ++ return; ++ } ++ + CGFloat bottomRatio = 1.0 / 128.0; + CGFloat topRatio = 128.0; + CGFloat ratio = 1.0; diff --git a/node_modules/react-native/scripts/react-native-xcode.sh b/node_modules/react-native/scripts/react-native-xcode.sh index d6c382b..3e1742c 100755 --- a/node_modules/react-native/scripts/react-native-xcode.sh