iOS/Android: Text Scale #30873
Labels
Accessibility Team - Evaluated
Accessibility
Good first issue
Interested in collaborating? Take a stab at fixing one of these issues.
Platform: Android
Android applications.
Platform: iOS
iOS applications.
Resolution: Locked
This issue was locked by the bot.
Projects
Requires API Proposal
This issue may require a new API, or a change to an existing API. An API proposal should be added and discussed before proceeding with implementation. The API proposal can be added in the comments of this issue or linked as a separate issue.
Description
Both iOS and Android allow users to change the current size of their font at a system level. Apps should respect this setting, and when rendering text via some custom manner (graphs, charts, image composition, etc.), may need to take it into account.
React Native version:
v0.63
Expected Behavior
Currently the AccessibilityInfo API has no method to detect the current font scale that a user has chosen. It should have a method that works on both iOS and Android. iOS and Android treat scaling differently, with iOS having named sizes, and Android using a multiplier, so this information may need to be normalized.
Android Details
The setting on Android may show named sizes or a slider of different multiplier values (depending on the device manufacturer). On the hood these are always treated as a multiplier. The current value can be queried using the
Settings.System.FONT_SCALE
property.https://developer.android.com/reference/android/provider/Settings.System#FONT_SCALE
iOS Details
On iOS you can use the
preferredContentSizeCategory
property to query this value.https://developer.apple.com/documentation/uikit/uitraitcollection/1771746-preferredcontentsizecategory
The text was updated successfully, but these errors were encountered: