Skip to content

Commit

Permalink
[RNMobile] Ensure font is scaled on iOS when accessibility settings a…
Browse files Browse the repository at this point in the history
…re changed (WordPress#57339)

Ensure font is scaled on iOS when accessibility settings are changed.
  • Loading branch information
Siobhan Bamber authored Dec 22, 2023
1 parent 47b7afb commit f572440
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f572440

Please sign in to comment.