-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RNMobile] Ensure font is scaled on iOS when accessibility settings are changed #57339
Conversation
Flaky tests detected in d98f0b7. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7303326923
|
101a15f
to
60e287f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked great for me @SiobhyB! 🚀
As a future enhancement it would be nice if the editor responded to Dynamic Type changes without needing to be closed and reopened. That's not nearly as important, though, as supporting it in the first place.
packages/react-native-aztec/ios/RNTAztecView/RCTAztecView.swift
Outdated
Show resolved
Hide resolved
A response to feedback noted here: #57339 (comment)
@twstokes, thank you so much for the review! 🙌
This makes sense, I've created a new issue at #57354 listing some of the remaining tasks left to make Dynamic Type support better overall. I've made a note to shape a pitch around accessibility fixes in the New Year which would include this. 🙇♀️ |
} else { | ||
newFontSize = baseFont.pointSize | ||
} | ||
let newFontSize = fontMetrics.scaledValue(for: fontSize ?? baseFont.pointSize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL about scaledValue
👏
Related PRs
Gutenberg Mobile
: [RNMobile] Ensure font is scaled on iOS when accessibility settings are changed wordpress-mobile/gutenberg-mobile#6492WPiOS
: [TESTING] Installable build for Dynamic Type support wordpress-mobile/WordPress-iOS#22272What?
With this PR, we ensure that font in the editor is changed when users change their accessibility settings on iOS.
Why?
At the moment, Dynamic Type is not supported in the editor's
RichText
component for iOS. This is because therefreshFont()
function here is 'undoing' the scaling that takes place elsewhere in Aztec's codebase.How?
We ensure scaling is applied to the new font when it's set here within the
applyFontConstraints()
function.Testing Instructions
Screenshots or screencast
Before and after⤵️
Android comparison⤵️