Skip to content

Commit e9b89b5

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
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
1 parent 5940d25 commit e9b89b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ inline static UIFontWeight RCTUIFontWeightFromInteger(NSInteger fontWeight)
7171
fontProperties.weight = textAttributes.fontWeight.has_value()
7272
? RCTUIFontWeightFromInteger((NSInteger)textAttributes.fontWeight.value())
7373
: NAN;
74-
fontProperties.sizeMultiplier = textAttributes.fontSizeMultiplier;
74+
fontProperties.sizeMultiplier =
75+
textAttributes.allowFontScaling.value_or(true) ? textAttributes.fontSizeMultiplier : 1;
7576

7677
return RCTFontWithFontProperties(fontProperties);
7778
}

0 commit comments

Comments
 (0)