In Defold, is there a built-in way to respect the user’s preference with regards to font scale on iOS and Android?
In React Native, I’m used to relying on fontScale
(e.g. useWindowDimensions · React Native):
- On Android, they seem to get the value via
context.getResources().getConfiguration().fontScale
(https://github.com/facebook/react-native/blob/a410ef97f6bb735da2946cc9ac7712c821e3bc41/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/deviceinfo/DeviceInfoModule.java#L66) - On iOS, they seem to use
UIApplication.shared.preferredContentSizeCategory
, and then map it to a numeric value (https://github.com/facebook/react-native/blob/a410ef97f6bb735da2946cc9ac7712c821e3bc41/packages/react-native/React/UIUtils/RCTUIUtils.m#L33-L56)