Skip to content

Commit

Permalink
Respect prop Text.allowFontScaling when sizing text
Browse files Browse the repository at this point in the history
Summary:
changelog:
[iOS][Fixed] Fix Text.allowFontScaling prop in the new architecture

Reviewed By: javache

Differential Revision: D40643536

fbshipit-source-id: 1fb77b226089ce5e9ffc642b1d9a3de266d202c3
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Oct 25, 2022
1 parent 5940d25 commit e9b89b5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e9b89b5

Please sign in to comment.