From f572440cbb8b1d6c1b999acf08873f4203483528 Mon Sep 17 00:00:00 2001 From: Siobhan Bamber Date: Fri, 22 Dec 2023 20:35:35 +0000 Subject: [PATCH] [RNMobile] Ensure font is scaled on iOS when accessibility settings are changed (#57339) Ensure font is scaled on iOS when accessibility settings are changed. --- .../ios/RNTAztecView/RCTAztecView.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift b/packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift index c5c2baec5988d..86fa2af37ec59 100644 --- a/packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift +++ b/packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift @@ -650,13 +650,9 @@ class RCTAztecView: Aztec.TextView { /// private func applyFontConstraints(to baseFont: UIFont) -> UIFont { let oldDescriptor = baseFont.fontDescriptor - let newFontSize: CGFloat + let fontMetrics = UIFontMetrics(forTextStyle: .body) - if let fontSize = fontSize { - newFontSize = fontSize - } else { - newFontSize = baseFont.pointSize - } + let newFontSize = fontMetrics.scaledValue(for: fontSize ?? baseFont.pointSize) var newTraits = oldDescriptor.symbolicTraits