From e9b89b5ff2b0085128bec2879d761352747d6714 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 25 Oct 2022 05:51:25 -0700 Subject: [PATCH] Respect prop Text.allowFontScaling when sizing text Summary: changelog: [iOS][Fixed] Fix Text.allowFontScaling prop in the new architecture Reviewed By: javache Differential Revision: D40643536 fbshipit-source-id: 1fb77b226089ce5e9ffc642b1d9a3de266d202c3 --- .../textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm index 1194d476cbc34d..7f5117040cc1a2 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +++ b/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm @@ -71,7 +71,8 @@ inline static UIFontWeight RCTUIFontWeightFromInteger(NSInteger fontWeight) fontProperties.weight = textAttributes.fontWeight.has_value() ? RCTUIFontWeightFromInteger((NSInteger)textAttributes.fontWeight.value()) : NAN; - fontProperties.sizeMultiplier = textAttributes.fontSizeMultiplier; + fontProperties.sizeMultiplier = + textAttributes.allowFontScaling.value_or(true) ? textAttributes.fontSizeMultiplier : 1; return RCTFontWithFontProperties(fontProperties); }